Skip to content

Commit

Permalink
TEXT before NOT NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
hlcianfagna authored May 3, 2024
1 parent 2e7306b commit 3f74136
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/driver/cratedb/CrateDBPostgresQueryRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 3f74136

Please sign in to comment.