2019_05_08_160636_create_permissions_table.php 825 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. class CreatePermissionsTable extends Migration {
  5. /**
  6. * Run the migrations.
  7. *
  8. * @return void
  9. */
  10. public function up()
  11. {
  12. Schema::create('permissions', function(Blueprint $table)
  13. {
  14. $table->increments('id');
  15. $table->string('name', 191);
  16. $table->string('guard_name', 191);
  17. $table->string('display_name', 191);
  18. $table->string('route', 191)->nullable()->comment('路由名称');
  19. $table->integer('icon_id')->nullable()->comment('图标ID');
  20. $table->integer('parent_id')->default(0);
  21. $table->integer('sort')->default(0)->comment('排序');
  22. $table->timestamps();
  23. });
  24. }
  25. /**
  26. * Reverse the migrations.
  27. *
  28. * @return void
  29. */
  30. public function down()
  31. {
  32. Schema::drop('permissions');
  33. }
  34. }