mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
MINOR: look up tables through DB::tableList()
This commit is contained in:
parent
f0dbf7f917
commit
10bf22cb00
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user