Django+south: migrate command doesn’t create table in the database

data-migrationdatabasedjangodjango-southmigration

I have a strnage problem.
My django project has myapp module/application. My project uses south to do the schema migrations.
On localhost i have run ./manage.py schemamigration myapp --initial, then i have run migrate command.

But when in production environment i execute migrate command, this doesn't create the correponding table (of myapp models) in database.

It's strange because if i execute migrate --list, myapp has to migration and they are all marked (with * symbol ).

So, i'm thinking about deleting myapp and recreating it from scratch (with corresponding migrations). Is there better solution?

EDIT:
i have tried to delete myapp and to recreate it from scratch. So i have also delete tables of myapp in database (on localhost and on production server), and after all i have executed:

schemamigration myapp --initial command on localhost

migrate myapp command on localhost

migrate myapp 0001 --fake on production server

but South continues to not create the tables of myapp in database of production server.

Best Answer

If you accidentally or intentionally dropped a table in your DB and your are trying to run ./manage migrate myappThis will not create the dropped table in your DB. Because South does not touch base with your DB.

In case you want to re-create your table. Migrate your schema to a previous version and migrate it latest. Please use the below code accordingly

manage.py migrate myapp 0002 --fake
manage.py migrate myapp

note: 002 is your previous migration version.

Related Topic