Merge pull request #8159 from jakedaleweb/fix_obsolete_naming

Fix obsolete naming
This commit is contained in:
Damian Mooyman 2018-06-18 17:18:47 +12:00 committed by GitHub
commit a3b1bf8154
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -454,16 +454,21 @@ MESSAGE
*/
public function dontRequireTable($table)
{
if (isset($this->tableList[strtolower($table)])) {
$suffix = '';
while (isset($this->tableList[strtolower("_obsolete_{$table}$suffix")])) {
$suffix = $suffix
? ((int)$suffix + 1)
: 2;
}
$this->renameTable($table, "_obsolete_{$table}$suffix");
$this->alterationMessage("Table $table: renamed to _obsolete_{$table}$suffix", "obsolete");
if (!isset($this->tableList[strtolower($table)])) {
return;
}
$prefix = "_obsolete_{$table}";
$suffix = '';
$renameTo = $prefix . $suffix;
while (isset($this->tableList[strtolower($renameTo)])) {
$suffix = $suffix
? ((int)$suffix + 1)
: 2;
$renameTo = $prefix . $suffix;
}
$renameFrom = $this->tableList[strtolower($table)];
$this->renameTable($renameFrom, $renameTo);
$this->alterationMessage("Table $table: renamed to $renameTo", "obsolete");
}
/**