migration - Django 1.8 Syncdb vs migrate -
i have created model , executed syncdb had created tables model designed.
afterwards modified model , executed makemigrations
created migrations ignoring tables syncdb had created.
so ended error "relation exists".
why did makemigrations created scratch? how fix situation ?
makemigrations
creates new migrations based on changes detected models.
also, 1 thing note syncdb
command deprecated since django 1.7 , removed in django 1.9. so, should use migrate
command.
from syncdb
docs:
deprecated since version 1.7:
command has been deprecated in favor ofmigrate
command, performs both old behavior executing migrations.
Comments
Post a Comment