Commits

Anonymous committed 3c3f8b9

Adjust the sqlite3 alter_column method to accept ignore_constraints

Before this patch, migrations written to call alter_column() and
pass ignore_constraints=True (or =False) would work on
database backends like MySQL, but fail on sqlite3 with a TyepError:

TypeError: alter_column() got an unexpected keyword argument 'ignore_constraints'

This patch fixes that.

Comments (0)

Files changed (1)

south/db/sqlite3.py

         #    sql += " UNIQUE"
         return sql
     
-    def alter_column(self, table_name, name, field, explicit_name=True):
+    def alter_column(self, table_name, name, field, explicit_name=True, ignore_constraints=False):
         """
-        Changes a column's SQL definition
+        Changes a column's SQL definition.
+
+        Note that this sqlite3 implementation ignores the ignore_constraints argument.
+        The argument is accepted for API compatibility with the generic
+        DatabaseOperations.alter_column() method.
         """
         # Remake the table correctly
         self._remake_table(table_name, altered={
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.