sublime fkt but everything working

This commit is contained in:
Nathan Rashleigh committed 2024-04-10 12:33:47 +10:00
1 parent b655adc305
commit 66228047f4
12 files changed
+363 -123

No files matched your search

@@ -0,0 +1,38 @@
-- CreateTable
CREATE TABLE "attachments" (
"id" BIGINT NOT NULL,
"msgId" BIGINT NOT NULL,
"channelId" BIGINT NOT NULL,
"memeId" UUID NOT NULL,
"url" TEXT NOT NULL,
"contentType" TEXT NOT NULL,
"message" JSONB NOT NULL,
"guild" JSONB NOT NULL,
"channel" JSONB NOT NULL,
"vision" JSONB NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "attachments_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "memes" (
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
"url" TEXT NOT NULL,
"text" TEXT NOT NULL,
"tags" JSONB NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "memes_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "attachments_memeId_key" ON "attachments"("memeId");
-- CreateIndex
CREATE INDEX "attachments_channelId_idx" ON "attachments"("channelId");
-- AddForeignKey
ALTER TABLE "attachments" ADD CONSTRAINT "attachments_memeId_fkey" FOREIGN KEY ("memeId") REFERENCES "memes"("id") ON DELETE RESTRICT ON UPDATE CASCADE;