#29182: SQLite database migration breaks ForeignKey constraint, leaving
<table_name>__old in db schema
----------------------------------+------------------------------------
Reporter: ezaquarii | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 2.0
Severity: Release blocker | Resolution:
Keywords: sqlite migration | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+------------------------------------
Comment (by Simon Charette):
I did a bit of investigation on my side and there must be something else
at play here as I cannot reproduce against `stable/2.1.x` and `master`
with SQLite version 3.22.0 2018-01-22 18:45:57 and `sqlite3.version` 2.6.0
on Python 3.6.6.
{{{
$ sqlite3 project/db.sqlite3
SQLite version 3.22.0 2018-01-22 18:45:57
Enter ".help" for usage hints.
sqlite> .schema
CREATE TABLE IF NOT EXISTS "django_migrations" ("id" integer NOT NULL
PRIMARY KEY AUTOINCREMENT, "app" varchar(255) NOT NULL, "name"
varchar(255) NOT NULL, "applied" datetime NOT NULL);
CREATE TABLE sqlite_sequence(name,seq);
CREATE TABLE IF NOT EXISTS "ticket_29182_filecontent" ("id" integer NOT
NULL PRIMARY KEY AUTOINCREMENT);
CREATE TABLE IF NOT EXISTS "ticket_29182_playbook" ("id" integer NOT NULL
PRIMARY KEY AUTOINCREMENT, "file_id" integer NOT NULL REFERENCES
"ticket_29182_file" ("id") DEFERRABLE INITIALLY DEFERRED);
CREATE TABLE IF NOT EXISTS "ticket_29182_file" ("id" integer NOT NULL
PRIMARY KEY AUTOINCREMENT, "content_id" integer NOT NULL REFERENCES
"ticket_29182_filecontent" ("id") DEFERRABLE INITIALLY DEFERRED);
CREATE INDEX "ticket_29182_playbook_file_id_f3bc0e50" ON
"ticket_29182_playbook" ("file_id");
CREATE INDEX "ticket_29182_file_content_id_7815674c" ON
"ticket_29182_file" ("content_id");
}}}
I also couldn't get a regression test to fail either. Florian could you
confirm one of these added tests fail for you on your local setup:
https://github.com/django/django/compare/master...charettes:ticket-29182
--
Ticket URL: <https://code.djangoproject.com/ticket/29182#comment:15>
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/067.6c4fa52eb8f89773bbac011283ad378e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.