Adding fields to an already existing database for Django (version < 1.7)

后端 未结 3 594
执笔经年
执笔经年 2021-01-04 11:35

I\'m using Django ( < v1.7), with SQLite3 as the database engine.

I am trying to add a new field to an already existing model\'s class. This class already has dat

3条回答
  •  长情又很酷
    2021-01-04 12:16

    Install south in your django and you can easily handle the existing tables. check this

    If you really want to use Django-South, install it on your django, after adding your new fields to your existing model run

    python manage.py schemamigration --initial

    It will create a file in your project app. then,

    python manage.py migrate

    thats it your table is altered.

提交回复
热议问题