#33673: PostgreSQL removes constraints when removing columns. ----------------------------+-------------------------------------- Reporter: George | Owner: nobody Type: Bug | Status: closed Component: Migrations | Version: 3.2 Severity: Normal | Resolution: needsinfo Keywords: | Triage Stage: Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 ----------------------------+-------------------------------------- Changes (by Mariusz Felisiak):
* status: new => closed * resolution: => needsinfo Comment: Thanks for the report, however PostgreSQL silently drops constraints, not Django itself. Unfortunately when you create migrations manually you must be aware of database-specific behavior and handle them on your own in most of cases. As far as I'm aware described use case (removing column to add it immediately in the same migration) is really unusual and not worth additional complexity and a performance regression for all users. Noticing that constraint is missing would require inspecting db constraints which is always quite expensive. Is there any reason you cannot handle this automatically with `AlterField()`? -- Ticket URL: <https://code.djangoproject.com/ticket/33673#comment:2> 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 view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/0107018083c7e8b8-0850ad74-5acc-4c20-8b21-9880c219c93c-000000%40eu-central-1.amazonses.com.