SQLite Migrations
Use This Skill When
- •Adding or changing tables/columns/indexes.
- •Writing catalog queries for import, grid, edit persistence, or cache lookup.
- •Improving query performance for large catalogs.
Required Inputs
- •Current schema and desired schema/query change.
- •Data compatibility requirement (fresh DB only or existing user DBs).
Workflow
- •Propose migration with rollback strategy.
- •Add idempotent migration scripts in order.
- •Add/adjust query-layer tests.
- •Run migration on empty and populated sample DB.
- •Review query plan for hot paths.
Guardrails
- •Never break existing catalog data without explicit migration handling.
- •Add indexes for frequent filters/sorts (
capture_date, import recency). - •Use transactions for batch writes.
Output Contract
- •Migration file(s) and query updates.
- •Compatibility notes and test results.