Problem/Motivation
I was trying to do #2378359: Convert Questions to D7 Entity API when I noticed that we have redundant data storage and cannot correctly make Quiz questions entities. Any efforts would just be heading in the wrong direction.
Now that quiz "questions" {quiz_question_properties table} are considered an entity internally let's make the built in question types relate to them only on the question ID instead of nid/vid. We gain a couple things from this including Entity definitions and Views support now that they will relate on 1 field. Having redundant primary keys is also bad practice.
This also will take the versioning responsibility off of the question and question types as it will allow us to take advantage of EntityAPIControllerRevisionableInterface later.
For example
quiz_question_properties ("question" table)
- nid
- vid
- qqp_id
Proposed resolution
quiz_truefalse_node
- nid
- vid
(should be:)
quiz_truefalse_node
- qqp_id
This helps with #2378359: Convert Questions to D7 Entity API, as when using entity API/Views we prefer single non-redundant keys on tables when linking to another table.
Remaining tasks
- Migrate question types schema nid/vid to qqp_id
- Update entity reference definitions so that questions types relate back to the qqp table.
- Change "saveNodeProperties" to just "saveProperties" as we are not saving nid/vid anymore.
User interface changes
None
API changes
Schema fields (not yet accessible to Views) change.
Comment | File | Size | Author |
---|---|---|---|
#32 | remove_redundant-2399209-32.patch | 26.6 KB | djdevin |
Comments
Comment #1
djdevinComment #2
djdevinComment #3
djdevinComment #4
djdevinComment #5
djdevinComment #6
djdevinPoC with truefalse.
Comment #8
djdevinComment #9
djdevinComment #11
djdevinComment #12
djdevinComment #14
djdevinComment #15
djdevinComment #18
djdevinComment #20
djdevinComment #22
djdevinComment #24
djdevinComment #26
djdevinComment #28
djdevinComment #30
djdevinComment #32
djdevin