misc/migration/bootstrapmigration_repository.py
branchstable
changeset 6896 784d5df35af1
parent 6222 21772f4e41d9
child 7398 26695dd703d8
child 7549 465009397d91
equal deleted inserted replaced
6895:32eb31855196 6896:784d5df35af1
    95     sync_schema_props_perms('read_permission', syncperms=False) # fix read_permission cardinality
    95     sync_schema_props_perms('read_permission', syncperms=False) # fix read_permission cardinality
    96 
    96 
    97 if applcubicwebversion < (3, 9, 6) and cubicwebversion >= (3, 9, 6):
    97 if applcubicwebversion < (3, 9, 6) and cubicwebversion >= (3, 9, 6):
    98     add_entity_type('CWUniqueTogetherConstraint')
    98     add_entity_type('CWUniqueTogetherConstraint')
    99 
    99 
       
   100 if not ('CWUniqueTogetherConstraint', 'CWRType') in schema['relations'].rdefs:
       
   101     add_relation_definition('CWUniqueTogetherConstraint', 'relations', 'CWRType')
       
   102     rql('SET C relations RT WHERE C relations RDEF, RDEF relation_type RT')
       
   103     commit()
       
   104     drop_relation_definition('CWUniqueTogetherConstraint', 'relations', 'CWAttribute')
       
   105     drop_relation_definition('CWUniqueTogetherConstraint', 'relations', 'CWRelation')
       
   106 
       
   107 
   100 if applcubicwebversion < (3, 4, 0) and cubicwebversion >= (3, 4, 0):
   108 if applcubicwebversion < (3, 4, 0) and cubicwebversion >= (3, 4, 0):
   101 
   109 
   102     with hooks_control(session, session.HOOKS_ALLOW_ALL, 'integrity'):
   110     with hooks_control(session, session.HOOKS_ALLOW_ALL, 'integrity'):
   103         session.set_shared_data('do-not-insert-cwuri', True)
   111         session.set_shared_data('do-not-insert-cwuri', True)
   104         add_relation_type('cwuri')
   112         add_relation_type('cwuri')