Django修改Model,在不删除数据库的前提下

Migrations are very powerful and let you change your models over time, as you develop your project, without the need to delete your database or tables and make new ones – it specializes in upgrading your database live, without losing data. We’ll cover them in more depth in a later part of the tutorial, but for now, remember the three-step guide to making model changes:
1)Change your models (in models.py).
2)Run python manage.py makemigrations to create migrations for those changes
3)Run python manage.py migrate to apply those changes to the database.

    原文作者:Profeel
    原文地址: https://segmentfault.com/a/1190000002404929
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞