[migration/3.18] Add add_permission relation definitions earlier
authorDenis Laxalde <denis.laxalde@logilab.fr>
Tue, 14 Jan 2014 14:42:00 +0100
changeset 9407 34fccd9104bc
parent 9406 38debfa8b536
child 9408 f11854169654
[migration/3.18] Add add_permission relation definitions earlier Otherwise sync_schema_props_perms('defaultval') does not work because the later relation is not in schema.
misc/migration/3.18.0_Any.py
--- a/misc/migration/3.18.0_Any.py	Tue Jan 14 14:02:51 2014 +0100
+++ b/misc/migration/3.18.0_Any.py	Tue Jan 14 14:42:00 2014 +0100
@@ -4,6 +4,9 @@
     print >>sys.stderr, 'This migration is not supported for backends other than sqlserver or postgres (yet).'
     sys.exit(1)
 
+add_relation_definition('CWAttribute', 'add_permission', 'CWGroup')
+add_relation_definition('CWAttribute', 'add_permission', 'RQLExpression')
+
 sync_schema_props_perms('defaultval')
 
 def convert_defaultval(cwattr, default):
@@ -120,9 +123,6 @@
         commit()
 
 
-add_relation_definition('CWAttribute', 'add_permission', 'CWGroup')
-add_relation_definition('CWAttribute', 'add_permission', 'RQLExpression')
-
 # all attributes perms have to be refreshed ...
 for rschema in schema.relations():
     if relation.final: