From 5e928f8cabda7abcefce6d685f202bfc6529c06a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Fra=C3=9F?= Date: Mon, 3 Jun 2024 09:33:24 +0200 Subject: [PATCH] [fix] output:database:postgresql --- source/outputs/database/postgresql/logic.ts | 22 ++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/source/outputs/database/postgresql/logic.ts b/source/outputs/database/postgresql/logic.ts index 1232048..ba7cfa8 100644 --- a/source/outputs/database/postgresql/logic.ts +++ b/source/outputs/database/postgresql/logic.ts @@ -89,8 +89,8 @@ namespace _sindri.outputs.database.postgresql // nullability .concat( data_field.nullable - ? ["NULL"] - : [] + ? [] + : ["NOT NULL"] ) // default .concat( @@ -166,26 +166,30 @@ namespace _sindri.outputs.database.postgresql ( [] .concat( - (domain.description === null) - ? [] - : [ + (! (domain.description === null)) + ? [ { "kind": "TABLE", "subject": domain.name, "value": domain.description, } ] + : [] ) .concat( - (domain.key_field === null) - ? [] - : [ + ( + (! (domain.key_field === null)) + && + (! (domain.key_field.description === null)) + ) + ? [ { "kind": "COLUMN", "subject": (domain.name + "." + domain.key_field.name), - "value": domain.description, + "value": domain.key_field.description, } ] + : [] ) .concat( domain.data_fields