Skip to content

Commit 3f74136

Browse files
authored
TEXT before NOT NULL
1 parent 2e7306b commit 3f74136

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/driver/cratedb/CrateDBPostgresQueryRunner.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4641,15 +4641,19 @@ export class CrateDBPostgresQueryRunner
46414641

46424642
if (column.charset) c += ' CHARACTER SET "' + column.charset + '"'
46434643
if (column.collation) c += ' COLLATE "' + column.collation + '"'
4644+
if (
4645+
column.isGenerated &&
4646+
column.generationStrategy === "uuid"
4647+
)
4648+
c += ` TEXT `
46444649
if (column.isNullable !== true) c += " NOT NULL"
4645-
if (column.default !== undefined && column.default !== null && !(column.isGenerated &&
4646-
column.generationStrategy === "uuid"))
4650+
if (column.default !== undefined && column.default !== null)
46474651
c += " DEFAULT " + column.default
46484652
if (
46494653
column.isGenerated &&
46504654
column.generationStrategy === "uuid"
46514655
)
4652-
c += ` TEXT DEFAULT ${this.driver.uuidGenerator}`
4656+
c += ` DEFAULT ${this.driver.uuidGenerator}`
46534657

46544658
return c
46554659
}

0 commit comments

Comments
 (0)