2017_05_30_203522_create_admin_users_table.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 CreateAdminUsersTable extends Migration
  10. {
  11. /**
  12. * Run the migrations.
  13. *
  14. * @return void
  15. */
  16. public function up()
  17. {
  18. Schema::create('admin_users', function (Blueprint $table) {
  19. $table->increments('id')->comment('用户ID');
  20. $table->string('name', 200)->comment('用户名')->nullable();
  21. $table->string('real_name', 200)->comment('实名')->nullable();
  22. $table->string('password', 255)->nullable()->comment('密码');
  23. $table->rememberToken();
  24. $table->string('email', 100)->comment('EMAIL')->nullable();
  25. $table->char('mobile', 11)->comment('手机号')->nullable();
  26. $table->string('avatar', 255)->comment('用户头像')->nullable();
  27. $table->tinyInteger('type')->comment('类型,0:用户,1:员工')->nullable();
  28. $table->dateTime('last_login_time')->nullable()->comment('最后一次登录时间');
  29. $table->tinyInteger('status')->default(1)->comment('状态,1启用0禁用')->nullable();
  30. $table->tinyInteger('is_root')->nullable()->comment('是否是超级管理员');
  31. $table->text('admin_role_id')->nullable()->comment('角色');
  32. $table->timestamps();
  33. $table->softDeletes();
  34. $table->index('deleted_at', 'idx_deleted_at');
  35. });
  36. }
  37. /**
  38. * Reverse the migrations.
  39. *
  40. * @return void
  41. */
  42. public function down()
  43. {
  44. Schema::dropIfExists('admin_users');
  45. }
  46. }