This commit is contained in:
2026-07-16 09:53:14 +07:00
parent 0fc112a2e8
commit 29cec708a3
1236 changed files with 212848 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
ALTER TABLE "organizations"
ADD COLUMN IF NOT EXISTS "is_active" boolean DEFAULT true NOT NULL;
--> statement-breakpoint
ALTER TABLE "organizations"
ADD COLUMN IF NOT EXISTS "deleted_at" timestamp with time zone;
--> statement-breakpoint
ALTER TABLE "organizations"
ADD COLUMN IF NOT EXISTS "deleted_by" text;
--> statement-breakpoint
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1
FROM pg_constraint
WHERE conname = 'organizations_deleted_by_users_id_fk'
) THEN
ALTER TABLE "organizations"
ADD CONSTRAINT "organizations_deleted_by_users_id_fk"
FOREIGN KEY ("deleted_by")
REFERENCES "public"."users"("id")
ON DELETE set null
ON UPDATE no action;
END IF;
END $$;