3 ms·
Django is my favorite backend because its database migration tool is easy to use and can be customized to fit my needs. That being said, if you want database-fi
by neurostimulant 7y ago
Django is my favorite backend because its database migration tool is easy to use and can be customized to fit my needs. That being said, if you want database-first schema migration, the only way to do that (that I aware of) is by attempting to generate models for your existing schema using Django's inspectdb command, then run a fake migration.
I like how Wordpress does simple database-first migration: just call `dbDelta()` function with your new table schema in sql format (CREATE TABLE ...) and it'll figure out a way to update your table to fit your new schema. I wonder if there is any similar db migration tool in python that work like this, seem perfect for small projects that don't want to use an ORM.
https://codex.wordpress.org/Creating_Tables_with_Plugins#Creating_or_Updating_the_Table https://codex.wordpress.org/Creating_Tables_with_Plugins#Cre...