Skip to content

Commit b893010

Browse files
committed
add tableBlacklist for unmanaged "phinxlog"
(exessive as `NOT LIKE` does not exist in `SHOW TABLES`)
1 parent d3f0c05 commit b893010

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

mysql2phinx.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,20 @@ function createMigration($mysqli, $indent = 2)
6363

6464
function getTables($mysqli)
6565
{
66-
$tables = $mysqli->query('SHOW TABLES')->fetch_all();
67-
return array_column($tables, 0);
66+
$res = $mysqli->query('SHOW TABLES');
67+
$blacklist = array(
68+
'phinxlog',
69+
);
70+
$buff = array_map(function ($a) {
71+
return $a[0];
72+
}, $res->fetch_all());
73+
$newbuff = array();
74+
foreach ($buff as $k => $t) {
75+
if (in_array($t, $blacklist))
76+
continue;
77+
$newbuff[] = $t;
78+
}
79+
return $newbuff;
6880
}
6981

7082
function getTableMigration($table, $mysqli, $indent)

0 commit comments

Comments
 (0)