2015_10_14_202058_create_user_data_table.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateUserDataTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('user_data', function (Blueprint $table) {
  15. $table->integer('user_id')->unsigned()->primary(); //用户UID
  16. $table->integer('coins')->unsigned()->default(0); //金币数
  17. $table->integer('credits')->unsigned()->default(0); //经验值
  18. $table->timestamp('registered_at')->nullable(); //注册时间
  19. $table->timestamp('last_visit')->nullable(); //上次访问时间
  20. $table->string('last_login_ip')->nullable(); //上次登录IP
  21. $table->integer('questions')->unsigned()->default(0); //提问数
  22. $table->integer('articles')->unsigned()->default(0); //文章数
  23. $table->integer('answers')->unsigned()->default(0); //回答数
  24. $table->integer('adoptions')->unsigned()->default(0); //被采纳个数
  25. $table->integer('supports')->unsigned()->default(0); //赞同数
  26. $table->integer('followers')->unsigned()->default(0); //关注数
  27. $table->integer('views')->unsigned()->default(0);
  28. $table->unsignedTinyInteger('email_status')->default(0);
  29. $table->unsignedTinyInteger('mobile_status')->default(0);
  30. $table->unsignedTinyInteger('authentication_status')->default(0); //行家认证状态
  31. });
  32. }
  33. /**
  34. * Reverse the migrations.
  35. *
  36. * @return void
  37. */
  38. public function down()
  39. {
  40. Schema::drop('user_data');
  41. }
  42. }