fix(backend): Add forgotton migration for news storage

This commit is contained in:
Aden Lindsay
2025-02-03 16:50:10 +10:30
committed by GitHub
parent 9344d94e4c
commit 256fbd6afa

View File

@ -0,0 +1,16 @@
-- CreateTable
CREATE TABLE "news" (
"id" TEXT NOT NULL,
"title" TEXT NOT NULL,
"content" TEXT NOT NULL,
"excerpt" TEXT NOT NULL,
"tags" TEXT[],
"image" TEXT,
"publishedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"authorId" TEXT NOT NULL,
CONSTRAINT "news_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "news" ADD CONSTRAINT "news_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;