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