#23609: Migration fails when removing a NULL constraint -------------------------------------+------------------------------------- Reporter: Markush2010 | Owner: Type: Uncategorized | Markush2010 Component: Database layer | Status: assigned (models, ORM) | Version: 1.7 Severity: Normal | Resolution: Keywords: | Triage Stage: Has patch: 1 | Unreviewed Needs tests: 0 | Needs documentation: 0 Easy pickings: 0 | Patch needs improvement: 1 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by Markush2010): Since there is no special handling for any database except SQLite in the `_alter_field()` schema alteration I didn't want to introduce one for PostgreSQL. Thus I ended up with the 4-way-default-alteration 1) Add a default for new incoming writes, 2) Update existing NULL rows with new default, 3) Replace NULL constraint with NOT NULL, 4) Drop the default again. I also updated the pull requested with the recent changes. -- Ticket URL: <https://code.djangoproject.com/ticket/23609#comment:5> 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/069.4a624edd1829800a9052701734d1a35c%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.