Django syncdb and migrate

前端 未结 4 849
春和景丽
春和景丽 2020-12-28 18:41

I\'m moving django website from one server to another, and I tried to syncdb, so i\'ve put python manage.py syncdb, and i get this output:

Synci         


        
相关标签:
4条回答
  • 2020-12-28 19:24

    Another alternative is mark that first migration as done:

    ./manage.py migrate dbtemplates --fake 0001
    

    It seems to be that you already have in your database the schema that you want to create.

    0 讨论(0)
  • 2020-12-28 19:28

    This might help others going through the same issue.

    Since your database is to be created now and there are no migrations needed, after doing what Ahmad mentioned, also do a fake migration so south will mark all migration scripts as already run. In short, run these.

    syncdb --all
    migrate --fake
    

    Please note that if you already have data in your database you shouldn't use syncdb --all.

    0 讨论(0)
  • 2020-12-28 19:29

    Try

    syncdb --all 
    

    as I have the same problem and --all just works.

    I found this solution here https://github.com/divio/django-cms/issues/1343

    0 讨论(0)
  • 2020-12-28 19:30
    $python manage.py syncdb --migrate
    

    this migrates what has to be migrated

    worked for me (django 1.4)

    0 讨论(0)
提交回复
热议问题