| 123456789101112131415161718192021222324252627 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- return new class extends Migration {
- public function up(): void
- {
- if (Schema::hasTable('menu_badge_configs')) {
- return;
- }
- Schema::create('menu_badge_configs', function (Blueprint $table) {
- $table->id();
- $table->string('menu_text', 200)->comment('菜单文本');
- $table->json('badge_translations')->comment('角标 zh/en/vi');
- $table->unsignedInteger('sort')->default(0)->comment('展示顺序,越小越靠前');
- $table->unsignedTinyInteger('status')->default(1)->comment('0 禁用 1 启用');
- $table->timestamps();
- });
- }
- public function down(): void
- {
- Schema::dropIfExists('menu_badge_configs');
- }
- };
|