2017_10_12_145017_create_user_access_table.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 CreateUserAccessTable extends Migration
  10. {
  11. /**
  12. * Run the migrations.
  13. *
  14. * @return void
  15. */
  16. public function up()
  17. {
  18. Schema::create('user_access', function (Blueprint $table) {
  19. $table->increments('id');
  20. $table->string('appid')->comment('app_id')->default(0);
  21. $table->integer('role_id')->comment('角色的ID');
  22. $table->integer('menu_id')->comment('菜单ID');
  23. $table->nullableTimestamps();
  24. $table->softDeletes();
  25. $table->index('role_id', 'idx_access_role_id');
  26. $table->index('deleted_at', 'idx_deleted_at');
  27. });
  28. }
  29. /**
  30. * Reverse the migrations.
  31. *
  32. * @return void
  33. */
  34. public function down()
  35. {
  36. Schema::dropIfExists('user_access');
  37. }
  38. }