mirror of
https://github.com/hknsh/project-knedita.git
synced 2024-12-01 10:51:17 +00:00
13 lines
460 B
SQL
13 lines
460 B
SQL
-- CreateTable
|
|
CREATE TABLE "Post" (
|
|
"id" TEXT NOT NULL,
|
|
"content" TEXT NOT NULL,
|
|
"authorId" TEXT NOT NULL,
|
|
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
CONSTRAINT "Post_pkey" PRIMARY KEY ("id")
|
|
);
|
|
|
|
-- AddForeignKey
|
|
ALTER TABLE "Post" ADD CONSTRAINT "Post_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|