#29868: Database Check Constraints Not Retained (Only Last Is Stored) -------------------------------------+------------------------------------- Reporter: Scott | Owner: nobody Stevens | Type: Bug | Status: new Component: Database | Version: master layer (models, ORM) | Severity: Release | Keywords: check constraint blocker | Triage Stage: | Has patch: 0 Unreviewed | Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | -------------------------------------+------------------------------------- This refers to feature #11964, where I initially asked about this.
It appears that adding multiple database constraints to a table results in only the last being stored. Reviewing the SQL (`./manage.py sqlmigrate`), I'm seeing each constraint being added by way of `ALTER TABLE` (rename), `CREATE TABLE`, `INSERT INTO ... SELECT`, `DROP TABLE`, however only the most recent constraint is added each time, so the previous constraint is dropped with the old table when adding the new one. Using 38f3de86bd0bfa4c9b57db1237fa55e9fa88bc6e, Python 3.6.6 (Win10x64) with SQLite database. -- Ticket URL: <https://code.djangoproject.com/ticket/29868> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/052.6f299bccba6d095edcd32dd9a3c8ee0a%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.