From 4cdf76f381b385d97c9eca001b217fc3642408d1 Mon Sep 17 00:00:00 2001 From: Judson Cairo Date: Fri, 30 Aug 2024 16:37:20 -0300 Subject: [PATCH] Refactor database table name for IsOnWhatsapp --- .../migration.sql | 22 +++++++++++++++++++ prisma/postgresql-schema.prisma | 10 ++++----- 2 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 prisma/postgresql-migrations/20240830193533_changed_table_case/migration.sql diff --git a/prisma/postgresql-migrations/20240830193533_changed_table_case/migration.sql b/prisma/postgresql-migrations/20240830193533_changed_table_case/migration.sql new file mode 100644 index 00000000..209dd18c --- /dev/null +++ b/prisma/postgresql-migrations/20240830193533_changed_table_case/migration.sql @@ -0,0 +1,22 @@ +/* + Warnings: + + - You are about to drop the `is_on_whatsapp` table. If the table is not empty, all the data it contains will be lost. + +*/ +-- DropTable +DROP TABLE "is_on_whatsapp"; + +-- CreateTable +CREATE TABLE "IsOnWhatsapp" ( + "id" TEXT NOT NULL, + "remoteJid" VARCHAR(100) NOT NULL, + "jidOptions" TEXT NOT NULL, + "createdAt" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP NOT NULL, + + CONSTRAINT "IsOnWhatsapp_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "IsOnWhatsapp_remoteJid_key" ON "IsOnWhatsapp"("remoteJid"); diff --git a/prisma/postgresql-schema.prisma b/prisma/postgresql-schema.prisma index 86cbb79f..931d67bd 100644 --- a/prisma/postgresql-schema.prisma +++ b/prisma/postgresql-schema.prisma @@ -577,10 +577,8 @@ model FlowiseSetting { model IsOnWhatsapp { id String @id @default(cuid()) - remoteJid String @unique @map("remote_jid") @db.VarChar(100) - jidOptions String @map("jid_options") - createdAt DateTime @default(now()) @map("created_at") @db.Timestamp - updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamp - - @@map("is_on_whatsapp") + remoteJid String @unique @db.VarChar(100) + jidOptions String + createdAt DateTime @default(now()) @db.Timestamp + updatedAt DateTime @updatedAt @db.Timestamp }