protected function checkSequenceRenaming(string
$tableName): void
{ // For PostgreSQL, we also need to check that the sequence has been renamed.
// The initial name of the sequence has been generated automatically by
// PostgreSQL when the table was created, however, on subsequent table
// renames the name is generated by Drupal and can not be easily
// re-constructed. Hence we can only check that we still have a sequence on
// the new table name.
$sequenceExists =
(bool) $this->connection->
query("SELECT pg_get_serial_sequence('{" .
$tableName . "}', 'id')"
)->
fetchField();
$this->
assertTrue($sequenceExists, 'Sequence was renamed.'
);
// Rename the table again and repeat the check.
$anotherTableName =
strtolower($this->
getRandomGenerator()->
name(63 -
strlen($this->
getDatabasePrefix())));
$this->schema->
renameTable($tableName,
$anotherTableName);
$sequenceExists =
(bool) $this->connection->
query("SELECT pg_get_serial_sequence('{" .
$anotherTableName . "}', 'id')"
)->
fetchField();
$this->
assertTrue($sequenceExists, 'Sequence was renamed.'
);
} /**
* {@inheritdoc}
*/
public function testTableWithSpecificDataType(): void
{ $table_specification =
[