4 - You are about to drop the `auth_token` table. If the table is not empty, all the data it contains will be lost.
5 - You are about to drop the `monster` table. If the table is not empty, all the data it contains will be lost.
6 - You are about to drop the `monster_biome` table. If the table is not empty, all the data it contains will be lost.
7 - You are about to drop the `player` table. If the table is not empty, all the data it contains will be lost.
8 - You are about to drop the `zone_biome` table. If the table is not empty, all the data it contains will be lost.
12 CREATE TYPE "Biome" AS ENUM ('PLAINS', 'FIELDS', 'WOODLAND', 'FOREST', 'SWAMP', 'TUNDRA', 'MOUNTAIN', 'CAVE', 'DESERT');
15 CREATE TYPE "MonsterType" AS ENUM ('BEAST', 'FLYING', 'HUMANOID', 'GIANT', 'INSECT', 'UNDEAD');
18 ALTER TABLE "auth_token" DROP CONSTRAINT "auth_token_playerId_fkey";
21 ALTER TABLE "monster_biome" DROP CONSTRAINT "monster_biome_monsterId_fkey";
24 ALTER TABLE "player" DROP CONSTRAINT "player_zoneBiomeId_fkey";
27 DROP TABLE "auth_token";
33 DROP TABLE "monster_biome";
39 DROP TABLE "zone_biome";
45 DROP TYPE "monster_type";
48 CREATE TABLE "ZoneBiomes" (
51 "biome" "Biome" NOT NULL,
52 "maxSteps" INTEGER NOT NULL DEFAULT 500,
54 CONSTRAINT "ZoneBiomes_pkey" PRIMARY KEY ("id")
58 CREATE TABLE "Player" (
60 "username" TEXT NOT NULL,
61 "password" TEXT NOT NULL,
62 "level" INTEGER NOT NULL DEFAULT 1,
63 "currency" INTEGER NOT NULL DEFAULT 0,
64 "pow" INTEGER NOT NULL,
65 "zest" INTEGER NOT NULL,
66 "woosh" INTEGER NOT NULL,
67 "luck" INTEGER NOT NULL,
68 "aha" INTEGER NOT NULL,
69 "wow" INTEGER NOT NULL,
70 "stamina" INTEGER NOT NULL,
71 "hp" INTEGER NOT NULL,
72 "statPoints" INTEGER NOT NULL DEFAULT 0,
73 "exp" INTEGER NOT NULL DEFAULT 0,
74 "zoneBiomeId" UUID NOT NULL,
75 "steps" INTEGER NOT NULL DEFAULT 0,
77 CONSTRAINT "Player_pkey" PRIMARY KEY ("id")
81 CREATE TABLE "AuthToken" (
82 "token" UUID NOT NULL,
83 "playerId" UUID NOT NULL,
84 "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
85 "updatedAt" TIMESTAMP(3),
87 CONSTRAINT "AuthToken_pkey" PRIMARY KEY ("token")
91 CREATE TABLE "Monster" (
94 "monsterType" "MonsterType"[],
96 CONSTRAINT "Monster_pkey" PRIMARY KEY ("id")
100 CREATE TABLE "MonsterBiome" (
101 "monsterId" UUID NOT NULL,
102 "biome" "Biome" NOT NULL,
103 "weight" DECIMAL(65,30) NOT NULL,
104 "time" JSONB NOT NULL,
106 CONSTRAINT "MonsterBiome_pkey" PRIMARY KEY ("monsterId","biome")
110 CREATE UNIQUE INDEX "Player_username_key" ON "Player"("username");
113 CREATE UNIQUE INDEX "Player_zoneBiomeId_key" ON "Player"("zoneBiomeId");
116 CREATE UNIQUE INDEX "AuthToken_playerId_key" ON "AuthToken"("playerId");
119 CREATE UNIQUE INDEX "Monster_name_key" ON "Monster"("name");
122 ALTER TABLE "Player" ADD CONSTRAINT "Player_zoneBiomeId_fkey" FOREIGN KEY ("zoneBiomeId") REFERENCES "ZoneBiomes"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
125 ALTER TABLE "AuthToken" ADD CONSTRAINT "AuthToken_playerId_fkey" FOREIGN KEY ("playerId") REFERENCES "Player"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
128 ALTER TABLE "MonsterBiome" ADD CONSTRAINT "MonsterBiome_monsterId_fkey" FOREIGN KEY ("monsterId") REFERENCES "Monster"("id") ON DELETE RESTRICT ON UPDATE CASCADE;