Update DB\Pgsql

This commit is contained in:
Visman 2021-12-13 20:09:02 +07:00
parent c0994b1e1d
commit 2839c21416

View file

@ -189,13 +189,12 @@ class Pgsql
public function indexExists(string $table, string $index, bool $noPrefix = false): bool
{
$table = ($noPrefix ? '' : $this->dbPrefix) . $table;
$index = $table . '_' . ('PRIMARY' === $index ? 'pkey' : $index);
$vars = [
':schema' => 'public',
':tname' => $table,
':ttype' => 'r',
':iname' => $index,
':iname' => $table . '_' . ('PRIMARY' === $index ? 'pkey' : $index),
':itype' => 'i',
];
$query = 'SELECT 1
@ -525,7 +524,8 @@ class Pgsql
];
$query = 'SELECT table_name, column_name, data_type
FROM information_schema.columns
WHERE table_catalog = current_database() AND table_schema = ?s:schema AND table_name LIKE ?s:tname';
WHERE table_catalog = current_database() AND table_schema = ?s:schema AND table_name LIKE ?s:tname
ORDER BY table_name';
$stmt = $this->db->query($query, $vars);
$result = [];