Django South - table already exists

前端 未结 8 612
名媛妹妹
名媛妹妹 2020-12-02 03:55

I am trying to get started with South. I had an existing database and I added South (syncdb, schemamigration --initial).

Then, I updated <

8条回答
  •  北荒
    北荒 (楼主)
    2020-12-02 04:20

    If you have an existing database and app you can use the south conversion command

    ./manage.py convert_to_south myapp
    

    This has to be applied before you do any changes to what is already in the database.

    The convert_to_south command only works entirely on the first machine you run it on. Once you’ve committed the initial migrations it made into your VCS, you’ll have to run ./manage.py migrate myapp 0001 --fake on every machine that has a copy of the codebase (make sure they were up-to-date with models and schema first). ref: http://south.readthedocs.org/en/latest/convertinganapp.html

提交回复
热议问题