Files
sim/packages/db/migrations/0079_shocking_shriek.sql
Vikhyath Mondreti 9de7a00373 improvement(code-structure): move db into separate package (#1364)
* improvement(code-structure): move db into separate package

* make db separate package

* remake bun lock

* update imports to not maintain two separate ones

* fix CI for tests by adding dummy url

* vercel build fix attempt

* update bun lock

* regenerate bun lock

* fix mocks

* remove db commands from apps/sim package json
2025-09-17 15:41:13 -07:00

8 lines
827 B
SQL

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