misc/migration/2.44.0_Any.py
author Aurelien Campeas <aurelien.campeas@logilab.fr>
Tue, 19 May 2009 15:42:32 +0200
branchstable
changeset 1870 015dfeaf1d89
parent 1399 3f408c7a164e
child 1977 606923dff11b
permissions -rw-r--r--
trailing space cleanup, js lint, a small indent for preference sections
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1398
5fe84a5f7035 rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents: 0
diff changeset
     1
change_relation_props('CWAttribute', 'cardinality', 'String', internationalizable=True)
5fe84a5f7035 rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents: 0
diff changeset
     2
change_relation_props('CWRelation', 'cardinality', 'String', internationalizable=True)
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     3
1398
5fe84a5f7035 rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents: 0
diff changeset
     4
drop_relation_definition('CWPermission', 'require_state', 'State')
0
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:
1399
3f408c7a164e unify schema sync migration commands with (hopefuly) a clearer name
sylvain.thenault@logilab.fr
parents: 1398
diff changeset
     8
        newrschema = fsschema.rschema('require_permission')
0
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)