From 3d72c8e8e3d35dfce4905e8bf3e900b6ba4f954d Mon Sep 17 00:00:00 2001 From: Jose Alberto Delgado Date: Mon, 26 Feb 2024 17:47:21 +0100 Subject: [PATCH] refactor: readed to isRead and readedAt to isReadAt --- .../20240226163703_is_read_is_read_at/migration.sql | 12 ++++++++++++ prisma/schema.prisma | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 prisma/migrations/20240226163703_is_read_is_read_at/migration.sql diff --git a/prisma/migrations/20240226163703_is_read_is_read_at/migration.sql b/prisma/migrations/20240226163703_is_read_is_read_at/migration.sql new file mode 100644 index 0000000..ad70cad --- /dev/null +++ b/prisma/migrations/20240226163703_is_read_is_read_at/migration.sql @@ -0,0 +1,12 @@ +/* + Warnings: + + - You are about to drop the column `readed` on the `Notification` table. All the data in the column will be lost. + - You are about to drop the column `readedAt` on the `Notification` table. All the data in the column will be lost. + +*/ +-- AlterTable +ALTER TABLE "Notification" DROP COLUMN "readed", +DROP COLUMN "readedAt", +ADD COLUMN "isRead" BOOLEAN NOT NULL DEFAULT false, +ADD COLUMN "isReaddAt" TIMESTAMP(3); diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 1000a37..728273a 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -38,9 +38,9 @@ model Notification { id String @id @default(uuid()) userId String message String - readed Boolean @default(false) + isRead Boolean @default(false) createdAt DateTime @default(now()) - readedAt DateTime? + isReaddAt DateTime? queue String User User @relation(fields: [userId], references: [id], onDelete: Cascade) }