Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Suppose I created this relationship attribute set and it has four 4 attributes
- {
- id: 1,
- attribute: [
- {
- id: 1,
- attributeType: 1,
- },
- {
- id: 2,
- attributeType: 1,
- },
- {
- id: 3,
- attributeType: 1,
- },
- {
- id: 4,
- attributeType: 1,
- }
- ]
- }
- Now the problem is how will we insert value in `text_value` column of `relationship_attribute_text_value` table associated with the above attribute id 1,2,3, 4
- If the text_value column was in the `relationship_attribute` table we could have easily done that. (just like we have `value` column in identifier table or `source_bbid`, `target_bbid` column in `relationship` table we need the `text_value` column in the `relationship_attribute` table)
- If we go with our current schema the only workaround i can think of is looping through above attribute array and then inserting the value
- attribute.map(row => await new RelationshipAttributeTextValue({id: row.id value: 'someValue' }).save(null, {method: 'insert'}));
- But again the problem arises here is that how will we know which value will be associated with which attribute id ?
- Also if i am not wrong with the current schema the problem `changing an item in a series from position "1" to position "2", and comparing the two revisions?` will still remain if we keep the text_value column in a separate table.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement