From bfcd35512f241e176b90a9dea81d5439397350b4 Mon Sep 17 00:00:00 2001 From: gremble0 Date: Thu, 31 Oct 2024 14:29:26 +0100 Subject: [PATCH] Add nullable name and migrations --- .../migration.sql | 15 --------------- prisma/schema.prisma | 4 ++-- 2 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 prisma/migrations/20241031081749_add_comment_model/migration.sql diff --git a/prisma/migrations/20241031081749_add_comment_model/migration.sql b/prisma/migrations/20241031081749_add_comment_model/migration.sql deleted file mode 100644 index 08d1b2e4..00000000 --- a/prisma/migrations/20241031081749_add_comment_model/migration.sql +++ /dev/null @@ -1,15 +0,0 @@ --- CreateTable -CREATE TABLE "Comment" ( - "id" SERIAL NOT NULL, - "content" TEXT NOT NULL, - "userId" INTEGER NOT NULL, - "postId" INTEGER NOT NULL, - - CONSTRAINT "Comment_pkey" PRIMARY KEY ("id") -); - --- AddForeignKey -ALTER TABLE "Comment" ADD CONSTRAINT "Comment_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Comment" ADD CONSTRAINT "Comment_postId_fkey" FOREIGN KEY ("postId") REFERENCES "Post"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 88b95b44..44c8883c 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -33,8 +33,8 @@ model Profile { id Int @id @default(autoincrement()) userId Int @unique user User @relation(fields: [userId], references: [id], onDelete: Cascade) - firstName String - lastName String + firstName String? + lastName String? bio String? githubUsername String? username String?