use new logilab.database interface for multicol indexes stable
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
Wed, 22 Sep 2010 10:00:36 +0200
branchstable
changeset 6294 a1535abe6ab2
parent 6291 f6cba3be6ba2
child 6295 6e1c2aca9fa0
use new logilab.database interface for multicol indexes
hooks/syncschema.py
--- a/hooks/syncschema.py	Mon Sep 20 15:58:45 2010 +0200
+++ b/hooks/syncschema.py	Wed Sep 22 10:00:36 2010 +0200
@@ -707,8 +707,9 @@
         cols = ['%s%s' % (prefix, r.rtype.name)
                 for r in self.entity.relations]
         dbhelper= session.pool.source('system').dbhelper
-        sql = dbhelper.sql_create_multicol_unique_index(table, cols)
-        session.system_sql(sql)
+        sqls = dbhelper.sqls_create_multicol_unique_index(table, cols)
+        for sql in sqls:
+            session.system_sql(sql)
 
     # XXX revertprecommit_event
 
@@ -726,8 +727,9 @@
         table = '%s%s' % (prefix, self.entity.type)
         dbhelper= session.pool.source('system').dbhelper
         cols = ['%s%s' % (prefix, c) for c in self.cols]
-        sql = dbhelper.sql_drop_multicol_unique_index(table, cols)
-        session.system_sql(sql)
+        sqls = dbhelper.sqls_drop_multicol_unique_index(table, cols)
+        for sql in sqls:
+            session.system_sql(sql)
 
     # XXX revertprecommit_event