2017_05_30_203519_create_admin_access_table.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. /**
  6. * Migration auto-generated by Sequel Pro Laravel Export
  7. * @see https://github.com/cviebrock/sequel-pro-laravel-export
  8. */
  9. class CreateAdminAccessTable extends Migration
  10. {
  11. /**
  12. * Run the migrations.
  13. *
  14. * @return void
  15. */
  16. public function up()
  17. {
  18. Schema::create('admin_access', function (Blueprint $table) {
  19. $table->increments('id');
  20. $table->integer('role_id')->comment('角色的ID');
  21. $table->integer('menu_id')->comment('菜单ID');
  22. $table->timestamps();
  23. $table->softDeletes();
  24. $table->index('role_id', 'idx_access_role_id');
  25. $table->index('deleted_at', 'idx_deleted_at');
  26. });
  27. }
  28. /**
  29. * Reverse the migrations.
  30. *
  31. * @return void
  32. */
  33. public function down()
  34. {
  35. Schema::dropIfExists('admin_access');
  36. }
  37. }