From 6ac554f7e145d2ee2c3c058aa478dc34c8d7413e Mon Sep 17 00:00:00 2001 From: arcticfly <41524992+arcticfly@users.noreply.github.com> Date: Tue, 5 Sep 2023 16:42:41 -0700 Subject: [PATCH] Set default value for DatasetEntry input (#214) --- .../migration.sql | 3 +-- app/prisma/schema.prisma | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) rename app/prisma/migrations/{20230904234505_revamp_dataset_entry => 20230905233758_revamp_dataset_entry}/migration.sql (88%) diff --git a/app/prisma/migrations/20230904234505_revamp_dataset_entry/migration.sql b/app/prisma/migrations/20230905233758_revamp_dataset_entry/migration.sql similarity index 88% rename from app/prisma/migrations/20230904234505_revamp_dataset_entry/migration.sql rename to app/prisma/migrations/20230905233758_revamp_dataset_entry/migration.sql index 7477d39..f485586 100644 --- a/app/prisma/migrations/20230904234505_revamp_dataset_entry/migration.sql +++ b/app/prisma/migrations/20230905233758_revamp_dataset_entry/migration.sql @@ -1,7 +1,6 @@ /* Warnings: - - Added the required column `input` to the `DatasetEntry` table without a default value. This is not possible if the table is not empty. - Added the required column `inputTokens` to the `DatasetEntry` table without a default value. This is not possible if the table is not empty. - Added the required column `outputTokens` to the `DatasetEntry` table without a default value. This is not possible if the table is not empty. - Added the required column `type` to the `DatasetEntry` table without a default value. This is not possible if the table is not empty. @@ -14,7 +13,7 @@ CREATE TYPE "DatasetEntryType" AS ENUM ('TRAIN', 'TEST'); ALTER TABLE "Dataset" ADD COLUMN "trainingRatio" DOUBLE PRECISION NOT NULL DEFAULT 0.8; -- AlterTable -ALTER TABLE "DatasetEntry" ADD COLUMN "input" JSONB NOT NULL, +ALTER TABLE "DatasetEntry" ADD COLUMN "input" JSONB NOT NULL DEFAULT '[]', ADD COLUMN "inputTokens" INTEGER NOT NULL, ADD COLUMN "output" JSONB, ADD COLUMN "outputTokens" INTEGER NOT NULL, diff --git a/app/prisma/schema.prisma b/app/prisma/schema.prisma index f7fe09b..acf3046 100644 --- a/app/prisma/schema.prisma +++ b/app/prisma/schema.prisma @@ -202,7 +202,7 @@ model DatasetEntry { loggedCallId String @db.Uuid loggedCall LoggedCall @relation(fields: [loggedCallId], references: [id], onDelete: Cascade) - input Json + input Json @default("[]") output Json? inputTokens Int outputTokens Int