2017_07_11_225347_create_oauth_users_table.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. class CreateOauthUsersTable extends Migration {
  5. /**
  6. * Run the migrations.
  7. *
  8. * @return void
  9. */
  10. public function up()
  11. {
  12. Schema::create('oauth_users', function(Blueprint $table)
  13. {
  14. $table->increments('id')->comment('主键id');
  15. $table->boolean('type')->default(1)->comment('类型 1:QQ 2:新浪微博 3:github');
  16. $table->string('name', 30)->default('')->comment('第三方昵称');
  17. $table->string('avatar')->default('')->comment('头像');
  18. $table->string('openid', 40)->default('')->comment('第三方用户id');
  19. $table->string('access_token')->default('')->comment('access_token token');
  20. $table->string('last_login_ip', 16)->default('')->comment('最后登录ip');
  21. $table->integer('login_times')->unsigned()->default(0)->comment('登录次数');
  22. $table->string('email')->default('')->comment('邮箱');
  23. $table->boolean('is_admin')->default(0)->comment('是否是admin');
  24. $table->timestamps();
  25. $table->softDeletes();
  26. });
  27. }
  28. /**
  29. * Reverse the migrations.
  30. *
  31. * @return void
  32. */
  33. public function down()
  34. {
  35. Schema::dropIfExists('oauth_users');
  36. }
  37. }