Django (pre 1.7 and pre-the new migration functionality), has a management command sqlcustom
to display the custom SQL that would be run for an app. However that prints it to the terminal. Is there any single django management command to actually run all the migrations?
I'm using a Django pre1.7 project which uses South for migrations, and we have some custom SQL (for sql views), and I want to have all the database stuff done via migrations. Custom SQL is loaded by syncdb
on vanilla Django, but when you use South, it overrides syncdb
and doesn't run custom sql. I'd like to create a South migration for an app that is really simple and calls this management command to load the custom SQL. (You can call django management commands from inside python ). I don't want to duplicate the SQL inside the migration.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.