Line 0
Link Here
|
|
|
1 |
--- django/db/backends/sqlite3/schema.py.orig 2019-09-02 09:44:58.000000000 +0300 |
2 |
+++ django/db/backends/sqlite3/schema.py 2019-09-25 19:18:23.162005000 +0300 |
3 |
@@ -24,12 +24,14 @@ |
4 |
c.execute('PRAGMA foreign_keys') |
5 |
self._initial_pragma_fk = c.fetchone()[0] |
6 |
c.execute('PRAGMA foreign_keys = 0') |
7 |
+ c.execute('PRAGMA legacy_alter_table = ON') |
8 |
return super(DatabaseSchemaEditor, self).__enter__() |
9 |
|
10 |
def __exit__(self, exc_type, exc_value, traceback): |
11 |
super(DatabaseSchemaEditor, self).__exit__(exc_type, exc_value, traceback) |
12 |
with self.connection.cursor() as c: |
13 |
# Restore initial FK setting - PRAGMA values can't be parametrized |
14 |
+ c.execute('PRAGMA legacy_alter_table = OFF') |
15 |
c.execute('PRAGMA foreign_keys = %s' % int(self._initial_pragma_fk)) |
16 |
|
17 |
def quote_value(self, value): |