fix: adjusts for new manager

This commit is contained in:
Davidson Gomes
2024-07-29 15:09:40 -03:00
parent 089810fb55
commit 2a7f9698d2
7 changed files with 39 additions and 20 deletions

View File

@@ -0,0 +1,20 @@
/*
Warnings:
- The values [open] on the enum `TypebotSessionStatus` will be removed. If these variants are still used in the database, this will fail.
- Changed the type of `status` on the `TypebotSession` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
*/
-- AlterEnum
BEGIN;
CREATE TYPE "TypebotSessionStatus_new" AS ENUM ('opened', 'closed', 'paused');
ALTER TABLE "TypebotSession" ALTER COLUMN "status" TYPE "TypebotSessionStatus_new" USING ("status"::text::"TypebotSessionStatus_new");
ALTER TABLE "OpenaiSession" ALTER COLUMN "status" TYPE "TypebotSessionStatus_new" USING ("status"::text::"TypebotSessionStatus_new");
ALTER TYPE "TypebotSessionStatus" RENAME TO "TypebotSessionStatus_old";
ALTER TYPE "TypebotSessionStatus_new" RENAME TO "TypebotSessionStatus";
DROP TYPE "TypebotSessionStatus_old";
COMMIT;
-- AlterTable
ALTER TABLE "TypebotSession" DROP COLUMN "status",
ADD COLUMN "status" "TypebotSessionStatus" NOT NULL;

View File

@@ -36,6 +36,7 @@ enum TypebotSessionStatus {
enum TriggerType {
all
keyword
none
}
enum TriggerOperator {

View File

@@ -28,7 +28,7 @@ enum DeviceMessage {
}
enum TypebotSessionStatus {
open
opened
closed
paused
}
@@ -292,7 +292,7 @@ model TypebotSession {
remoteJid String @db.VarChar(100)
pushName String? @db.VarChar(100)
sessionId String @db.VarChar(100)
status String @db.VarChar(100)
status TypebotSessionStatus
prefilledVariables Json? @db.JsonB
awaitUser Boolean @default(false) @db.Boolean
createdAt DateTime? @default(now()) @db.Timestamp