I'm sorry if the name of the question is misleading but here is the deal.
I have dump of the database that was used with old version of django app (django < 1.7).
I have a new version of code which is using django 1.7. And now I need to upgrade some server with new code while saving all data.
How I thought it would work:
Restore database, run new migration (1.7 migrations) with ./manage.py migrate.
Done!
But when I'm running migrations I have "Relation already exists error".
I know that this is happening probably because database is out of sync with migration history or something... But I don't know what to do.
EDIT1 I sense that the only way is manually create migration script or something, because there is now way to sync database with new migrations now.
So suppose a have a table in database named TABLE and two columns C1 and C2.
Now when I was migrating from 1.6 to 1.7 I've added column C3. So the initial migration looks something like this "create table TABLE with COLUMNS C1, C2, C3".
And when I will try to migrate with old database it wouldn't be ably to do this.