#29182: SQLite database migration breaks ForeignKey constraint, leaving
<table_name>__old in db schema
----------------------------------+------------------------------------
Reporter: ezaquarii | Owner: nobody
Type: Uncategorized | Status: new
Component: Migrations | Version: 2.0
Severity: Normal | 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
----------------------------------+------------------------------------
Changes (by Simon Charette):
* cc: Simon Charette (added)
* stage: Unreviewed => Accepted
Comment:
Hey ezaquarii, thank you for your great report.
You can get a bit of context about why all the SQLite constraint
workarounds are required in #28849 but in this case I suspect odd things
happen because, as you might know, savepoints are used in nested
`atomic()` blocks.
The migration executor was not designed to be used within a transaction as
it does some pretty intense transaction management itself so I'm accepting
on the basis that we should do a better job at raising an error in this
case. The fact that this doesn't happen when `./manage.py migrate` is
called directly is a good indicator that other weird things might be
happening under the hood because this case is completely untested by the
suite right now. For example, do the backend that we know transactional
DDL support for all behave the same way with regards to savepoints?
I guess you were trying to come up with some kind of deploying script that
either fails or succeeds to apply multiple migrations?
--
Ticket URL: <https://code.djangoproject.com/ticket/29182#comment:6>
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.9ad793cd54be316951e7a2cfc6292102%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.