misc/migration/bootstrapmigration_repository.py
changeset 7562 cdef82ca9eab
parent 7547 3d654a7df823
parent 7549 465009397d91
child 7736 8767d03dab17
equal deleted inserted replaced
7554:fdace9d67d96 7562:cdef82ca9eab
    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')