diff --git a/backend/src/db.js b/backend/src/db.js index fc5e7b5..2463031 100644 --- a/backend/src/db.js +++ b/backend/src/db.js @@ -60,6 +60,13 @@ export async function initDb() { updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() ); `) + + // wind_dir_deg was added to forecast_points after the first deploy already ran — + // CREATE TABLE IF NOT EXISTS above is a no-op against an existing table, it does + // NOT retroactively add new columns, so this needs its own explicit migration. + // forecast_astro/config didn't need this since they're whole new tables, which + // CREATE TABLE IF NOT EXISTS does handle correctly on an existing database. + await pool.query(`ALTER TABLE forecast_points ADD COLUMN IF NOT EXISTS wind_dir_deg NUMERIC`) } export async function getStatus() {