Sqlmigrate generated SQL

21 views
Skip to first unread message

andrea crotti

unread,
Oct 4, 2016, 5:41:25 AM10/4/16
to Django users
Related to this other thread:


I'm working on trying to find a workaround for migrations killing our local/CI servers, until there is a better fix in Django stable..

So started this project to do some analysis:


One interesting thing is that it looks like using sqlmigrate (taking some code from it) to generate the raw SQL and composing ti basically generates exactly the same final schema for the database.


In general the question is, assuming all the settings are the same, can they differ under some conditions?
I guess for example that using RunPython would cause issues in this case right?

andrea crotti

unread,
Oct 4, 2016, 6:32:01 AM10/4/16
to Django users
Answering to myself obviously sqlmigrate can't really do anything with code in RunPython.
So I suspect the biggest problem would be something like this:

- early data migration that uses an initial schema a certain model
- a later schema migration that changes that

so trying to generate the SQL after would not apply because the schema changed in the meanwhile..
Reply all
Reply to author
Forward
0 new messages