SQLite's executescript() auto-commits each DDL statement, so a partial migration failure leaves columns in the DB without marking the migration done. On the next startup the runner retries and hits duplicate column errors. Use ADD COLUMN IF NOT EXISTS (SQLite 3.35+, shipped in Python 3.11+) so migrations 004 and 005 are safe to re-run in any partial state. |
||
|---|---|---|
| .. | ||
| 001_init.sql | ||
| 002_add_listing_format.sql | ||
| 003_nullable_account_age.sql | ||
| 004_staging_tracking.sql | ||
| 005_listing_category.sql | ||
| 006_scammer_blocklist.sql | ||
| 007_background_tasks.sql | ||