Permalink
Browse files

Install: pgsql bool check now handles nullable columns

Issue #16392
  • Loading branch information...
1 parent e2e0a9d commit ddba1d9fd685f0d58a63e50ee8cbb36aa472adac @dregad dregad committed Sep 8, 2013
Showing with 4 additions and 3 deletions.
  1. +3 −2 admin/install.php
  2. +1 −1 core/install_helper_functions_api.php
View
5 admin/install.php
@@ -868,11 +868,12 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
# Convert the columns
foreach( $ret as $row ) {
extract( $row );
+ $t_null = $is_nullable ? 'NULL' : 'NOT NULL';
+ $t_default = is_null( $column_default ) ? 'NULL' : $column_default;
$sqlarray = $dict->AlterColumnSQL(
$table_name,
- "$column_name L NOTNULL DEFAULT '$column_default'"
+ "$column_name L $t_null DEFAULT $t_default"
);
-
print_test(
"Converting column $table_name.$column_name to BOOLEAN",
2 == $dict->ExecuteSQLArray( $sqlarray, false ),
View
2 core/install_helper_functions_api.php
@@ -122,7 +122,7 @@ function check_pgsql_bool_columns() {
. implode($t_columns, "', '")
. "' ) OR\n";
}
- $sql = "SELECT table_name, column_name, data_type, column_default
+ $sql = "SELECT table_name, column_name, data_type, column_default, is_nullable
FROM information_schema.columns
WHERE
table_catalog = '$f_database_name' AND

0 comments on commit ddba1d9

Please sign in to comment.