2017_05_30_203521_create_admin_roles_table.php 1.2 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 CreateAdminRolesTable extends Migration
  10. {
  11. /**
  12. * Run the migrations.
  13. *
  14. * @return void
  15. */
  16. public function up()
  17. {
  18. Schema::create('admin_roles', function (Blueprint $table) {
  19. $table->increments('id');
  20. $table->char('name', 20)->comment('角色名称');
  21. $table->string('mark', 255)->comment('备注');
  22. $table->integer('status')->default(1)->comment('是否禁用');
  23. $table->smallInteger('level')->comment('用户组等级,低等级的不能对高等级的用户做修改');
  24. $table->char('department_id', 32)->comment('部门ID');
  25. $table->timestamps();
  26. $table->softDeletes();
  27. $table->index('deleted_at', 'idx_deleted_at');
  28. });
  29. }
  30. /**
  31. * Reverse the migrations.
  32. *
  33. * @return void
  34. */
  35. public function down()
  36. {
  37. Schema::dropIfExists('admin_roles');
  38. }
  39. }