From 219a5a877bf7e8374f7f9874675e5512a9ad66d6 Mon Sep 17 00:00:00 2001 From: 1ilit Date: Wed, 3 Jul 2024 03:27:36 +0300 Subject: [PATCH] Fix UNIQUE not added in postgres --- src/utils/toSQL.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/toSQL.js b/src/utils/toSQL.js index 0625b93..9f1fa30 100644 --- a/src/utils/toSQL.js +++ b/src/utils/toSQL.js @@ -265,7 +265,7 @@ export function jsonToPostgreSQL(obj) { field.name }" ${getTypeString(field, "postgres")}${ field.notNull ? " NOT NULL" : "" - }${ + }${field.unique ? " UNIQUE" : ""}${ field.default !== "" ? ` DEFAULT ${parseDefault(field)}` : "" }${ field.check === "" || !hasCheck(field.type)