From 3f74136b1da165afcfcf8865d0fda26fe2089300 Mon Sep 17 00:00:00 2001 From: hlcianfagna <110453267+hlcianfagna@users.noreply.github.com> Date: Fri, 3 May 2024 20:10:58 +0100 Subject: [PATCH] TEXT before NOT NULL --- src/driver/cratedb/CrateDBPostgresQueryRunner.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/driver/cratedb/CrateDBPostgresQueryRunner.ts b/src/driver/cratedb/CrateDBPostgresQueryRunner.ts index 695e087c3f..fe4d3650bc 100644 --- a/src/driver/cratedb/CrateDBPostgresQueryRunner.ts +++ b/src/driver/cratedb/CrateDBPostgresQueryRunner.ts @@ -4641,15 +4641,19 @@ export class CrateDBPostgresQueryRunner if (column.charset) c += ' CHARACTER SET "' + column.charset + '"' if (column.collation) c += ' COLLATE "' + column.collation + '"' + if ( + column.isGenerated && + column.generationStrategy === "uuid" + ) + c += ` TEXT ` if (column.isNullable !== true) c += " NOT NULL" - if (column.default !== undefined && column.default !== null && !(column.isGenerated && - column.generationStrategy === "uuid")) + if (column.default !== undefined && column.default !== null) c += " DEFAULT " + column.default if ( column.isGenerated && column.generationStrategy === "uuid" ) - c += ` TEXT DEFAULT ${this.driver.uuidGenerator}` + c += ` DEFAULT ${this.driver.uuidGenerator}` return c }