Loading core/modules/pgsql/src/Driver/Database/pgsql/Schema.php +1 −1 Original line number Diff line number Diff line Loading @@ -358,7 +358,7 @@ protected function createFieldSql($name, $spec) { } if (!empty($spec['unsigned'])) { $sql .= " CHECK ($name >= 0)"; $sql .= ' CHECK ("' . $name . '" >= 0)'; } if (isset($spec['not null'])) { Loading core/modules/pgsql/tests/src/Kernel/pgsql/SchemaTest.php +18 −0 Original line number Diff line number Diff line Loading @@ -307,4 +307,22 @@ public function testPgsqlSequences(): void { } /** * Tests column name escaping in field constraints. */ public function testUnsignedField(): void { $table_name = 'unsigned_table'; $table_spec = [ 'fields' => [ 'order' => [ 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, ], ], 'primary key' => ['order'], ]; $this->schema->createTable($table_name, $table_spec); } } Loading
core/modules/pgsql/src/Driver/Database/pgsql/Schema.php +1 −1 Original line number Diff line number Diff line Loading @@ -358,7 +358,7 @@ protected function createFieldSql($name, $spec) { } if (!empty($spec['unsigned'])) { $sql .= " CHECK ($name >= 0)"; $sql .= ' CHECK ("' . $name . '" >= 0)'; } if (isset($spec['not null'])) { Loading
core/modules/pgsql/tests/src/Kernel/pgsql/SchemaTest.php +18 −0 Original line number Diff line number Diff line Loading @@ -307,4 +307,22 @@ public function testPgsqlSequences(): void { } /** * Tests column name escaping in field constraints. */ public function testUnsignedField(): void { $table_name = 'unsigned_table'; $table_spec = [ 'fields' => [ 'order' => [ 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, ], ], 'primary key' => ['order'], ]; $this->schema->createTable($table_name, $table_spec); } }