2016_06_27_163138_create_user_oauth_table.php 961 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateUserOauthTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('user_oauth', function (Blueprint $table) {
  15. $table->string("id",64)->primary();
  16. $table->char("auth_type",64);
  17. $table->char("nickname",64);
  18. $table->char("avatar",255);
  19. $table->integer('user_id')->index()->default(0); //用户UID
  20. $table->string("access_token",64);
  21. $table->string("refresh_token",64)->nullable();
  22. $table->integer("expires_in");
  23. $table->timestamps();
  24. });
  25. }
  26. /**
  27. * Reverse the migrations.
  28. *
  29. * @return void
  30. */
  31. public function down()
  32. {
  33. Schema::drop('user_oauth');
  34. }
  35. }