2024_08_29_032939_create_system_menus_table.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. /**
  7. * Run the migrations.
  8. */
  9. public function up(): void
  10. {
  11. Schema::create('system_menus', function (Blueprint $table) {
  12. $table->bigIncrements('id'); // permission id
  13. $table->string('name', 50)->comment('菜单名称');
  14. $table->tinyInteger('type')->comment('菜单类型');
  15. $table->string('permission', 255)->nullable()->comment('权限标识');
  16. $table->integer('sort')->default(0)->comment('显示顺序');
  17. $table->bigInteger('parent_id')->default(0)->comment('父菜单ID');
  18. $table->string('path', 200)->nullable()->comment('路由地址');
  19. $table->string('icon', 100)->nullable()->comment('菜单图标');
  20. $table->string('component')->nullable()->comment('组件路径');
  21. $table->string('component_name')->nullable()->comment('组件名');
  22. $table->tinyInteger('status')->default(0)->comment('菜单状态');
  23. $table->tinyInteger('visible')->default(1)->comment('是否可见');
  24. $table->tinyInteger('keep_alive')->default(1)->comment('是否缓存');
  25. $table->tinyInteger('always_show')->default(1)->comment('是否总是显示');
  26. $table->string('creator', 64)->nullable()->comment('创建者');
  27. $table->string('updater', 64)->nullable()->comment('更新者');
  28. $table->timestamps();
  29. });
  30. }
  31. /**
  32. * Reverse the migrations.
  33. */
  34. public function down(): void
  35. {
  36. Schema::dropIfExists('system_menus');
  37. }
  38. };