MINOR: look up tables through DB::tableList()

This commit is contained in:
Andreas Piening 2010-01-27 03:04:37 +00:00
parent f0dbf7f917
commit 10bf22cb00

View File

@ -191,14 +191,16 @@ class UserFormsMigrationTask extends MigrationTask {
*
*/
function findDatabaseTableName($tableName) {
$table = DB::query("SHOW TABLES LIKE '$tableName'")->value();
if(!$table) {
$table = DB::query("SHOW TABLES LIKE '_obsolete_$tableName'")->value();
if(!$table) echo '<strong>!! Could Not Find '.$tableName;
$exist = DB::tableList();
if(!empty($exist)) {
if(array_search($tableName, $exist) !== false) return $tableName;
$tableName = "_obsolete_$tableName";
if(array_search($tableName, $exist) !== false) return $tableName;
}
return $table;
echo '<strong>!! Could Not Find '.$tableName;
return;
}
/**
* Create a EditableOption from a whatever type of multi
* form field it is coming from