#25128: SQLite SchemaEditor crashes when adding a ForeignObject field
--------------------------------------+---------------------------
Reporter: timgraham | Owner: timgraham
Type: Bug | Status: new
Component: Migrations | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------+---------------------------
Adding a `ForeignObject` field to an existing model will fail like this on
SQLite:
{{{
======================================================================
ERROR: test_add_foreign_object (schema.tests.SchemaTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/tim/code/django/tests/schema/tests.py", line 1518, in
test_add_foreign_object
editor.add_field(BookForeignObj, new_field)
File "/home/tim/code/django/django/db/backends/sqlite3/schema.py", line
221, in add_field
self._remake_table(model, create_fields=[field])
File "/home/tim/code/django/django/db/backends/sqlite3/schema.py", line
187, in _remake_table
', '.join(self.quote_name(x) for x, y in field_maps),
File "/home/tim/code/django/django/db/backends/sqlite3/schema.py", line
187, in <genexpr>
', '.join(self.quote_name(x) for x, y in field_maps),
File "/home/tim/code/django/django/db/backends/base/schema.py", line
113, in quote_name
return self.connection.ops.quote_name(name)
File "/home/tim/code/django/django/db/backends/sqlite3/operations.py",
line 107, in quote_name
if name.startswith('"') and name.endswith('"'):
AttributeError: 'NoneType' object has no attribute 'startswith'
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25128>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.