misc/migration/bootstrapmigration_repository.py
changeset 7543 570522300e22
parent 7398 26695dd703d8
child 7547 3d654a7df823
equal deleted inserted replaced
7542:86e9632a4e9c 7543:570522300e22
     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
    32     rdef.rtype = schema.rschema(rtype)
    32     rdef.rtype = schema.rschema(rtype)
    33     rdef.subject = schema.eschema(subjtype)
    33     rdef.subject = schema.eschema(subjtype)
    34     rdef.object = schema.eschema(objtype)
    34     rdef.object = schema.eschema(objtype)
    35     ss.execschemarql(rql, rdef, ss.rdef2rql(rdef, CSTRMAP, groupmap=None))
    35     ss.execschemarql(rql, rdef, ss.rdef2rql(rdef, CSTRMAP, groupmap=None))
    36     commit(ask_confirm=False)
    36     commit(ask_confirm=False)
       
    37 
       
    38 if applcubicwebversion == (3, 13, 0) and cubicwebversion >= (3, 13, 1):
       
    39     sql('ALTER TABLE entities ADD COLUMN asource VARCHAR(64)')
       
    40     sql('INSERT INTO entities(asource) '
       
    41         'SELECT cw_name FROM cw_CWSource, cw_source_relation '
       
    42         'WHERE entities.eid=cw_source_relation.eid_from AND cw_source_relation.eid_to=cw_CWSource.cw_eid')
    37 
    43 
    38 if applcubicwebversion == (3, 6, 0) and cubicwebversion >= (3, 6, 0):
    44 if applcubicwebversion == (3, 6, 0) and cubicwebversion >= (3, 6, 0):
    39     CSTRMAP = dict(rql('Any T, X WHERE X is CWConstraintType, X name T',
    45     CSTRMAP = dict(rql('Any T, X WHERE X is CWConstraintType, X name T',
    40                        ask_confirm=False))
    46                        ask_confirm=False))
    41     _add_relation_definition_no_perms('CWAttribute', 'update_permission', 'CWGroup')
    47     _add_relation_definition_no_perms('CWAttribute', 'update_permission', 'CWGroup')