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) {
|
function findDatabaseTableName($tableName) {
|
||||||
$table = DB::query("SHOW TABLES LIKE '$tableName'")->value();
|
$exist = DB::tableList();
|
||||||
if(!$table) {
|
if(!empty($exist)) {
|
||||||
$table = DB::query("SHOW TABLES LIKE '_obsolete_$tableName'")->value();
|
if(array_search($tableName, $exist) !== false) return $tableName;
|
||||||
|
$tableName = "_obsolete_$tableName";
|
||||||
if(!$table) echo '<strong>!! Could Not Find '.$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
|
* Create a EditableOption from a whatever type of multi
|
||||||
* form field it is coming from
|
* form field it is coming from
|
||||||
|
Loading…
Reference in New Issue
Block a user