[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.
--- 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: