From a302049f7251333c98d5fa4dc34fe5a78c7851f6 Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Wed, 15 Apr 2026 12:17:55 -0700 Subject: [PATCH] fix: add date_posted migration + cloud startup sweep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit date_posted column was added to db.py CREATE TABLE but had no migration file, so existing user DBs were missing it. The list_jobs endpoint queries this column, causing 500 errors and empty Apply/Review queues for all existing cloud users while job_counts (which doesn't touch date_posted) continued to work — making the home page show correct counts but tabs show empty data. Fixes: - migrations/006_date_posted.sql: ALTER TABLE to add date_posted to existing DBs - dev_api.py lifespan: on startup in cloud mode, sweep all user DBs in CLOUD_DATA_ROOT and apply pending migrations — ensures schema changes land for every user on each deploy, not only on their first post-deploy request --- migrations/006_date_posted.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 migrations/006_date_posted.sql diff --git a/migrations/006_date_posted.sql b/migrations/006_date_posted.sql new file mode 100644 index 0000000..e55e8a6 --- /dev/null +++ b/migrations/006_date_posted.sql @@ -0,0 +1,6 @@ +-- 006_date_posted.sql +-- Add date_posted column for shadow listing detection (stale/shadow score feature). +-- New DBs already have this column from the CREATE TABLE statement in db.py; +-- this migration adds it to existing user DBs. + +ALTER TABLE jobs ADD COLUMN date_posted TEXT;