Update DB\Mysql
This commit is contained in:
parent
2839c21416
commit
04f5906281
1 changed files with 4 additions and 4 deletions
|
@ -175,11 +175,10 @@ class Mysql
|
|||
public function indexExists(string $table, string $index, bool $noPrefix = false): bool
|
||||
{
|
||||
$table = ($noPrefix ? '' : $this->dbPrefix) . $table;
|
||||
$index = 'PRIMARY' == $index ? $index : $table . '_' . $index;
|
||||
|
||||
$vars = [
|
||||
':tname' => $table,
|
||||
':index' => $index,
|
||||
':index' => 'PRIMARY' == $index ? $index : $table . '_' . $index,
|
||||
];
|
||||
$query = 'SELECT 1
|
||||
FROM INFORMATION_SCHEMA.STATISTICS
|
||||
|
@ -567,11 +566,12 @@ class Mysql
|
|||
public function getMap(): array
|
||||
{
|
||||
$vars = [
|
||||
str_replace('_', '\\_', $this->dbPrefix) . '%',
|
||||
':tname' => str_replace('_', '\\_', $this->dbPrefix) . '%',
|
||||
];
|
||||
$query = 'SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME LIKE ?s';
|
||||
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME LIKE ?s:tname
|
||||
ORDER BY TABLE_NAME';
|
||||
|
||||
$stmt = $this->db->query($query, $vars);
|
||||
$result = [];
|
||||
|
|
Loading…
Add table
Reference in a new issue