-- CreateEnum
CREATE TYPE "MonsterType" AS ENUM ('BEAST', 'FLYING', 'HUMANOID', 'CANINE');

-- CreateTable
CREATE TABLE "Monster" (
    "id" UUID NOT NULL,
    "name" TEXT NOT NULL,
    "monsterType" "MonsterType"[],

    CONSTRAINT "Monster_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "MonsterBiome" (
    "monsterId" UUID NOT NULL,
    "biome" "Biome" NOT NULL,
    "weight" DECIMAL(65,30) NOT NULL,
    "time" JSONB NOT NULL,

    CONSTRAINT "MonsterBiome_pkey" PRIMARY KEY ("monsterId","biome")
);

-- CreateIndex
CREATE UNIQUE INDEX "Monster_name_key" ON "Monster"("name");

-- AddForeignKey
ALTER TABLE "MonsterBiome" ADD CONSTRAINT "MonsterBiome_monsterId_fkey" FOREIGN KEY ("monsterId") REFERENCES "Monster"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
