View Issue Details

IDProjectCategoryView StatusLast Update
17350Development Otherpublic2021-06-11 16:10
Reporterollehar Assigned Togabrieljenik  
PrioritynoneSeverityminor 
Status assignedResolutionopen 
Product Version4.x.0-dev 
Target Version4.x.0-dev 
Summary17350: Question theme should be a separate database column, not an attribute
DescriptionTo facilitate code like $question->question_theme using AR relations.
TagsNo tags attached.

Activities

gabrieljenik

gabrieljenik

2021-06-11 15:49

manager   ~64877

> To facilitate code like $question->question_theme using AR relations.

Is this really needed. This could be a really mess as the keys need to be moved from theme_names to numeric ids.
Can we just do question_theme as a column and leave the relationship for later?
Maybe adding a helper method that mimics the relationsip but not a "real one".
Or maybe see if we can make the relationship to be linked by theme name (alternative key).
But anyway, leave the relationship for later

What do you think?
ollehar

ollehar

2021-06-11 15:55

administrator   ~64878

Last edited: 2021-06-11 15:56

View 3 revisions

> Can we just do question_theme as a column and leave the relationship for later?

The relation is automatic by Yii (kind of) as soon as you have the column. :)

lime_questions.question_theme_id --> id of question theme

Yeah, needs a db update to apply to all questions in installation. So might not be a very small fix.

Subquestions, when parent_id is set, should have question_theme_id NULL.

Adding a new column without using it doesn't make much sense, tho.

This is _really_ how the original design should have been...
gabrieljenik

gabrieljenik

2021-06-11 16:01

manager   ~64879

well, it is not only that, what if Id changes from installation to installation. That will impact the export / import.
There could be other implications not known yet.

Honestly, feels better to do firt its own column, and then see best way to implement relationship.
How do you feel about that?
ollehar

ollehar

2021-06-11 16:03

administrator   ~64880

Good point! So maybe question_theme_name instead? Since name is unique too.

> Honestly, feels better to do firt its own column, and then see best way to implement relationship

Not sure how you would split that task?
gabrieljenik

gabrieljenik

2021-06-11 16:06

manager   ~64881

> Not sure how you would split that task?

Not sure, but first I will work on moving the attribute.
Then on reviewing how to use the relationship :)
ollehar

ollehar

2021-06-11 16:10

administrator   ~64882

In my head that's the same task. xD But have a look.

Issue History

Date Modified Username Field Change
2021-06-02 17:59 ollehar New Issue
2021-06-11 15:49 gabrieljenik Note Added: 64877
2021-06-11 15:55 ollehar Note Added: 64878
2021-06-11 15:56 ollehar Note Edited: 64878 View Revisions
2021-06-11 15:56 ollehar Note Edited: 64878 View Revisions
2021-06-11 16:01 gabrieljenik Note Added: 64879
2021-06-11 16:03 ollehar Note Added: 64880
2021-06-11 16:06 gabrieljenik Note Added: 64881
2021-06-11 16:10 ollehar Note Added: 64882
2021-06-11 16:10 ollehar Assigned To => gabrieljenik
2021-06-11 16:10 ollehar Status new => assigned