简体   繁体   English

django模型新表

[英]model django new tables

I just created all the DB tables from one model with 6 classes. 我刚刚从一个具有6个类的模型创建了所有DB表。

In one of them I would like to add a NEW field. 在其中一个中,我想添加一个新字段。

I did that and hit: python manage.py syncdb . 我这样做并点击: python manage.py syncdb

But Django won't add that column in that table. 但是Django不会在该表中添加该列。

Am I missing something? 我想念什么吗?

How can i add columns/tables AFTER I already created the db in Django. 在Django中创建数据库之后,如何添加列/表。

Thanks! 谢谢!

您需要使用迁移工具,例如South。

Django书的第10章有一个名为``对数据库模式进行更改''的小节,标题为``添加字段''的小节...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM