|
@@ -21,8 +21,7 @@ discard block |
|
|
block discarded – undo |
|
21
|
21
|
$tables = []; |
|
22
|
22
|
foreach ($this->driver->rows($fast && $this->driver->minVersion(5) ? |
|
23
|
23
|
"SELECT TABLE_NAME AS Name, ENGINE AS Engine, TABLE_COMMENT AS Comment FROM information_schema.TABLES " . |
|
24
|
|
- "WHERE TABLE_SCHEMA = DATABASE() " . ($table != "" ? "AND TABLE_NAME = " . $this->driver->quote($table) : "ORDER BY Name") : |
|
25
|
|
- "SHOW TABLE STATUS" . ($table != "" ? " LIKE " . $this->driver->quote(addcslashes($table, "%_\\")) : "") |
|
|
24
|
+ "WHERE TABLE_SCHEMA = DATABASE() " . ($table != "" ? "AND TABLE_NAME = " . $this->driver->quote($table) : "ORDER BY Name") : "SHOW TABLE STATUS" . ($table != "" ? " LIKE " . $this->driver->quote(addcslashes($table, "%_\\")) : "") |
|
26
|
25
|
) as $row) { |
|
27
|
26
|
$status = new TableEntity($row['Name']); |
|
28
|
27
|
$status->engine = $row['Engine']; |
|
@@ -108,8 +107,7 @@ discard block |
|
|
block discarded – undo |
|
108
|
107
|
$index = new IndexEntity(); |
|
109
|
108
|
|
|
110
|
109
|
$name = $row["Key_name"]; |
|
111
|
|
- $index->type = ($name == "PRIMARY" ? "PRIMARY" : |
|
112
|
|
- ($row["Index_type"] == "FULLTEXT" ? "FULLTEXT" : ($row["Non_unique"] ? |
|
|
110
|
+ $index->type = ($name == "PRIMARY" ? "PRIMARY" : ($row["Index_type"] == "FULLTEXT" ? "FULLTEXT" : ($row["Non_unique"] ? |
|
113
|
111
|
($row["Index_type"] == "SPATIAL" ? "SPATIAL" : "INDEX") : "UNIQUE"))); |
|
114
|
112
|
$index->columns[] = $row["Column_name"]; |
|
115
|
113
|
$index->lengths[] = ($row["Index_type"] == "SPATIAL" ? null : $row["Sub_part"]); |
|
@@ -149,10 +147,10 @@ discard block |
|
|
block discarded – undo |
|
149
|
147
|
|
|
150
|
148
|
$foreignKey->database = $this->driver->unescapeId($match4 != "" ? $match3 : $match4); |
|
151
|
149
|
$foreignKey->table = $this->driver->unescapeId($match4 != "" ? $match4 : $match3); |
|
152
|
|
- $foreignKey->source = array_map(function ($idf) { |
|
|
150
|
+ $foreignKey->source = array_map(function($idf) { |
|
153
|
151
|
return $this->driver->unescapeId($idf); |
|
154
|
152
|
}, $source[0]); |
|
155
|
|
- $foreignKey->target = array_map(function ($idf) { |
|
|
153
|
+ $foreignKey->target = array_map(function($idf) { |
|
156
|
154
|
return $this->driver->unescapeId($idf); |
|
157
|
155
|
}, $target[0]); |
|
158
|
156
|
$foreignKey->onDelete = $matchCount > 6 ? $match[6] : "RESTRICT"; |