perf: 优化国际化语言

This commit is contained in:
kuaifan
2024-11-05 22:43:58 +08:00
parent ef2230a331
commit c46fd080df
11 changed files with 133 additions and 33 deletions

View File

@@ -0,0 +1,35 @@
<?php
use App\Models\User;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddUsersLang extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
if (!Schema::hasColumn('users', 'lang')) {
$table->string('lang', 20)->nullable()->default('')->after('bot')->comment('语言首选项');
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn("lang");
});
}
}