[migration] Move pyramid-related migration after "entities" table modifications
Otherwise, we getting into `add_entity_type('CWSession')` we try to insert a
CWEType without any 'asource' column (per 3.24's schema) whereas the backend
still wants it.
Closes #17054035.
--- a/cubicweb/misc/migration/3.24.0_Any.py Tue Jan 31 11:06:28 2017 +0100
+++ b/cubicweb/misc/migration/3.24.0_Any.py Mon Feb 06 11:21:31 2017 +0100
@@ -1,11 +1,6 @@
from base64 import b64decode
-# Check the CW versions and add the entity only if needed ?
-add_entity_type('CWSession')
-rql('DELETE CWProperty X WHERE X pkey "system.version.pyramid"',
- ask_confirm=False)
-
# before removing extid, ensure it's coherent with cwuri
for eid, etype, encoded_extid in sql(
"SELECT eid, type, extid FROM entities, cw_CWSource "
@@ -21,3 +16,8 @@
# force cw_schema deletion before CWSourceSchemaConfig to avoid nasty bug
drop_relation_type('cw_schema')
drop_entity_type('CWSourceSchemaConfig')
+
+# Check the CW versions and add the entity only if needed ?
+add_entity_type('CWSession')
+rql('DELETE CWProperty X WHERE X pkey "system.version.pyramid"',
+ ask_confirm=False)