tag and installer&updater use english

This commit is contained in:
xiaomlove
2022-03-08 15:08:56 +08:00
parent a56891132d
commit 718a57539d
67 changed files with 1149 additions and 104 deletions

View File

@@ -14,7 +14,9 @@ class AddTotalDaysToAttendanceTable extends Migration
public function up()
{
Schema::table('attendance', function (Blueprint $table) {
$table->integer('total_days')->default(0);
if (!Schema::hasColumn('attendance', 'total_days')) {
$table->integer('total_days')->default(0);
}
});
}

View File

@@ -14,7 +14,9 @@ class AddHrToTorrentsTable extends Migration
public function up()
{
Schema::table('torrents', function (Blueprint $table) {
$table->tinyInteger('hr')->default(0);
if (!Schema::hasColumn('torrents', 'hr')) {
$table->tinyInteger('hr')->default(0);
}
});
}

View File

@@ -14,7 +14,9 @@ class AddSeedPointsToUsersTable extends Migration
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->decimal('seed_points', 20, 1)->default(0);
if (!Schema::hasColumn('users', 'seed_points')) {
$table->decimal('seed_points', 20, 1)->default(0);
}
});
}

View File

@@ -14,7 +14,9 @@ class AddIdToAgentAllowedExceptionTable extends Migration
public function up()
{
Schema::table('agent_allowed_exception', function (Blueprint $table) {
$table->increments('id');
if (!Schema::hasColumn('agent_allowed_exception', 'id')) {
$table->increments('id');
}
});
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTagsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tags', function (Blueprint $table) {
$table->id();
$table->string('name')->unique();
$table->string('color');
$table->integer('priority')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('tags');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTorrentTagsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('torrent_tags', function (Blueprint $table) {
$table->id();
$table->integer('torrent_id');
$table->integer('tag_id')->index();
$table->timestamps();
$table->unique(['torrent_id', 'tag_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('torrent_tags');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddIconIdToCategoriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('categories', function (Blueprint $table) {
if (!Schema::hasColumn('categories', 'icon_id')) {
$table->integer('icon_id')->default(0);
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('categories', function (Blueprint $table) {
$table->dropColumn('icon_id');
});
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddInviteeFieldsToInvitesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (Schema::hasColumn('invites', 'valid')) {
return;
}
Schema::table('invites', function (Blueprint $table) {
$table->tinyInteger('valid')->default(1);
$table->integer('invitee_register_uid')->nullable();
$table->string('invitee_register_email')->nullable();
$table->string('invitee_register_username')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('invites', function (Blueprint $table) {
$table->dropColumn(['valid', 'invitee_register_uid', 'invitee_register_email', 'invitee_register_username']);
});
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddCustomFieldsToSearchboxTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (Schema::hasColumn('searchbox', 'custom_fields')) {
return;
}
Schema::table('searchbox', function (Blueprint $table) {
$table->text('custom_fields')->nullable();
$table->string('custom_fields_display_name')->nullable();
$table->text('custom_fields_display')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('searchbox', function (Blueprint $table) {
$table->dropColumn(['custom_fields', 'custom_fields_display_name', 'custom_fields_display']);
});
}
}

View File

@@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddPtGenTagsTechnicalInfoToTorrentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('torrents', function (Blueprint $table) {
if (!Schema::hasColumn('torrents', 'pt_gen')) {
$table->mediumText('pt_gen')->nullable();
}
if (!Schema::hasColumn('torrents', 'tags')) {
$table->integer('tags')->default(0);
}
if (!Schema::hasColumn('torrents', 'technical_info')) {
$table->text('technical_info')->nullable();
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('torrents', function (Blueprint $table) {
$table->dropColumn(['pt_gen', 'tags', 'technical_info']);
});
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddPageToUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
if (!Schema::hasColumn('users', 'page')) {
$table->string('page')->nullable();
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('page');
});
}
}