98 for action in ('read', 'add', 'delete'): |
98 for action in ('read', 'add', 'delete'): |
99 drop_relation_definition('CWRType', '%s_permission' % action, 'CWGroup', commit=False) |
99 drop_relation_definition('CWRType', '%s_permission' % action, 'CWGroup', commit=False) |
100 drop_relation_definition('CWRType', '%s_permission' % action, 'RQLExpression') |
100 drop_relation_definition('CWRType', '%s_permission' % action, 'RQLExpression') |
101 sync_schema_props_perms('read_permission', syncperms=False) # fix read_permission cardinality |
101 sync_schema_props_perms('read_permission', syncperms=False) # fix read_permission cardinality |
102 |
102 |
103 if applcubicwebversion < (3, 9, 6) and cubicwebversion >= (3, 9, 6): |
103 if applcubicwebversion < (3, 9, 6) and cubicwebversion >= (3, 9, 6) and not 'CWUniqueTogetherConstraint' in schema: |
104 add_entity_type('CWUniqueTogetherConstraint') |
104 add_entity_type('CWUniqueTogetherConstraint') |
105 |
105 |
106 if not ('CWUniqueTogetherConstraint', 'CWRType') in schema['relations'].rdefs: |
106 if not ('CWUniqueTogetherConstraint', 'CWRType') in schema['relations'].rdefs: |
107 add_relation_definition('CWUniqueTogetherConstraint', 'relations', 'CWRType') |
107 add_relation_definition('CWUniqueTogetherConstraint', 'relations', 'CWRType') |
108 rql('SET C relations RT WHERE C relations RDEF, RDEF relation_type RT') |
108 rql('SET C relations RT WHERE C relations RDEF, RDEF relation_type RT') |