[migration] don't ask confirm for those sql queries
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 12 Feb 2016 10:09:13 +0100
changeset 11108 c14087d08698
parent 11107 df1f2d853d40
child 11109 c361260fe191
[migration] don't ask confirm for those sql queries
misc/migration/3.21.0_Any.py
--- a/misc/migration/3.21.0_Any.py	Fri Feb 12 10:06:03 2016 +0100
+++ b/misc/migration/3.21.0_Any.py	Fri Feb 12 10:09:13 2016 +0100
@@ -166,9 +166,9 @@
             cstr, helper, prefix='cw_')
     args = {'e': rdef.subject.type, 'c': cstrname, 'v': check}
     if repo.system_source.dbdriver == 'postgres':
-        sql('ALTER TABLE cw_%(e)s DROP CONSTRAINT IF EXISTS %(c)s' % args)
+        sql('ALTER TABLE cw_%(e)s DROP CONSTRAINT IF EXISTS %(c)s' % args, ask_confirm=False)
     elif repo.system_source.dbdriver.startswith('sqlserver'):
         sql("IF OBJECT_ID('%(c)s', 'C') IS NOT NULL "
-            "ALTER TABLE cw_%(e)s DROP CONSTRAINT %(c)s" % args)
-    sql('ALTER TABLE cw_%(e)s ADD CONSTRAINT %(c)s CHECK(%(v)s)' % args)
+            "ALTER TABLE cw_%(e)s DROP CONSTRAINT %(c)s" % args, ask_confirm=False)
+    sql('ALTER TABLE cw_%(e)s ADD CONSTRAINT %(c)s CHECK(%(v)s)' % args, ask_confirm=False)
 commit()