// @todo remove comments when: https://www.drupal.org/project/drupal/issues/3325358 is committed.
// $this->assertTrue($this->testingFakeConnection->schema()->indexExists('faking_table', 'test_field'));
$results =
$this->testingFakeConnection->
query("SELECT * FROM pg_indexes WHERE indexname = :indexname",
[':indexname' =>
$this->testingFakeConnection->
getPrefix() . 'faking_table__test_field__key'
])->
fetchAll();
// Check the unique key columns.
$this->
assertCount(1,
$results);
$this->
assertSame('testing_fake',
$results[0
]->schemaname
);
$this->
assertSame($this->testingFakeConnection->
getPrefix() . 'faking_table',
$results[0
]->tablename
);
$this->
assertStringContainsString('USING btree (test_field)',
$results[0
]->indexdef
);
$this->testingFakeConnection->
schema()->
dropUniqueKey('faking_table', 'test_field'
);
// This function will not work due to a the fact that indexExist() does not search for keys without idx tag.
// @todo remove comments when: https://www.drupal.org/project/drupal/issues/3325358 is committed.
// $this->assertFalse($this->testingFakeConnection->schema()->indexExists('faking_table', 'test_field'));
} /**
* @covers ::addPrimaryKey
* @covers ::dropPrimaryKey
*/
public function testPrimaryKey(): void
{