| ▲ | simonw 5 hours ago | |
My sqlite-utils CLI tool and Python library offers solutions to both the alter table limitations and the need for schema migrations. For alter table it offers a "transform" command which implements the pattern of creating a new table with your desired scheme, copying data to it from the old table, then renaming the tables (all in a transaction): https://sqlite-utils.datasette.io/en/stable/cli.html#transfo...
And for migrations there's a new-in-v4 "migrate" command which lets you create and execute an ordered sequence of migrations: https://sqlite-utils.datasette.io/en/stable/cli.html#running...
Migrations files look like this: https://sqlite-utils.datasette.io/en/stable/migrations.html#... | ||
| ▲ | runlaszlorun 4 hours ago | parent [-] | |
I'd def recommend simonw's CLI and Python lib for anyone doing SQLite stuff, there's all kinds of stuff there. | ||