fix migrate searchbox

This commit is contained in:
xiaomlove
2022-10-28 23:30:24 +08:00
parent a61d1b0900
commit 6e76f6be54
2 changed files with 18 additions and 3 deletions

View File

@@ -259,7 +259,16 @@ class Update extends Install
/**
* @since 1.8.0
*/
$shouldMigrateSearchBox = false;
if (!NexusDB::hasColumn('searchbox', 'section_name')) {
$shouldMigrateSearchBox = true;
} else {
$columnInfo = NexusDB::getMysqlColumnInfo('searchbox', 'section_name');
if ($columnInfo['DATA_TYPE'] != 'json') {
$shouldMigrateSearchBox = true;
}
}
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');
$this->runMigrate('database/migrations/2022_09_06_030324_change_searchbox_field_extra_to_json.php');
@@ -267,6 +276,7 @@ class Update extends Install
$searchBoxRep->migrateToModeRelated();
$this->doLog("[MIGRATE_TAXONOMY_TO_MODE_RELATED]");
}
$this->removeMenu(['catmanage.php']);
}