[PATCH seda v2] [migration] Add migration script to synchronize compound etypes / relations

Sylvain Thenault sylvain.thenault at logilab.fr
Wed Jun 14 16:56:03 CEST 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1497356950 -7200
#      Tue Jun 13 14:29:10 2017 +0200
# Node ID ed5b4218a1f56ce8319db20751b07b5291933eb6
# Parent  a21a6e5f04c4a353e269ff7a174eb78e8e19cdc8
# Available At https://hg.logilab.org/review/cubes/seda
#              hg pull https://hg.logilab.org/review/cubes/seda -r ed5b4218a1f5
[migration] Add migration script to synchronize compound etypes / relations


missed by 8f1a4f7abbf6

Related to extranet #25271719

diff --git a/cubicweb_seda/migration/0.10.4_Any.py b/cubicweb_seda/migration/0.10.4_Any.py
new file mode 100644
--- /dev/null
+++ b/cubicweb_seda/migration/0.10.4_Any.py
@@ -0,0 +1,16 @@
+from __future__ import print_function
+
+from cubicweb_seda import seda_profile_container_def, iter_all_rdefs
+
+for etype, parent_rdefs in seda_profile_container_def(schema):
+    sync_schema_props_perms(etype, syncprops=False)
+
+for rdef, role in iter_all_rdefs(schema, 'SEDAArchiveTransfer'):
+    try:
+        x = fsschema[rdef.rtype].rdefs[(rdef.subject, rdef.object)]
+    except KeyError:
+        print('junk detected in database schema', rdef)
+        continue
+    else:
+        sync_schema_props_perms((rdef.subject, rdef.rtype, rdef.object),
+                                syncprops=False)


More information about the saem-devel mailing list