misc/migration/bootstrapmigration_repository.py
branchstable
changeset 7780 a1d5365fefc1
parent 7736 8767d03dab17
child 7782 40a49f4350a5
equal deleted inserted replaced
7779:3826d8480a68 7780:a1d5365fefc1
    38 if applcubicwebversion <= (3, 13, 0) and cubicwebversion >= (3, 13, 1):
    38 if applcubicwebversion <= (3, 13, 0) and cubicwebversion >= (3, 13, 1):
    39     sql('ALTER TABLE entities ADD asource VARCHAR(64)')
    39     sql('ALTER TABLE entities ADD asource VARCHAR(64)')
    40     sql('UPDATE entities SET asource=cw_name  '
    40     sql('UPDATE entities SET asource=cw_name  '
    41         'FROM cw_CWSource, cw_source_relation '
    41         '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')
    42         'WHERE entities.eid=cw_source_relation.eid_from AND cw_source_relation.eid_to=cw_CWSource.cw_eid')
       
    43 
       
    44 if applcubicwebversion <= (3, 14, 0) and cubicwebversion >= (3, 14, 0):
       
    45     if 'require_permission' in schema and not 'localperms'in repo.config.cubes():
       
    46         from cubicweb import ExecutionError
       
    47         try:
       
    48             add_cube('localperms', update_database=False)
       
    49         except ImportError:
       
    50             raise ExecutionError('In cubicweb 3.14, CWPermission and related stuff '
       
    51                                  'has been moved to cube localperms. Install it first.')
    43 
    52 
    44 if applcubicwebversion == (3, 6, 0) and cubicwebversion >= (3, 6, 0):
    53 if applcubicwebversion == (3, 6, 0) and cubicwebversion >= (3, 6, 0):
    45     CSTRMAP = dict(rql('Any T, X WHERE X is CWConstraintType, X name T',
    54     CSTRMAP = dict(rql('Any T, X WHERE X is CWConstraintType, X name T',
    46                        ask_confirm=False))
    55                        ask_confirm=False))
    47     _add_relation_definition_no_perms('CWAttribute', 'update_permission', 'CWGroup')
    56     _add_relation_definition_no_perms('CWAttribute', 'update_permission', 'CWGroup')