[migration] move 'entities' table changes from 3.19.0 to bootstrap script
authorJulien Cristau <julien.cristau@logilab.fr>
Mon, 28 Apr 2014 11:20:26 +0200
changeset 9708 b36bc18f6ef7
parent 9707 4a23058e4d9f
child 9709 d60dc7e03a45
[migration] move 'entities' table changes from 3.19.0 to bootstrap script The 'mtime' and 'source' columns need to go away before we attempt to do anything else with the repo, otherwise any addition of an entity is going to explode.
misc/migration/3.19.0_Any.py
misc/migration/bootstrapmigration_repository.py
--- a/misc/migration/3.19.0_Any.py	Mon Apr 28 12:54:14 2014 +0200
+++ b/misc/migration/3.19.0_Any.py	Mon Apr 28 11:20:26 2014 +0200
@@ -1,4 +1,3 @@
 sql('DROP TABLE "deleted_entities"')
-sql('ALTER TABLE "entities" DROP COLUMN "mtime"')
-sql('ALTER TABLE "entities" DROP COLUMN "source"')
 
+commit()
--- a/misc/migration/bootstrapmigration_repository.py	Mon Apr 28 12:54:14 2014 +0200
+++ b/misc/migration/bootstrapmigration_repository.py	Mon Apr 28 11:20:26 2014 +0200
@@ -50,6 +50,11 @@
     session.commit()
 
 if applcubicwebversion < (3, 19, 0) and cubicwebversion >= (3, 19, 0):
+    sql('ALTER TABLE "entities" DROP COLUMN "mtime"')
+    sql('ALTER TABLE "entities" DROP COLUMN "source"')
+
+    commit()
+
     replace_eid_sequence_with_eid_numrange(session)
 
 if applcubicwebversion < (3, 17, 0) and cubicwebversion >= (3, 17, 0):