#32787: ContentTypes are created instead of renamed when using
SeparateDatabaseAndState
-------------------------------------+-------------------------------------
     Reporter:  David Seddon         |                    Owner:  nobody
         Type:  New feature          |                   Status:  closed
    Component:  Database layer       |                  Version:  3.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  wontfix
     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 David Seddon):

 Thanks for the reply!

 > If you want to use it to rename models you need to also update content
 types in the database_operations.

 That's what we recommend to do now at my workplace, but it was hard-won
 knowledge involving some forensic work to get to the bottom of what was
 going on.

 I would argue is that as it stands, the content types hooks are a bit of a
 footgun even for experienced developers who need to use
 `SeparateDatabaseAndState`. My expectation would have been that using
 `SeparateDatabaseAndState` suppressed all database actions, but in fact it
 does perform a database action, just the wrong one.

 I wonder if an alternative mitigation would be to output to the console
 what contenttypes is doing in the `pre_migrate`/`post_migrate` steps, just
 so developers are aware this is happening.

 Anyway I do appreciate this is probably a pretty niche issue. Let me know
 if you change your mind, I'd be happy to put together a pull request.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32787#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/066.d10f1831085d5f36761fab288bd3cc75%40djangoproject.com.

Reply via email to