fix: remove duplicate first_seen_at ALTER TABLE in migration 004

001_init.sql already defines first_seen_at in the CREATE TABLE statement.
On fresh installs, migration 004 failed with 'duplicate column name: first_seen_at'.
Remove the redundant ALTER TABLE; last_seen_at/times_seen/price_at_first_seen
are still added by 004 as before.
This commit is contained in:
pyr0ball 2026-04-05 22:12:47 -07:00
parent 234c76e686
commit 81e41e39ab

View file

@ -1,7 +1,7 @@
-- Staging DB: persistent listing tracking across searches. -- Staging DB: persistent listing tracking across searches.
-- Adds temporal metadata to listings so we can detect stale/repriced/recurring items. -- Adds temporal metadata to listings so we can detect stale/repriced/recurring items.
ALTER TABLE listings ADD COLUMN first_seen_at TEXT; -- first_seen_at already defined in 001_init.sql CREATE TABLE; skip to avoid duplicate column error on fresh installs
ALTER TABLE listings ADD COLUMN last_seen_at TEXT; ALTER TABLE listings ADD COLUMN last_seen_at TEXT;
ALTER TABLE listings ADD COLUMN times_seen INTEGER NOT NULL DEFAULT 1; ALTER TABLE listings ADD COLUMN times_seen INTEGER NOT NULL DEFAULT 1;
ALTER TABLE listings ADD COLUMN price_at_first_seen REAL; ALTER TABLE listings ADD COLUMN price_at_first_seen REAL;