Django migration strategy for renaming a model and relationship fields

后端 未结 12 1607
一个人的身影
一个人的身影 2020-11-28 00:54

I\'m planning to rename several models in an existing Django project where there are many other models that have foreign key relationships to the models I would like to rena

12条回答
  •  情话喂你
    2020-11-28 01:45

    I would make @ceasaro words, mine on his comment on this answer.

    Newer versions of Django can detect changes and ask about what was done. I also would add that Django might mix the order of execution of some migration commands.

    It would be wise to apply small changes and run makemigrations and migrate and if the error occurs the migration file can be edited.

    Some lines order of execution can be changed to avoid erros.

提交回复
热议问题