From 9ffb48ee025ee140ac36409d0a49538e9253cef8 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Tue, 2 Sep 2025 10:48:22 -0700 Subject: [PATCH] make 79th migration idempotent --- apps/sim/db/migrations/0079_shocking_shriek.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/sim/db/migrations/0079_shocking_shriek.sql b/apps/sim/db/migrations/0079_shocking_shriek.sql index 58e63c4781..5d8947b5cc 100644 --- a/apps/sim/db/migrations/0079_shocking_shriek.sql +++ b/apps/sim/db/migrations/0079_shocking_shriek.sql @@ -1,8 +1,8 @@ -ALTER TABLE "subscription" DROP CONSTRAINT "check_enterprise_metadata";--> statement-breakpoint +ALTER TABLE "subscription" DROP CONSTRAINT IF EXISTS "check_enterprise_metadata";--> statement-breakpoint ALTER TABLE "organization" ADD COLUMN IF NOT EXISTS "org_usage_limit" numeric;--> statement-breakpoint ALTER TABLE "user_stats" ALTER COLUMN "current_usage_limit" DROP NOT NULL;--> statement-breakpoint ALTER TABLE "user_stats" ADD COLUMN IF NOT EXISTS "billing_blocked" boolean DEFAULT false;--> statement-breakpoint -ALTER TABLE "user_stats" DROP COLUMN "usage_limit_set_by";--> statement-breakpoint -ALTER TABLE "user_stats" DROP COLUMN "billing_period_start";--> statement-breakpoint -ALTER TABLE "user_stats" DROP COLUMN "billing_period_end";--> statement-breakpoint +ALTER TABLE "user_stats" DROP COLUMN IF EXISTS "usage_limit_set_by";--> statement-breakpoint +ALTER TABLE "user_stats" DROP COLUMN IF EXISTS "billing_period_start";--> statement-breakpoint +ALTER TABLE "user_stats" DROP COLUMN IF EXISTS "billing_period_end";--> statement-breakpoint ALTER TABLE "subscription" ADD CONSTRAINT "check_enterprise_metadata" CHECK (plan != 'enterprise' OR metadata IS NOT NULL); \ No newline at end of file