From 4fac7ef621e72c7f41e98c0c152eec8d2ce227ef Mon Sep 17 00:00:00 2001 From: Dotta Date: Fri, 1 May 2026 20:59:31 -0500 Subject: [PATCH] Make issue monitor migration idempotent Co-Authored-By: Paperclip --- .../migrations/0075_cultured_sebastian_shaw.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/db/src/migrations/0075_cultured_sebastian_shaw.sql b/packages/db/src/migrations/0075_cultured_sebastian_shaw.sql index 71af9e73ff7..4633db39e8c 100644 --- a/packages/db/src/migrations/0075_cultured_sebastian_shaw.sql +++ b/packages/db/src/migrations/0075_cultured_sebastian_shaw.sql @@ -1,7 +1,7 @@ -ALTER TABLE "issues" ADD COLUMN "monitor_next_check_at" timestamp with time zone;--> statement-breakpoint -ALTER TABLE "issues" ADD COLUMN "monitor_wake_requested_at" timestamp with time zone;--> statement-breakpoint -ALTER TABLE "issues" ADD COLUMN "monitor_last_triggered_at" timestamp with time zone;--> statement-breakpoint -ALTER TABLE "issues" ADD COLUMN "monitor_attempt_count" integer DEFAULT 0 NOT NULL;--> statement-breakpoint -ALTER TABLE "issues" ADD COLUMN "monitor_notes" text;--> statement-breakpoint -ALTER TABLE "issues" ADD COLUMN "monitor_scheduled_by" text;--> statement-breakpoint -CREATE INDEX "issues_company_monitor_due_idx" ON "issues" USING btree ("company_id","monitor_next_check_at"); \ No newline at end of file +ALTER TABLE "issues" ADD COLUMN IF NOT EXISTS "monitor_next_check_at" timestamp with time zone;--> statement-breakpoint +ALTER TABLE "issues" ADD COLUMN IF NOT EXISTS "monitor_wake_requested_at" timestamp with time zone;--> statement-breakpoint +ALTER TABLE "issues" ADD COLUMN IF NOT EXISTS "monitor_last_triggered_at" timestamp with time zone;--> statement-breakpoint +ALTER TABLE "issues" ADD COLUMN IF NOT EXISTS "monitor_attempt_count" integer DEFAULT 0 NOT NULL;--> statement-breakpoint +ALTER TABLE "issues" ADD COLUMN IF NOT EXISTS "monitor_notes" text;--> statement-breakpoint +ALTER TABLE "issues" ADD COLUMN IF NOT EXISTS "monitor_scheduled_by" text;--> statement-breakpoint +CREATE INDEX IF NOT EXISTS "issues_company_monitor_due_idx" ON "issues" USING btree ("company_id","monitor_next_check_at");