|
|
|
|
|
by dextro42
810 days ago
|
|
Wouldn't it be more interesting to have this as an external tool? You input your create table statement and it issues you back the migration statements? Then you can check it against your development database or whatever and if you feel fine use it? This way you could check and modify the migration path without writing the alter statements. This is one of the most frustrating thinks with sqlite for me. Changing a table doesn't always work with an alter statement but sometimes you need to drop and recreate it with the new columns. Why can't they do the magic for me. It's really frustrating and was often enough the sole reason I used postgres for private projects. |
|
For sqlite in particular, check out https://david.rothlis.net/declarative-schema-migration-for-s... and https://sqlite-utils.datasette.io/en/stable/python-api.html#...