misc/migration/bootstrapmigration_repository.py
brancholdstable
changeset 7676 cc3987eb793c
parent 7549 465009397d91
child 7562 cdef82ca9eab
equal deleted inserted replaced
7388:dc319ece0bd6 7676:cc3987eb793c
     1 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     1 # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 #
     3 #
     4 # This file is part of CubicWeb.
     4 # This file is part of CubicWeb.
     5 #
     5 #
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
    92         for action in ('read', 'add', 'delete'):
    92         for action in ('read', 'add', 'delete'):
    93             drop_relation_definition('CWRType', '%s_permission' % action, 'CWGroup', commit=False)
    93             drop_relation_definition('CWRType', '%s_permission' % action, 'CWGroup', commit=False)
    94             drop_relation_definition('CWRType', '%s_permission' % action, 'RQLExpression')
    94             drop_relation_definition('CWRType', '%s_permission' % action, 'RQLExpression')
    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) and not 'CWUniqueTogetherConstraint' in schema:
    98     add_entity_type('CWUniqueTogetherConstraint')
    98     add_entity_type('CWUniqueTogetherConstraint')
    99 
    99 
   100 if not ('CWUniqueTogetherConstraint', 'CWRType') in schema['relations'].rdefs:
   100 if not ('CWUniqueTogetherConstraint', 'CWRType') in schema['relations'].rdefs:
   101     add_relation_definition('CWUniqueTogetherConstraint', 'relations', 'CWRType')
   101     add_relation_definition('CWUniqueTogetherConstraint', 'relations', 'CWRType')
   102     rql('SET C relations RT WHERE C relations RDEF, RDEF relation_type RT')
   102     rql('SET C relations RT WHERE C relations RDEF, RDEF relation_type RT')