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");