Set default value for DatasetEntry input (#214)

This commit is contained in:
arcticfly
2023-09-05 16:42:41 -07:00
committed by GitHub
parent 422a6ff4c6
commit 6ac554f7e1
2 changed files with 2 additions and 3 deletions

View File

@@ -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,

View File

@@ -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