1
0
mirror of synced 2024-12-14 15:52:55 +01:00
Bayshore/prisma/migrations/20220824075745_ghost_stamp/migration.sql
2022-08-24 16:46:52 +07:00

36 lines
1.2 KiB
SQL

-- AlterTable
ALTER TABLE "Car" ADD COLUMN "stampSheet" INTEGER[],
ADD COLUMN "stampSheetCount" INTEGER NOT NULL DEFAULT 0,
ADD COLUMN "vsStarCountMax" INTEGER NOT NULL DEFAULT 0,
ALTER COLUMN "stLoseBits" SET DEFAULT 0;
-- CreateTable
CREATE TABLE "CarChallenger" (
"id" SERIAL NOT NULL,
"carId" INTEGER NOT NULL,
"challengerCarId" INTEGER NOT NULL,
"stamp" INTEGER NOT NULL,
"result" INTEGER NOT NULL,
"area" INTEGER NOT NULL,
CONSTRAINT "CarChallenger_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "CarStampTarget" (
"id" SERIAL NOT NULL,
"carId" INTEGER NOT NULL,
"stampTargetCarId" INTEGER NOT NULL,
"returnCount" INTEGER NOT NULL,
"locked" BOOLEAN NOT NULL,
"recommended" BOOLEAN NOT NULL,
CONSTRAINT "CarStampTarget_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "CarChallenger" ADD CONSTRAINT "CarChallenger_challengerCarId_fkey" FOREIGN KEY ("challengerCarId") REFERENCES "Car"("carId") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "CarStampTarget" ADD CONSTRAINT "CarStampTarget_stampTargetCarId_fkey" FOREIGN KEY ("stampTargetCarId") REFERENCES "Car"("carId") ON DELETE RESTRICT ON UPDATE CASCADE;