开发者

model django new tables

开发者 https://www.devze.com 2023-01-13 05:11 出处:网络
I just created all the DB tables from one model with 6 classes. In one of them I would like to add a NEW field.

I just created all the DB tables from one model with 6 classes.

In one of them I would like to add a NEW field.

I did that and hit: python manage.py syncdb.

But Django won't add that c开发者_JS百科olumn in that table.

Am I missing something?

How can i add columns/tables AFTER I already created the db in Django.

Thanks!


You need to use a migration tool such as South.


Chapter 10 of the Django book has a section called 'Making Changes to a Database Schema' with a sub-section titled 'Adding Fields'...

0

精彩评论

暂无评论...
验证码 换一张
取 消