diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php index f6be9e9..0828d59 100644 --- a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php @@ -727,7 +727,7 @@ public function changeField($table, $field, $field_new, $spec, $new_keys = array // the typecast does not work for conversions to bytea. // @see http://www.postgresql.org/docs/current/static/datatype-binary.html $table_information = $this->queryTableInformation($table); - $is_bytea = in_array($field, $table_information->blob_fields, TRUE); + $is_bytea = !empty($table_information->blob_fields[$field]); if ($spec['pgsql_type'] != 'bytea') { if ($is_bytea) { $this->connection->query('ALTER TABLE {' . $table . '} ALTER "' . $field . '" TYPE ' . $field_def . ' USING convert_from("' . $field . '"' . ", 'UTF8')"); diff --git a/core/modules/system/src/Tests/Database/SchemaTest.php b/core/modules/system/src/Tests/Database/SchemaTest.php index e6aea74..5f60bf6 100644 --- a/core/modules/system/src/Tests/Database/SchemaTest.php +++ b/core/modules/system/src/Tests/Database/SchemaTest.php @@ -725,6 +725,7 @@ protected function assertFieldChange($old_spec, $new_spec, $test_data = NULL) { ->condition('serial_column', $id) ->execute() ->fetchField(); + $this->pass($old_spec['type'] .' to '. $new_spec['type']); $this->assertIdentical($field_value, $test_data); }