Commits

andrew  committed dccea9a

[svn r118] Refactor out delete column string

  • Participants
  • Parent commits c83a613
  • Branches trunk

Comments (0)

Files changed (2)

File db/generic.py

 
     drop_index = alias('delete_index')
 
+    delete_column_string = 'ALTER TABLE %s DROP COLUMN %s CASCADE;'
 
     def delete_column(self, table_name, name):
         """
         """
         qn = connection.ops.quote_name
         params = (qn(table_name), qn(name))
-        self.execute('ALTER TABLE %s DROP COLUMN %s CASCADE;' % params, [])
+        self.execute(self.delete_column_string % params, [])
 
     drop_column = alias('delete_column')
 

File db/sql_server/pyodbc.py

     add_column_string = 'ALTER TABLE %s ADD %s;'
     alter_string_set_type = 'ALTER COLUMN %(column)s %(type)s'
     allows_combined_alters = False
+    delete_column_string = 'ALTER TABLE %s DROP COLUMN %s;'
 
     def create_table(self, table_name, fields):
         # Tweak stuff as needed