Expand description
Schema migration support
Our basic approach:
The 12-step process from s7 in https://sqlite.org/lang_altertable.html “Making Other Kinds Of Table Schema Changes” (retrieved 2025-10-12).
But we do it to the whole db at once, and we store the temporary copy in a whole temporary database which we ATTACH. So we don’t rename the tables.
So the procedure is (roughly):
- Attach temporary database
- Create tables in temporary database by running (new) schema on it
- Copy data from real to temporary database, with data alteration/supplementation as needed (including sqlite_sequence table but not other sqlite_* tables).
- Drop every table in the real database.
- Create tables in real database by running schema on it.
- Copy data from temporary database back to main database.
Structs§
Enums§
Functions§
- migration_
core - prepare_
idempotent - Ensure that the database has a suitable schema