So when we started the database, it was good enough to have a char field with choices. But as time progressed I need to convert that field to a foreign key field. The follow I'm trying to take is such:
- rename <fieldname> to tmp_<fieldname>
- create a new field with <fieldname>
- have a RunPython fill the data for <fieldname>
- delete field tmp_<fieldname>
I can get steps 1 through 3 to work with out issue. But once I remove the old field from the code, the migration breaks because the field no longer exists (which makes sense). I'm curious if there is a way to work around this, because my googling is coming up empty.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fc9f9a03-9be2-4fa7-bec7-94d1d24f77d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment