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.

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论