misc/migration/2.44.0_Any.py
author sylvain.thenault@logilab.fr
Thu, 02 Apr 2009 17:35:03 +0200
changeset 1218 680a8fe589a8
parent 0 b97547f5f1fa
child 1398 5fe84a5f7035
permissions -rw-r--r--
merge should-not-be-a-branch to default. ENSURE YOUR LOCAL REPOSITORY IS IN THE default BRANCH
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     1
change_relation_props('EFRDef', 'cardinality', 'String', internationalizable=True)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     2
change_relation_props('ENFRDef', 'cardinality', 'String', internationalizable=True)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     3
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     4
drop_relation_definition('EPermission', 'require_state', 'State')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     5
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     6
if confirm('cleanup require_permission relation'):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     7
    try:
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     8
        newrschema = newschema.rschema('require_permission')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     9
    except KeyError:
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    10
        newrschema = None
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    11
    for rsubj, robj in schema.rschema('require_permission').rdefs():
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    12
        if newrschema is None or not newrschema.has_rdef(rsubj, robj):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    13
            print 'removing', rsubj, 'require_permission', robj
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    14
            drop_relation_definition(rsubj, 'require_permission', robj, ask_confirm=False)