[RFC] replace the dkp & adjustment table with transactions

You have some neat ideas wou wuold like to see implemented ?

Moderator: Developer

Forum rules
Accepted features will be published on Github
User avatar
Posts: 2586
Joined: 28 Dec 2007, 14:56
Location: Ironforge

[RFC] replace the dkp & adjustment table with transactions

Post by Sajaki » 10 Jan 2016, 13:27

bbDKP inherited from EQDKP a certain way of storing points in fixed points table, namely "memberdkp" and "adjustments". EQDKP Plus is still using this same table structure also last I checked.

This design is very inefficient from a design and rollback standpoint.

Firstly, it forces you to create new column for each type of point. That's why there are multiple columns for each point type, etc. member_time_bonus, member_earned, etc column

From a rollback standpoint, it is bad because you have to update the points table for each participating raid member.
Deleting a raid will not set each member's earned back to zero, since there is no one "earned" value per raid member, as you have for classic DKP, since it varies in function of join time, equal to <leave-join>.

Instead there should be a transaction table. Then, each raid adds a new record per DKP account in this table.

This is similar to the architecture of an accounting system, where you typically have several accounts in a general ledger table. So we'll have an account called "earned", "time", "gearpoints", "effortpoints", "spent", with one analytical dimension per DKP account.

The "members_earned" and "adjustment" table will probably be dropped because of this change. the items table will continue to exist.

The EP/GP ratio will so result from a Select in the transactions table.

I realise this means a radical overhaul, but this is the right time to do it since phpBB itself has changed so much.

Github issue : #173