mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 20:17:24 +08:00
fix migrate searchbox
This commit is contained in:
@@ -12,14 +12,14 @@ class NexusUpdate extends Command
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $signature = 'nexus:update {--tag=} {--keep_tmp} {--include_composer}';
|
protected $signature = 'nexus:update {--tag=} {--branch=} {--keep_tmp} {--include_composer}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $description = 'Update nexusphp after code updated, remember run `composer update` first. Options: --tag=, --keep_tmp, --include_composer';
|
protected $description = 'Update nexusphp after code updated, remember run `composer update` first. Options: --tag=, --branch, --keep_tmp, --include_composer';
|
||||||
|
|
||||||
private $update;
|
private $update;
|
||||||
|
|
||||||
@@ -44,6 +44,7 @@ class NexusUpdate extends Command
|
|||||||
define('WITH_LARAVEL', true);
|
define('WITH_LARAVEL', true);
|
||||||
require ROOT_PATH . 'nexus/Database/helpers.php';
|
require ROOT_PATH . 'nexus/Database/helpers.php';
|
||||||
$tag = $this->option('tag');
|
$tag = $this->option('tag');
|
||||||
|
$branch = $this->option('branch');
|
||||||
$keepTmp = $this->option('keep_tmp');
|
$keepTmp = $this->option('keep_tmp');
|
||||||
$includeComposer = $this->option('include_composer');
|
$includeComposer = $this->option('include_composer');
|
||||||
$includes = [];
|
$includes = [];
|
||||||
@@ -68,7 +69,11 @@ class NexusUpdate extends Command
|
|||||||
//Download
|
//Download
|
||||||
if ($tag !== null) {
|
if ($tag !== null) {
|
||||||
if ($tag === 'dev') {
|
if ($tag === 'dev') {
|
||||||
$url = "https://github.com/xiaomlove/nexusphp/archive/refs/heads/php8.zip";
|
if ($branch) {
|
||||||
|
$url = "https://github.com/xiaomlove/nexusphp/archive/refs/heads/{$branch}.zip";
|
||||||
|
} else {
|
||||||
|
$url = "https://github.com/xiaomlove/nexusphp/archive/refs/heads/php8.zip";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!str_starts_with($tag, 'v')) {
|
if (!str_starts_with($tag, 'v')) {
|
||||||
$tag = "v$tag";
|
$tag = "v$tag";
|
||||||
|
|||||||
@@ -259,7 +259,16 @@ class Update extends Install
|
|||||||
/**
|
/**
|
||||||
* @since 1.8.0
|
* @since 1.8.0
|
||||||
*/
|
*/
|
||||||
|
$shouldMigrateSearchBox = false;
|
||||||
if (!NexusDB::hasColumn('searchbox', 'section_name')) {
|
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_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');
|
||||||
$this->runMigrate('database/migrations/2022_09_06_030324_change_searchbox_field_extra_to_json.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();
|
$searchBoxRep->migrateToModeRelated();
|
||||||
$this->doLog("[MIGRATE_TAXONOMY_TO_MODE_RELATED]");
|
$this->doLog("[MIGRATE_TAXONOMY_TO_MODE_RELATED]");
|
||||||
}
|
}
|
||||||
|
$this->removeMenu(['catmanage.php']);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user