#28715: Prevent a migration changing DateTimeField(auto_now_add=True) to
default=timezone.now from generating SQL
--------------------------------------+------------------------------------
     Reporter:  Дилян Палаузов        |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Migrations            |                  Version:  master
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  1                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  1
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by Tim Graham):

 * needs_better_patch:  0 => 1


Comment:

 Sorry, I should have looked at the initial patch before I suggested
 bringing it up to date. I don't think the approach is correct. I think
 that a migration should be generated if `auto_now_add=True` changes to
 `default=timezone.now` as they aren't entirely equivalent. The fix will
 have to be at the `SchemaEditor` level. Given that `auto_now_add` and
 `auto_now` might be deprecated (#22995), it might be a better use of time
 to focus on that issue (although the patch forward isn't entirely clear).

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28715#comment:7>
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/072.468ee251864d9541390a26954306d009%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to