From: Jason Etheridge Date: Tue, 23 Jul 2013 20:23:48 +0000 (-0400) Subject: handle character type X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9b17d559d826d1ba09d4f26af575bc9d8dfa6475;p=working%2FEvergreen.git handle character type Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/src/sql/Pg/make-pgtap-tests.pl b/Open-ILS/src/sql/Pg/make-pgtap-tests.pl index e9f85433e6..983efca3cc 100755 --- a/Open-ILS/src/sql/Pg/make-pgtap-tests.pl +++ b/Open-ILS/src/sql/Pg/make-pgtap-tests.pl @@ -72,6 +72,7 @@ foreach my $schema ( @schemas ) { my $col_numeric_scale = $column_array->[5]; my $col_udt_schema = $column_array->[6]; my $col_udt_name = $column_array->[7]; + my $col_character_maximum_length = $column_array->[8]; if (defined $col_default && $col_default =~ /::text/) { $col_default =~ s/^'(.*)'::text$/$1/; @@ -86,6 +87,10 @@ foreach my $schema ( @schemas ) { if ($col_type eq 'USER-DEFINED' && defined $col_udt_schema) { $col_type = "$col_udt_schema.$col_udt_name"; } + if ($col_type eq 'character' && defined $col_character_maximum_length) { + $col_type .= "($col_character_maximum_length)"; + } + print "\n-- -- -- column " . $dbh->quote("$schema.$table.$column") . "\n\n"; print "SELECT has_column(\n"; print "\t" . $dbh->quote($schema) . ",\n"; @@ -231,7 +236,8 @@ sub fetch_columns { numeric_precision, numeric_scale, udt_schema, - udt_name + udt_name, + character_maximum_length FROM information_schema.columns WHERE table_catalog = ? AND table_schema = ?