er/prisma/migrations/0_init/migration.sql
Louis Hollingworth 530e99a7d0
(#2) Members can now be in multiple guilds
Signed-off-by: Louis Hollingworth <louis@hollingworth.ch>
2023-06-18 14:05:21 +01:00

27 lines
641 B
SQL

-- CreateTable
CREATE TABLE "guild" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"reports_channel_id" TEXT,
CONSTRAINT "guild_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "member" (
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
"name" TEXT NOT NULL,
"booster_role_id" TEXT,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"dgid" TEXT NOT NULL,
"duid" TEXT NOT NULL,
CONSTRAINT "member_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "guild_id_key" ON "guild"("id");
-- CreateIndex
CREATE UNIQUE INDEX "member_dgid_duid_key" ON "member"("dgid", "duid");