From 03277b81e14c6b6cefa3ac0011a181f6a4f86d32 Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Tue, 13 Feb 2024 13:52:07 -0500 Subject: [PATCH] fix: respect default in table types --- packages/db/src/runtime/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/db/src/runtime/types.ts b/packages/db/src/runtime/types.ts index d0a0c34d78..5d2c985f72 100644 --- a/packages/db/src/runtime/types.ts +++ b/packages/db/src/runtime/types.ts @@ -87,7 +87,7 @@ export type Table< { tableName: TTableName; name: K; - hasDefault: TFields[K] extends { default: NonNullable } + hasDefault: TFields[K]['schema'] extends { default: NonNullable } ? true : TFields[K]['schema'] extends { primaryKey: true } ? true