#28813: Sqlite migration of manual primary key
--------------------------------------+------------------------
Reporter: cecedille1 | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.11
Severity: Normal | Keywords: sqlite
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------+------------------------
Sqlite migration generates an invalid INSERT INTO clause when a table has
no more columns. (happens with manual primary keys)
{{{
BEGIN;
--
-- Remove field f1 from poc
--
ALTER TABLE "app_poc" RENAME TO "app_poc__old";
CREATE TABLE "app_poc" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT);
INSERT INTO "app_poc" () SELECT FROM "app_poc__old";
DROP TABLE "app_poc__old";
--
-- Add field f2 to poc
--
ALTER TABLE "app_poc" RENAME TO "app_poc__old";
CREATE TABLE "app_poc" ("f2" integer NOT NULL PRIMARY KEY);
INSERT INTO "app_poc" ("f2") SELECT 1 FROM "app_poc__old";
DROP TABLE "app_poc__old";
COMMIT;
}}}
https://github.com/cecedille1/django-migrate-empty-columns-poc
--
Ticket URL: <https://code.djangoproject.com/ticket/28813>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/053.b903b063554c09bc2dc6f0249f7c9727%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.