Domanda

Recently, I moved from Linux Mint to Ubuntu, uploaded my project's code to Github, downloaded it again and tried to continue developing. But I have a problem with South:

I tried migrating the apps(many apps) normally:

manage.py schemamigration apps --auto,

But I got:

"You cannot use --auto on an app with no migrations. Try --initial."

Then I tried '--initial',

But when I migrated the apps '$ ./manage.py migrate apps', I got:

"These migrations are in the database but not on the disk:

...(all the migrations I had, not sure how they ended up there)

I'm not trusting myself; either fix this yourself by fiddling with the south_migrationhistory table, or pass --delete-ghost-migrations to South to have it delete ALL of these records (this may not be good)."

I don't care about keeping the migrations so I tried python manage.py --delete-ghost-migrations, but I got "Unknown command".

Then I tried reseting migrations the way this post recommends, so I did:

$ python manage.py reset south

But I got "Unknown command" again.

¿How can I fix this so I can keep working on my project? Sorry if it is something obvious.

*When I was working on Linux Mint I used Mysql, now on Ubuntu I intalled Postgre. This probably doesn't have anything to do with the error cause I think I got it right and configured it correctly with my django project. But maybe you should know it if the solution needs some database manipulation. Thanks in advance.

È stato utile?

Soluzione

Use the following command to clear the database:

./manage.py sqlclear south | ./manage.py dbshell 

then make sure to remove the migrations directory in the app to fully reset south:

rm [app_name]/migrations
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top