|
@@ -25,8 +25,7 @@ discard block |
|
|
block discarded – undo |
|
25
|
25
|
$query = ($fast && $this->driver->minVersion(5)) ? |
|
26
|
26
|
"SELECT TABLE_NAME AS Name, ENGINE AS Engine, TABLE_COMMENT AS Comment " . |
|
27
|
27
|
"FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() " . |
|
28
|
|
- ($table != "" ? "AND TABLE_NAME = " . $this->driver->quote($table) : "ORDER BY Name") : |
|
29
|
|
- "SHOW TABLE STATUS" . ($table != "" ? " LIKE " . $this->driver->quote(addcslashes($table, "%_\\")) : ""); |
|
|
28
|
+ ($table != "" ? "AND TABLE_NAME = " . $this->driver->quote($table) : "ORDER BY Name") : "SHOW TABLE STATUS" . ($table != "" ? " LIKE " . $this->driver->quote(addcslashes($table, "%_\\")) : ""); |
|
30
|
29
|
return $this->driver->rows($query); |
|
31
|
30
|
} |
|
32
|
31
|
|
|
@@ -177,8 +176,7 @@ discard block |
|
|
block discarded – undo |
|
177
|
176
|
$index = new IndexEntity(); |
|
178
|
177
|
|
|
179
|
178
|
$name = $row["Key_name"]; |
|
180
|
|
- $index->type = ($name == "PRIMARY" ? "PRIMARY" : |
|
181
|
|
- ($row["Index_type"] == "FULLTEXT" ? "FULLTEXT" : ($row["Non_unique"] ? |
|
|
179
|
+ $index->type = ($name == "PRIMARY" ? "PRIMARY" : ($row["Index_type"] == "FULLTEXT" ? "FULLTEXT" : ($row["Non_unique"] ? |
|
182
|
180
|
($row["Index_type"] == "SPATIAL" ? "SPATIAL" : "INDEX") : "UNIQUE"))); |
|
183
|
181
|
$index->columns[] = $row["Column_name"]; |
|
184
|
182
|
$index->lengths[] = ($row["Index_type"] == "SPATIAL" ? null : $row["Sub_part"]); |
|
@@ -213,10 +211,10 @@ discard block |
|
|
block discarded – undo |
|
213
|
211
|
|
|
214
|
212
|
$foreignKey->database = $this->driver->unescapeId($match[4] != "" ? $match[3] : $match[4]); |
|
215
|
213
|
$foreignKey->table = $this->driver->unescapeId($match[4] != "" ? $match[4] : $match[3]); |
|
216
|
|
- $foreignKey->source = array_map(function ($idf) { |
|
|
214
|
+ $foreignKey->source = array_map(function($idf) { |
|
217
|
215
|
return $this->driver->unescapeId($idf); |
|
218
|
216
|
}, $source[0]); |
|
219
|
|
- $foreignKey->target = array_map(function ($idf) { |
|
|
217
|
+ $foreignKey->target = array_map(function($idf) { |
|
220
|
218
|
return $this->driver->unescapeId($idf); |
|
221
|
219
|
}, $target[0]); |
|
222
|
220
|
$foreignKey->onDelete = $match[6] ?: "RESTRICT"; |