-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/dev' into dev
- Loading branch information
Showing
41 changed files
with
2,431 additions
and
186 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 was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
prisma/migrations/20240818143249_updated_user_model/migration.sql
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
prisma/migrations/20240824114901_updated_user_model/migration.sql
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
prisma/migrations/20240824115758_updated_user_model/migration.sql
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
prisma/migrations/20240824121027_updated_user_model/migration.sql
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
prisma/migrations/20240824132519_added_refree_model/migration.sql
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
prisma/migrations/20240825061257_updated_user_model/migration.sql
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
prisma/migrations/20240825064700_updated_user_model/migration.sql
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
prisma/migrations/20240825141032_updated_referral_model/migration.sql
This file was deleted.
Oops, something went wrong.
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,111 @@ | ||
-- CreateTable | ||
CREATE TABLE "User" ( | ||
"id" SERIAL NOT NULL, | ||
"address" TEXT NOT NULL, | ||
"isTncSigned" BOOLEAN DEFAULT false, | ||
"message" TEXT, | ||
"tncDocVersion" TEXT DEFAULT '1.0', | ||
"referralCode" TEXT NOT NULL, | ||
"referralCount" INTEGER DEFAULT 0, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "User_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Raffle" ( | ||
"raffleId" SERIAL NOT NULL, | ||
"isRaffleParticipant" BOOLEAN DEFAULT false, | ||
"sharedOnX" BOOLEAN DEFAULT false, | ||
"activeDeposits" BOOLEAN DEFAULT false, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"userId" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "Raffle_pkey" PRIMARY KEY ("raffleId") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "LuckyWinner" ( | ||
"winnerId" SERIAL NOT NULL, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"raffleId" INTEGER NOT NULL, | ||
"userId" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "LuckyWinner_pkey" PRIMARY KEY ("winnerId") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Signatures" ( | ||
"id" SERIAL NOT NULL, | ||
"signature" TEXT NOT NULL, | ||
"tncDocVersion" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"userId" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "Signatures_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Referral" ( | ||
"referralId" SERIAL NOT NULL, | ||
"refreeAddress" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"userId" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "Referral_pkey" PRIMARY KEY ("referralId") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "og_nft_users" ( | ||
"id" SERIAL NOT NULL, | ||
"userId" INTEGER NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
|
||
CONSTRAINT "og_nft_users_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User_address_key" ON "User"("address"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User_referralCode_key" ON "User"("referralCode"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Raffle_userId_raffleId_key" ON "Raffle"("userId", "raffleId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "LuckyWinner_userId_winnerId_key" ON "LuckyWinner"("userId", "winnerId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Signatures_userId_tncDocVersion_key" ON "Signatures"("userId", "tncDocVersion"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Referral_refreeAddress_key" ON "Referral"("refreeAddress"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Referral_userId_refreeAddress_key" ON "Referral"("userId", "refreeAddress"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "og_nft_users_userId_key" ON "og_nft_users"("userId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Raffle" ADD CONSTRAINT "Raffle_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "LuckyWinner" ADD CONSTRAINT "LuckyWinner_raffleId_fkey" FOREIGN KEY ("raffleId") REFERENCES "Raffle"("raffleId") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "LuckyWinner" ADD CONSTRAINT "LuckyWinner_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Signatures" ADD CONSTRAINT "Signatures_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Referral" ADD CONSTRAINT "Referral_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "og_nft_users" ADD CONSTRAINT "og_nft_users_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |
22 changes: 22 additions & 0 deletions
22
prisma/migrations/20241029102731_added_round_id/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,22 @@ | ||
/* | ||
Warnings: | ||
- The primary key for the `LuckyWinner` table will be changed. If it partially fails, the table could be left without primary key constraint. | ||
- You are about to drop the column `winnerId` on the `LuckyWinner` table. All the data in the column will be lost. | ||
- A unique constraint covering the columns `[roundId]` on the table `LuckyWinner` will be added. If there are existing duplicate values, this will fail. | ||
- A unique constraint covering the columns `[userId,roundId]` on the table `LuckyWinner` will be added. If there are existing duplicate values, this will fail. | ||
*/ | ||
-- DropIndex | ||
DROP INDEX "LuckyWinner_userId_winnerId_key"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "LuckyWinner" DROP CONSTRAINT "LuckyWinner_pkey", | ||
DROP COLUMN "winnerId", | ||
ADD COLUMN "roundId" INTEGER NOT NULL DEFAULT 0; | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "LuckyWinner_roundId_key" ON "LuckyWinner"("roundId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "LuckyWinner_userId_roundId_key" ON "LuckyWinner"("userId", "roundId"); |
2 changes: 2 additions & 0 deletions
2
prisma/migrations/20241029103119_updated_round_id_constraints/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,2 @@ | ||
-- DropIndex | ||
DROP INDEX "LuckyWinner_roundId_key"; |
3 changes: 3 additions & 0 deletions
3
prisma/migrations/20241029103502_updated_round_id_constraints/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,3 @@ | ||
-- AlterTable | ||
ALTER TABLE "LuckyWinner" ALTER COLUMN "roundId" SET DEFAULT 1, | ||
ADD CONSTRAINT "LuckyWinner_pkey" PRIMARY KEY ("roundId"); |
10 changes: 10 additions & 0 deletions
10
prisma/migrations/20241029103711_updated_round_id_constraints/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,10 @@ | ||
/* | ||
Warnings: | ||
- The primary key for the `LuckyWinner` table will be changed. If it partially fails, the table could be left without primary key constraint. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "LuckyWinner" DROP CONSTRAINT "LuckyWinner_pkey", | ||
ADD COLUMN "winnerId" SERIAL NOT NULL, | ||
ADD CONSTRAINT "LuckyWinner_pkey" PRIMARY KEY ("winnerId"); |
18 changes: 18 additions & 0 deletions
18
prisma/migrations/20241029105811_updated_raffle_model/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,18 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `roundId` on the `LuckyWinner` table. All the data in the column will be lost. | ||
- A unique constraint covering the columns `[userId,winnerId]` on the table `LuckyWinner` will be added. If there are existing duplicate values, this will fail. | ||
*/ | ||
-- DropIndex | ||
DROP INDEX "LuckyWinner_userId_roundId_key"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "LuckyWinner" DROP COLUMN "roundId"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Raffle" ADD COLUMN "roundId" INTEGER NOT NULL DEFAULT 1; | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "LuckyWinner_userId_winnerId_key" ON "LuckyWinner"("userId", "winnerId"); |
11 changes: 11 additions & 0 deletions
11
prisma/migrations/20241029113615_updated_lucky_winner_model/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,11 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `roundId` on the `Raffle` table. All the data in the column will be lost. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "LuckyWinner" ADD COLUMN "roundId" SERIAL NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Raffle" DROP COLUMN "roundId"; |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "postgresql" |
Oops, something went wrong.