[migration] drop identity_relation if it exists
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 20 Jun 2016 15:10:24 +0200
changeset 11365 eedf0684533c
parent 11364 a702d31ddd8f
child 11366 80dec361a5d0
[migration] drop identity_relation if it exists It has been generated erroneously for a while, then fixed but not properly deleted from old databases. Don't use IF EXISTS for sqlserver compat.
cubicweb/misc/migration/3.23.0_Any.py
--- a/cubicweb/misc/migration/3.23.0_Any.py	Wed Jun 22 14:35:43 2016 +0200
+++ b/cubicweb/misc/migration/3.23.0_Any.py	Mon Jun 20 15:10:24 2016 +0200
@@ -60,3 +60,6 @@
     sql('ALTER TABLE cw_%(e)s ADD CONSTRAINT %(c)s CHECK(%(v)s)' % args)
 
 commit()
+
+if 'identity_relation' in helper.list_tables(cnx.cnxset.cu):
+    sql('DROP TABLE identity_relation')