-- 000.sql: the bootstrap migration. It creates only the ledger that -- records which migrations have run; every other migration is recorded -- in it. Applied when the schema_migrations table is missing, and never -- again. -- -- Never edit an applied migration. Add a new numbered file instead: the -- ledger records versions, not contents, so an edited file is applied -- nowhere and diverges everywhere. CREATE TABLE IF NOT EXISTS schema_migrations ( version INTEGER PRIMARY KEY, applied_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) ); INSERT OR IGNORE INTO schema_migrations (version) VALUES (0);