[migration/3.18] speed up the migration and be a little bit more informative stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 19 Nov 2014 12:36:43 +0100
branchstable
changeset 10055 b23043546f2c
parent 10054 8f7291354095
child 10056 cb96f4403cf2
[migration/3.18] speed up the migration and be a little bit more informative Closes #4619277.
misc/migration/3.18.0_Any.py
--- a/misc/migration/3.18.0_Any.py	Mon Nov 24 12:36:17 2014 +0100
+++ b/misc/migration/3.18.0_Any.py	Wed Nov 19 12:36:43 2014 +0100
@@ -133,17 +133,19 @@
 # recreate the constraints, hook will lead to low-level recreation
 for eschema in sorted(schema.entities()):
     if eschema._unique_together:
+        print 'recreate unique indexes for', eschema
         rql_args = schemaserial.uniquetogether2rqls(eschema)
         for rql, args in rql_args:
             args['x'] = eschema.eid
             session.execute(rql, args)
-        commit()
-
+commit()
 
 # all attributes perms have to be refreshed ...
-for rschema in schema.relations():
+for rschema in sorted(schema.relations()):
     if rschema.final:
         if rschema.type in fsschema:
-            sync_schema_props_perms(rschema.type, syncprops=False, ask_confirm=False)
+            print 'sync perms for', rschema.type
+            sync_schema_props_perms(rschema.type, syncprops=False, ask_confirm=False, commit=False)
         else:
             print 'WARNING: attribute %s missing from fs schema' % rschema.type
+commit()