#28000: Migration forces "DROP DEFAULT" SQL -------------------------------------+------------------------------------- Reporter: Matteo Pietro Russo | Owner: nobody Type: Bug | Status: closed Component: Migrations | Version: 1.9 Severity: Normal | Resolution: invalid Keywords: | Triage Stage: | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by Matteo Pietro Russo): Replying to [comment:9 Simon Charette]: > > This statement doesn't modify data but column's specification, If I run it and then I run django migration, It drops my previous SQL: this is a mistake because I lost my defaults. > > Why cannot I do that? > > Django's ORM don't use defaults defined at the database level and always specify the value when performing inserts instead. > > There have been [https://github.com/django/deps/pull/36 discussions to add support for database generated field values] but nothing have been implemented so far. This behaviour is correct but, I expect django migration doesn't delete my column specification (it DROPS my defaults value). -- Ticket URL: <https://code.djangoproject.com/ticket/28000#comment:10> 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/065.6b8610ebfdf17656a35eb64c49248a1d%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.