@@ -18,9 +18,7 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | protected function limitToOne(string $table, string $query, string $where) |
| 20 | 20 | { |
| 21 | - return (preg_match('~^INTO~', $query) ? $this->driver->limit($query, $where, 1, 0) : |
|
| 22 | - " $query" . ($this->driver->isView($this->driver->tableStatusOrName($table)) ? $where : |
|
| 23 | - " WHERE ctid = (SELECT ctid FROM " . $this->driver->table($table) . $where . ' LIMIT 1)')); |
|
| 21 | + return (preg_match('~^INTO~', $query) ? $this->driver->limit($query, $where, 1, 0) : " $query" . ($this->driver->isView($this->driver->tableStatusOrName($table)) ? $where : " WHERE ctid = (SELECT ctid FROM " . $this->driver->table($table) . $where . ' LIMIT 1)')); |
|
| 24 | 22 | } |
| 25 | 23 | |
| 26 | 24 | /** |
@@ -82,8 +82,7 @@ discard block |
||
| 82 | 82 | if ($val[0] != 'INDEX') { |
| 83 | 83 | //! descending UNIQUE indexes results in syntax error |
| 84 | 84 | $create[] = ( |
| 85 | - $val[2] == 'DROP' ? "\nDROP CONSTRAINT " . $this->driver->escapeId($val[1]) : |
|
| 86 | - "\nADD" . ($val[1] != '' ? ' CONSTRAINT ' . $this->driver->escapeId($val[1]) : '') . |
|
| 85 | + $val[2] == 'DROP' ? "\nDROP CONSTRAINT " . $this->driver->escapeId($val[1]) : "\nADD" . ($val[1] != '' ? ' CONSTRAINT ' . $this->driver->escapeId($val[1]) : '') . |
|
| 87 | 86 | " $val[0] " . ($val[0] == 'PRIMARY' ? 'KEY ' : '') . '(' . implode(', ', $val[2]) . ')' |
| 88 | 87 | ); |
| 89 | 88 | } elseif ($val[2] == 'DROP') { |
@@ -196,7 +195,7 @@ discard block |
||
| 196 | 195 | */ |
| 197 | 196 | public function truncateTables(array $tables) |
| 198 | 197 | { |
| 199 | - $this->driver->execute('TRUNCATE ' . implode(', ', array_map(function ($table) { |
|
| 198 | + $this->driver->execute('TRUNCATE ' . implode(', ', array_map(function($table) { |
|
| 200 | 199 | return $this->driver->table($table); |
| 201 | 200 | }, $tables))); |
| 202 | 201 | return true; |