Use SQL standard ALTER TABLE command (with ADD instead of ADD COLUMN) stable
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
Sun, 20 Jun 2010 15:09:42 +0000
branchstable
changeset 5801 355d3945c1f3
parent 5800 2bc88fb424bc
child 5802 159b6a712d9d
Use SQL standard ALTER TABLE command (with ADD instead of ADD COLUMN)
hooks/syncschema.py
--- a/hooks/syncschema.py	Sun Jun 20 15:08:23 2010 +0000
+++ b/hooks/syncschema.py	Sun Jun 20 15:09:42 2010 +0000
@@ -83,7 +83,7 @@
     table = SQL_PREFIX + etype
     column = SQL_PREFIX + rtype
     try:
-        session.system_sql(str('ALTER TABLE %s ADD COLUMN %s integer'
+        session.system_sql(str('ALTER TABLE %s ADD %s integer'
                                % (table, column)), rollback_on_failure=False)
         session.info('added column %s to table %s', column, table)
     except:
@@ -376,7 +376,7 @@
         table = SQL_PREFIX + rdef.subject
         column = SQL_PREFIX + rdef.name
         try:
-            session.system_sql(str('ALTER TABLE %s ADD COLUMN %s %s'
+            session.system_sql(str('ALTER TABLE %s ADD %s %s'
                                    % (table, column, attrtype)),
                                rollback_on_failure=False)
             self.info('added column %s to table %s', table, column)