misc/migration/bootstrapmigration_repository.py
changeset 3890 d7a270f50f54
parent 3395 405f393bcac0
parent 3788 3d5abcd7c852
child 4011 394f853bb653
equal deleted inserted replaced
3810:5b75fd66c80e 3890:d7a270f50f54
    26     isession.commit()
    26     isession.commit()
    27     reactivate_verification_hooks()
    27     reactivate_verification_hooks()
    28     session.set_shared_data('do-not-insert-cwuri', False)
    28     session.set_shared_data('do-not-insert-cwuri', False)
    29 
    29 
    30 if applcubicwebversion < (3, 5, 0) and cubicwebversion >= (3, 5, 0):
    30 if applcubicwebversion < (3, 5, 0) and cubicwebversion >= (3, 5, 0):
       
    31     # check that migration is not doomed
       
    32     rset = rql('Any X,Y WHERE X transition_of E, Y transition_of E, '
       
    33                'X name N, Y name N, NOT X identity Y',
       
    34                ask_confirm=False)
       
    35     if rset:
       
    36         from logilab.common.shellutils import ASK
       
    37         if not ASK.confirm('Migration will fail because of transitions with the same name. '
       
    38                            'Continue anyway ?'):
       
    39             import sys
       
    40             sys.exit(1)
       
    41     # proceed with migration
    31     add_entity_type('Workflow')
    42     add_entity_type('Workflow')
    32     add_entity_type('BaseTransition')
    43     add_entity_type('BaseTransition')
    33     add_entity_type('WorkflowTransition')
    44     add_entity_type('WorkflowTransition')
    34     add_entity_type('SubWorkflowExitPoint')
    45     add_entity_type('SubWorkflowExitPoint')
    35     # drop explicit 'State allowed_transition Transition' since it should be
    46     # drop explicit 'State allowed_transition Transition' since it should be