diff --git a/app/Console/Commands/Install/InitData.php b/app/Console/Commands/Install/InitData.php deleted file mode 100644 index 6fd72cab..00000000 --- a/app/Console/Commands/Install/InitData.php +++ /dev/null @@ -1,47 +0,0 @@ -call('db:seed'); - }); - $this->info("[INIT DATA] success."); - return 0; - } -} diff --git a/app/Console/Commands/Install/Migrate.php b/app/Console/Commands/Install/Migrate.php deleted file mode 100644 index a76de7c8..00000000 --- a/app/Console/Commands/Install/Migrate.php +++ /dev/null @@ -1,47 +0,0 @@ -call('migrate'); - }); - $this->info("[MIGRATE TABLE] success."); - return 0; - } -} diff --git a/database/migrations/2021_06_08_113437_create_posts_table.php b/database/migrations/2021_06_08_113437_create_posts_table.php index 3af9bfb5..6cfd5c9c 100644 --- a/database/migrations/2021_06_08_113437_create_posts_table.php +++ b/database/migrations/2021_06_08_113437_create_posts_table.php @@ -21,12 +21,13 @@ class CreatePostsTable extends Migration $table->unsignedMediumInteger('topicid')->default(0); $table->unsignedMediumInteger('userid')->default(0)->index('userid'); $table->dateTime('added')->nullable()->index('added'); - $table->text('body')->nullable()->index('body'); + $table->text('body')->nullable(); $table->text('ori_body')->nullable(); $table->unsignedMediumInteger('editedby')->default(0); $table->dateTime('editdate')->nullable(); $table->index(['topicid', 'id'], 'topicid_id'); }); + \Illuminate\Support\Facades\DB::statement('alter table posts add fulltext body(body)'); } /** diff --git a/database/migrations/2021_06_08_113437_create_torrents_custom_field_values_table.php b/database/migrations/2021_06_08_113437_create_torrents_custom_field_values_table.php index 6e91e999..bd10d4f7 100644 --- a/database/migrations/2021_06_08_113437_create_torrents_custom_field_values_table.php +++ b/database/migrations/2021_06_08_113437_create_torrents_custom_field_values_table.php @@ -20,10 +20,11 @@ class CreateTorrentsCustomFieldValuesTable extends Migration $table->integer('id', true); $table->integer('torrent_id')->default(0)->index('idx_torrent_id'); $table->integer('custom_field_id')->default(0)->index('idx_field_id'); - $table->mediumText('custom_field_value')->nullable()->index('idx_field_value'); + $table->mediumText('custom_field_value')->nullable(); $table->dateTime('created_at'); $table->dateTime('updated_at'); }); + \Illuminate\Support\Facades\DB::statement('alter table torrents_custom_field_values add index(custom_field_value(191))'); } /** diff --git a/database/migrations/2021_06_08_113437_create_torrents_table.php b/database/migrations/2021_06_08_113437_create_torrents_table.php index f23dc5d9..4cf180fc 100644 --- a/database/migrations/2021_06_08_113437_create_torrents_table.php +++ b/database/migrations/2021_06_08_113437_create_torrents_table.php @@ -18,7 +18,6 @@ class CreateTorrentsTable extends Migration } Schema::create('torrents', function (Blueprint $table) { $table->mediumIncrements('id'); - $table->binary('info_hash')->unique('info_hash'); $table->string('name')->default('')->index('name'); $table->string('filename')->default(''); $table->string('save_as')->default(''); @@ -65,6 +64,8 @@ class CreateTorrentsTable extends Migration $table->index(['category', 'visible', 'banned'], 'category_visible_banned'); $table->index(['visible', 'banned', 'pos_state', 'id'], 'visible_banned_pos_id'); }); + $sql = 'alter table torrents add column `info_hash` binary(20) NOT NULL after id, add unique info_hash(`info_hash`)'; + \Illuminate\Support\Facades\DB::statement($sql); } /** diff --git a/nexus/Install/install/install.php b/nexus/Install/install/install.php index 514e8c63..162a3df2 100644 --- a/nexus/Install/install/install.php +++ b/nexus/Install/install/install.php @@ -64,7 +64,7 @@ if ($currentStep == 3) { if (!WITH_LARAVEL) { throw new \RuntimeException('Laravel is not avaliable.'); } - $command = "php " . ROOT_PATH . "artisan install:migrate"; + $command = "php " . ROOT_PATH . "artisan migrate"; $result = exec($command, $output, $result_code); $install->doLog(sprintf('command: %s, result_code: %s, result: %s', $command, $result_code, $result)); $install->doLog("output: " . json_encode($output)); @@ -127,7 +127,7 @@ if ($currentStep == 4) { $install->saveSettings($settings); // $install->importInitialData(); //use seed - $command = "php " . ROOT_PATH . "artisan install:init_data"; + $command = "php " . ROOT_PATH . "artisan db:seed"; $result = exec($command, $output, $result_code); $install->doLog(sprintf('command: %s, result_code: %s, result: %s', $command, $result_code, $result)); $install->doLog("output: " . json_encode($output)); diff --git a/nexus/Install/update/update.php b/nexus/Install/update/update.php index 2541884e..0f933abf 100644 --- a/nexus/Install/update/update.php +++ b/nexus/Install/update/update.php @@ -91,7 +91,7 @@ if ($currentStep == 3) { while ($isPost) { try { sql_query('SET sql_mode=(SELECT REPLACE(@@sql_mode,"NO_ZERO_DATE", ""))'); - $command = "php " . ROOT_PATH . "artisan install:migrate"; + $command = "php " . ROOT_PATH . "artisan migrate"; $result = exec($command, $output, $result_code); $update->doLog(sprintf('command: %s, result_code: %s, result: %s', $command, $result_code, $result)); $update->doLog("output: " . json_encode($output));