不要怂,就是干,撸起袖子干!

Commit 89d13015 by ShaunParsons Committed by Felix Becker

fix(datatypes): add length to Postgres character type

1 parent 83351e6e
...@@ -101,7 +101,7 @@ const QueryGenerator = { ...@@ -101,7 +101,7 @@ const QueryGenerator = {
} }
return 'SELECT pk.constraint_type as "Constraint", c.column_name as "Field", ' + return 'SELECT pk.constraint_type as "Constraint", c.column_name as "Field", ' +
'c.column_default as "Default", c.is_nullable as "Null", ' + 'c.column_default as "Default", c.is_nullable as "Null", ' +
'CASE WHEN c.udt_name = \'hstore\' THEN c.udt_name ELSE c.data_type END as "Type", ' + '(CASE WHEN c.udt_name = \'hstore\' THEN c.udt_name ELSE c.data_type END) || (CASE WHEN c.character_maximum_length IS NOT NULL THEN \'(\' || c.character_maximum_length || \')\' ELSE \'\' END) as "Type", ' +
'(SELECT array_agg(e.enumlabel) ' + '(SELECT array_agg(e.enumlabel) ' +
'FROM pg_catalog.pg_type t JOIN pg_catalog.pg_enum e ON t.oid=e.enumtypid ' + 'FROM pg_catalog.pg_type t JOIN pg_catalog.pg_enum e ON t.oid=e.enumtypid ' +
'WHERE t.typname=c.udt_name) AS "special" ' + 'WHERE t.typname=c.udt_name) AS "special" ' +
......
...@@ -174,7 +174,7 @@ describe(Support.getTestDialectTeaser('QueryInterface'), () => { ...@@ -174,7 +174,7 @@ describe(Support.getTestDialectTeaser('QueryInterface'), () => {
let assertVal = 'VARCHAR(255)'; let assertVal = 'VARCHAR(255)';
switch (dialect) { switch (dialect) {
case 'postgres': case 'postgres':
assertVal = 'CHARACTER VARYING'; assertVal = 'CHARACTER VARYING(255)';
break; break;
case 'mssql': case 'mssql':
assertVal = 'NVARCHAR'; assertVal = 'NVARCHAR';
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!