-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added scout quest model * ci: version bump to 0.93.2-rc-feat-sg-quest-p.0 * Daily claim enum builder event type * ci: version bump to 0.93.2-rc-feat-sg-quest-p.1 * Added daily claim event * ci: version bump to 0.94.1-rc-feat-sg-quest-p.0 * Made telegramid big int * ci: version bump to 0.94.1-rc-feat-sg-quest-p.1 * Added scout social quest model * ci: version bump to 0.94.1-rc-feat-sg-quest-p.2 * Added completed at to scout social quest model * ci: version bump to 0.94.1-rc-feat-sg-quest-p.3 * Added social quest builder event type * ci: version bump to 0.94.1-rc-feat-sg-quest-p.4 * Default completed at for scout social quest model * ci: version bump to 0.94.1-rc-feat-sg-quest-p.5 * Added daily claim streak builder event type * ci: version bump to 0.94.1-rc-feat-sg-quest-p.6 * add models * ci: version bump to 0.94.1-rc-feat-sg-quest-p.7 * Fixedc events * ci: version bump to 0.94.1-rc-feat-sg-quest-p.8 --------- Co-authored-by: Automated Version Bump <[email protected]> Co-authored-by: mattcasey <[email protected]>
- Loading branch information
1 parent
b6af8c9
commit 1888968
Showing
3 changed files
with
197 additions
and
49 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
101 changes: 101 additions & 0 deletions
101
src/prisma/migrations/20241108001525_scout_social_quest/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,101 @@ | ||
/* | ||
Warnings: | ||
- A unique constraint covering the columns `[dailyClaimEventId]` on the table `BuilderEvent` will be added. If there are existing duplicate values, this will fail. | ||
- A unique constraint covering the columns `[dailyClaimStreakEventId]` on the table `BuilderEvent` will be added. If there are existing duplicate values, this will fail. | ||
- A unique constraint covering the columns `[scoutSocialQuestId]` on the table `BuilderEvent` will be added. If there are existing duplicate values, this will fail. | ||
*/ | ||
-- AlterEnum | ||
-- This migration adds more than one value to an enum. | ||
-- With PostgreSQL versions 11 and earlier, this is not possible | ||
-- in a single migration. This can be worked around by creating | ||
-- multiple migrations, each migration adding only one value to | ||
-- the enum. | ||
|
||
|
||
ALTER TYPE "BuilderEventType" ADD VALUE 'daily_claim'; | ||
ALTER TYPE "BuilderEventType" ADD VALUE 'daily_claim_streak'; | ||
ALTER TYPE "BuilderEventType" ADD VALUE 'social_quest'; | ||
|
||
-- AlterTable | ||
ALTER TABLE "BuilderEvent" ADD COLUMN "dailyClaimEventId" UUID, | ||
ADD COLUMN "dailyClaimStreakEventId" UUID, | ||
ADD COLUMN "scoutSocialQuestId" UUID; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Scout" ALTER COLUMN "telegramId" SET DATA TYPE BIGINT; | ||
|
||
-- CreateTable | ||
CREATE TABLE "ScoutSocialQuest" ( | ||
"id" UUID NOT NULL, | ||
"type" TEXT NOT NULL, | ||
"userId" UUID NOT NULL, | ||
"completedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "ScoutSocialQuest_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "ScoutDailyClaimEvent" ( | ||
"id" UUID NOT NULL, | ||
"userId" UUID NOT NULL, | ||
"week" TEXT NOT NULL, | ||
"dayOfWeek" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "ScoutDailyClaimEvent_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "ScoutDailyClaimStreakEvent" ( | ||
"id" UUID NOT NULL, | ||
"userId" UUID NOT NULL, | ||
"week" TEXT NOT NULL, | ||
|
||
CONSTRAINT "ScoutDailyClaimStreakEvent_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "ScoutSocialQuest_userId_idx" ON "ScoutSocialQuest"("userId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "ScoutSocialQuest_type_userId_key" ON "ScoutSocialQuest"("type", "userId"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "ScoutDailyClaimEvent_userId_week_idx" ON "ScoutDailyClaimEvent"("userId", "week"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "ScoutDailyClaimEvent_userId_week_dayOfWeek_key" ON "ScoutDailyClaimEvent"("userId", "week", "dayOfWeek"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "ScoutDailyClaimStreakEvent_userId_week_idx" ON "ScoutDailyClaimStreakEvent"("userId", "week"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "ScoutDailyClaimStreakEvent_userId_week_key" ON "ScoutDailyClaimStreakEvent"("userId", "week"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "BuilderEvent_dailyClaimEventId_key" ON "BuilderEvent"("dailyClaimEventId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "BuilderEvent_dailyClaimStreakEventId_key" ON "BuilderEvent"("dailyClaimStreakEventId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "BuilderEvent_scoutSocialQuestId_key" ON "BuilderEvent"("scoutSocialQuestId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "BuilderEvent" ADD CONSTRAINT "BuilderEvent_dailyClaimEventId_fkey" FOREIGN KEY ("dailyClaimEventId") REFERENCES "ScoutDailyClaimEvent"("id") ON DELETE SET NULL ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "BuilderEvent" ADD CONSTRAINT "BuilderEvent_dailyClaimStreakEventId_fkey" FOREIGN KEY ("dailyClaimStreakEventId") REFERENCES "ScoutDailyClaimStreakEvent"("id") ON DELETE SET NULL ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "BuilderEvent" ADD CONSTRAINT "BuilderEvent_scoutSocialQuestId_fkey" FOREIGN KEY ("scoutSocialQuestId") REFERENCES "ScoutSocialQuest"("id") ON DELETE SET NULL ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "ScoutSocialQuest" ADD CONSTRAINT "ScoutSocialQuest_userId_fkey" FOREIGN KEY ("userId") REFERENCES "Scout"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "ScoutDailyClaimEvent" ADD CONSTRAINT "ScoutDailyClaimEvent_userId_fkey" FOREIGN KEY ("userId") REFERENCES "Scout"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "ScoutDailyClaimStreakEvent" ADD CONSTRAINT "ScoutDailyClaimStreakEvent_userId_fkey" FOREIGN KEY ("userId") REFERENCES "Scout"("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