-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16df433
commit b353b88
Showing
4 changed files
with
86 additions
and
36 deletions.
There are no files selected for viewing
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
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
19 changes: 19 additions & 0 deletions
19
src/prisma/tripbot/migrations/20240714130515_counting/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,19 @@ | ||
-- CreateTable | ||
CREATE TABLE "counting_breaks" ( | ||
"id" UUID NOT NULL DEFAULT uuid_generate_v4(), | ||
"user_id" TEXT NOT NULL, | ||
"game_id" "counting_type" NOT NULL, | ||
"count" INTEGER NOT NULL, | ||
"last_broken_at" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "counting_breaks_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "counting_userid_gameid_unique" ON "counting_breaks"("user_id", "game_id"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "counting_breaks" ADD CONSTRAINT "counting_userid_foreign" FOREIGN KEY ("user_id") REFERENCES "users"("discord_id") ON DELETE NO ACTION ON UPDATE NO ACTION; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "counting_breaks" ADD CONSTRAINT "counting_gameid_foreign" FOREIGN KEY ("id") REFERENCES "counting"("id") ON DELETE NO ACTION ON UPDATE NO ACTION; |
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