2026_11_05_120000_create_menu_badge_configs.php 887 B

123456789101112131415161718192021222324252627
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. return new class extends Migration {
  6. public function up(): void
  7. {
  8. if (Schema::hasTable('menu_badge_configs')) {
  9. return;
  10. }
  11. Schema::create('menu_badge_configs', function (Blueprint $table) {
  12. $table->id();
  13. $table->string('menu_text', 200)->comment('菜单文本');
  14. $table->json('badge_translations')->comment('角标 zh/en/vi');
  15. $table->unsignedInteger('sort')->default(0)->comment('展示顺序,越小越靠前');
  16. $table->unsignedTinyInteger('status')->default(1)->comment('0 禁用 1 启用');
  17. $table->timestamps();
  18. });
  19. }
  20. public function down(): void
  21. {
  22. Schema::dropIfExists('menu_badge_configs');
  23. }
  24. };