mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
improve migrate searchbox log
This commit is contained in:
@@ -90,8 +90,8 @@ class Test extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$r = SearchBox::getSubCatOptions();
|
||||
dd($r);
|
||||
$columnInfo = NexusDB::getMysqlColumnInfo('searchbox', 'section_name');
|
||||
dd($columnInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -262,12 +262,16 @@ class Update extends Install
|
||||
$shouldMigrateSearchBox = false;
|
||||
if (!NexusDB::hasColumn('searchbox', 'section_name')) {
|
||||
$shouldMigrateSearchBox = true;
|
||||
$searchBoxLog = "no section_name field";
|
||||
} else {
|
||||
$columnInfo = NexusDB::getMysqlColumnInfo('searchbox', 'section_name');
|
||||
$searchBoxLog = "has section_name, searchbox.section DATA_TYPE: " . $columnInfo['DATA_TYPE'];
|
||||
if ($columnInfo['DATA_TYPE'] != 'json') {
|
||||
$searchBoxLog .= ", not json";
|
||||
$shouldMigrateSearchBox = true;
|
||||
}
|
||||
}
|
||||
$this->doLog("$searchBoxLog, shouldMigrateSearchBox: $shouldMigrateSearchBox");
|
||||
if ($shouldMigrateSearchBox) {
|
||||
$this->runMigrate('database/migrations/2022_09_05_230532_add_mode_to_section_related.php');
|
||||
$this->runMigrate('database/migrations/2022_09_06_004318_add_section_name_to_searchbox_table.php');
|
||||
|
||||
Reference in New Issue
Block a user