Opened 10 years ago
Last modified 6 years ago
#24424 closed Bug
Migrating an 'empty' model with SQLite gives an SQL syntax error — at Initial Version
Reported by: | Adam Hayward | Owned by: | nobody |
---|---|---|---|
Component: | Migrations | Version: | 2.1 |
Severity: | Normal | Keywords: | |
Cc: | Markus Holtermann, direx, Simon Charette | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
On migrating an empty, abstract model, the method
django.db.backends.sqlite3.schema.DatabaseSchemaEditor._remake_table()
tries to execute the following SQL query:
INSERT INTO "companies_department__new" () SELECT FROM "companies_department";
The correct SQL would be:
INSERT INTO "companies_department__new" SELECT * FROM "companies_department";
This appears to be the same problem specified in this ticket from South: http://south.aeracode.org/ticket/570 (see comment #15 at the bottom).
Will provide the patch to fix this shortly. Any indication of how to create a test case would be appreciated.