diff options
Diffstat (limited to 'django/db/backends/sqlite3/schema.py')
| -rw-r--r-- | django/db/backends/sqlite3/schema.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/db/backends/sqlite3/schema.py b/django/db/backends/sqlite3/schema.py index b27d39d732..e0d8135cbd 100644 --- a/django/db/backends/sqlite3/schema.py +++ b/django/db/backends/sqlite3/schema.py @@ -21,10 +21,12 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): # Some SQLite schema alterations need foreign key constraints to be # disabled. Enforce it here for the duration of the transaction. self.connection.disable_constraint_checking() + self.connection.cursor().execute('PRAGMA legacy_alter_table = ON') return super().__enter__() def __exit__(self, exc_type, exc_value, traceback): super().__exit__(exc_type, exc_value, traceback) + self.connection.cursor().execute('PRAGMA legacy_alter_table = OFF') self.connection.enable_constraint_checking() def quote_value(self, value): |
