PostOwl / postowl

Create a personal website for your blog, journal and sending letters to friends.
https://www.postowl.com
GNU Affero General Public License v3.0
99 stars 6 forks source link

Implement database migrations #5

Open keybits opened 1 year ago

keybits commented 1 year ago

Currently fly-start.sh and schema.sql naively create tables in the DB if they don't already exist.

This allows for creating a new db on first launch and preserving content when redeploying.

But we don't have a way to do migration if we alter the db structure.

Current preferred approach is what's documented here https://david.rothlis.net/declarative-schema-migration-for-sqlite/ and in this HN discussion: https://news.ycombinator.com/item?id=31249823)

keybits commented 10 months ago

Another option is to use Simon Willison's SQLite utils: https://sqlite-utils.datasette.io/en/stable/cli.html#transforming-tables

He's also planning a more robust migration tool: https://twitter.com/simonw/status/1752079842538123488