forked from bloom-housing/bloom
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create feature flag table (bloom-housing#4475) (#947)
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
api/prisma/migrations/20_create_feature_flag_table/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
-- CreateTable | ||
CREATE TABLE "feature_flags" ( | ||
"id" UUID NOT NULL DEFAULT uuid_generate_v4(), | ||
"created_at" TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updated_at" TIMESTAMP(6) NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"description" TEXT NOT NULL, | ||
"active" BOOLEAN NOT NULL DEFAULT true, | ||
|
||
CONSTRAINT "feature_flags_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "_FeatureFlagsToJurisdictions" ( | ||
"A" UUID NOT NULL, | ||
"B" UUID NOT NULL | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "feature_flags_name_key" ON "feature_flags"("name"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "_FeatureFlagsToJurisdictions_AB_unique" ON "_FeatureFlagsToJurisdictions"("A", "B"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "_FeatureFlagsToJurisdictions_B_index" ON "_FeatureFlagsToJurisdictions"("B"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_FeatureFlagsToJurisdictions" ADD CONSTRAINT "_FeatureFlagsToJurisdictions_A_fkey" FOREIGN KEY ("A") REFERENCES "feature_flags"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_FeatureFlagsToJurisdictions" ADD CONSTRAINT "_FeatureFlagsToJurisdictions_B_fkey" FOREIGN KEY ("B") REFERENCES "jurisdictions"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters