我在ubuntu服务器上运行了一个完全正常的生产中Django代码。由于某些原因,我必须将所有代码移至新服务器。我已经使用所有新的ec2实例进行管理,并且git将我的存储库克隆到了该服务器。现在如何处理未应用的更改/迁移(即使我没有对旧代码进行任何更改,它也显示了很少的更改)?我是否必须删除所有迁移并全部重新创建?或者只是使用旧代码运行python makemigrations。运行此命令将显示诸如以下内容:
Did you rename schoolpoint.near_distance_points to schoolpoint.first_born_child_points (a IntegerField)? [y/N] y
Did you rename schoolmodel.is_hostel to schoolmodel.collab (a BooleanField)? [y/N]
Did you rename schoolmodel.monthly_fee to schoolmodel.featured_view_count (a IntegerField)? [y/N] y
You are trying to add a non-nullable field 'receipt_id' to formreceiptmodel without a default; we can't do that (the database needs something to populate existing rows).
Please select a fix:
1) Provide a one-off default now (will be set on all existing rows with a null value for this column)
2) Quit, and let me add a default in models.py
其中许多正在发生。我是否应该从代码中手动找到它们,无论是否更改了?