2021_08_11_143747_create_menus_table.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateMenusTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('menus', function (Blueprint $table) {
  15. $table->id();
  16. $table->integer('pid')->default(0);
  17. $table->string('name')->default('')->comment('名字');
  18. $table->string('path', 500)->default('')->comment('路径(URL)');
  19. $table->string('component', 500)->default('')->comment('vue文件路径');
  20. $table->string('redirect', 500)->default('')->comment('重定向');
  21. $table->text('meta')->comment('meta');
  22. $table->tinyInteger('hidden')->default(1)->comment('是否隐藏');
  23. $table->softDeletes();
  24. $table->timestamps();
  25. });
  26. }
  27. /**
  28. * Reverse the migrations.
  29. *
  30. * @return void
  31. */
  32. public function down()
  33. {
  34. Schema::dropIfExists('menus');
  35. }
  36. }