#30033 closed Cleanup/optimization (fixed)
SQLite schema editor should use the documented process to emulate table alterations on SQlite3.
| Reported by: | Simon Charette | Owned by: | Simon Charette |
|---|---|---|---|
| Component: | Migrations | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
In the light of #29182 SQLite's main author mentioned that we should conform to the documented procedure to emulate table alterations on SQlite3.
Right now the SQLite's schema editor follows a procedure documented as incorrect and prevents usages of the SQLite 3.26 improvements regarding table and column renames while foreign key constraints are disabled.
Change History (12)
comment:1 by , 7 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 7 years ago
| Description: | modified (diff) |
|---|---|
| Has patch: | set |
comment:3 by , 7 years ago
| Summary: | SQLite schema editor should use the documented to emulate table alterations on SQlite3. → SQLite schema editor should use the documented process to emulate table alterations on SQlite3. |
|---|---|
| Triage Stage: | Accepted → Ready for checkin |
comment:4 by , 7 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
comment:8 by , 7 years ago
| Has patch: | unset |
|---|---|
| Resolution: | fixed |
| Severity: | Normal → Release blocker |
| Status: | closed → new |
| Triage Stage: | Ready for checkin → Accepted |
On Ubuntu 16.04 which has SQLite 3.11, some problems appeared after 7289874adceec46b5367ec3157cdd10c711253a0:
======================================================================
ERROR: test_m2m_rename_field_in_target_model (schema.tests.SchemaTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/media/sf_django/django/db/backends/utils.py", line 82, in _execute
return self.cursor.execute(sql)
File "/media/sf_django/django/db/backends/sqlite3/base.py", line 360, in execute
return Database.Cursor.execute(self, query)
sqlite3.OperationalError: no such table: schema_tagm2mtest
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/media/sf_django/tests/schema/tests.py", line 70, in tearDown
self.delete_tables()
File "/media/sf_django/tests/schema/tests.py", line 97, in delete_tables
connection.enable_constraint_checking()
File "/media/sf_django/django/db/backends/sqlite3/schema.py", line 34, in __exit__
self.connection.check_constraints()
File "/media/sf_django/django/db/backends/sqlite3/base.py", line 320, in check_constraints
column_name, referenced_column_name,
File "/media/sf_django/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/media/sf_django/django/db/backends/utils.py", line 76, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/media/sf_django/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/media/sf_django/django/db/utils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/media/sf_django/django/db/backends/utils.py", line 82, in _execute
return self.cursor.execute(sql)
File "/media/sf_django/django/db/backends/sqlite3/base.py", line 360, in execute
return Database.Cursor.execute(self, query)
django.db.utils.OperationalError: no such table: schema_tagm2mtest
comment:10 by , 7 years ago
| Resolution: | → fixed |
|---|---|
| Severity: | Release blocker → Normal |
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
In 7289874a: