| 1 | = GenericTrac Data Model = |
| 2 | |
| 3 | This is an experimental branch for trying out the various ideas exposed in the recent proposals: |
| 4 | - TracDev/Proposals/DataModel |
| 5 | - TracDev/Proposals/Journaling |
| 6 | |
| 7 | See also [googlegroups:trac-dev:8cf3f5fe0e476ce5 this mail]. |
| 8 | |
| 9 | |
| 10 | == Current Status == |
| 11 | |
| 12 | === TODO === |
| 13 | - modify the Milestone module so that it uses the new proposed datamodel. See [#TheMilestoneExample]. |
| 14 | - experiment new tabbed view for the milestone (''View'', ''Discussion'', ''History''). See TracProject/UiGuidelines. |
| 15 | - milestone should be able to have attachments, too (#3068) |
| 16 | - adapt the Roadmap module to the new model |
| 17 | - adapt the Milestone admin component to the new model |
| 18 | |
| 19 | Once this is complete, validate the genericity by promoting the components to be first class resources as well (#1233). |
| 20 | |
| 21 | |
| 22 | Working on the generic aspect of Trac should also make it possible to implement various ''generic'' operations on Trac resources as plugins, mainly being able to (re-)implement TracCrossReferences as a plugin. |
| 23 | |
| 24 | |
| 25 | === DONE === |
| 26 | - ''Not yet started'' |
| 27 | |
| 28 | == The Milestone Example == |
| 29 | |
| 30 | The proposed data model would be: |
| 31 | {{{ |
| 32 | #!sql |
| 33 | -- record Milestone current properties |
| 34 | -- |
| 35 | create table milestone_prop ( |
| 36 | id text, |
| 37 | name text, |
| 38 | value text |
| 39 | ); |
| 40 | |
| 41 | create index milestone_idx on milestone_prop (id, name); |
| 42 | |
| 43 | -- record Milestone change metadata |
| 44 | -- |
| 45 | create table milestone_journal ( |
| 46 | tid int primary key, |
| 47 | date int, |
| 48 | authname text, |
| 49 | author text, |
| 50 | ip text, |
| 51 | authenticated int |
| 52 | ); |
| 53 | |
| 54 | create index milestone_date_idx on milestone_journal ( date ); |
| 55 | create index milestone_authname_idx on milestone_journal ( authname, authenticated ); |
| 56 | |
| 57 | -- record Milestone changed properties |
| 58 | -- |
| 59 | create table milestone_history ( |
| 60 | tid int, |
| 61 | id text, |
| 62 | name text, |
| 63 | value text, |
| 64 | unique (tid, id) |
| 65 | ); |
| 66 | }}} |
| 67 | |
| 68 | The existing `milestone` table can be kept, it will simply not be used anymore. |
| 69 | This will allow to test the branch within existing environments. |