2014_10_12_000000_create_users_table.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateUsersTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('users', function (Blueprint $table) {
  15. $table->id();
  16. $table->string('nickname', 100)->nullable()->comment('昵称');
  17. $table->string('truename', 20)->nullable()->comment('真实姓名');
  18. $table->char('card_id', 20)->nullable()->comment('身份证号');
  19. $table->string('avatar')->nullable()->comment('头像');
  20. $table->tinyInteger('gender')->default(0)->comment('性别(1:男;2:女;0:未知)');
  21. $table->char('mobile', 12)->nullable()->comment('手机号');
  22. $table->string('country', 20)->nullable()->comment('国家');
  23. $table->string('province', 10)->nullable()->comment('省份');
  24. $table->string('city', 10)->nullable()->comment('城市');
  25. $table->string('register_shop_id', 20)->nullable()->comment('注册来源站点');
  26. $table->string('register_device_id', 20)->nullable()->comment('注册来源站点');
  27. $table->bigInteger('pid')->default(0)->comment('推荐用户');
  28. $table->decimal('wallet_money', 15, 2)->default(0.00)->comment('余额');
  29. $table->integer('score')->default(0)->comment('积分');
  30. $table->tinyInteger('status')->default(1);
  31. $table->rememberToken();
  32. $table->timestamps();
  33. });
  34. }
  35. /**
  36. * Reverse the migrations.
  37. *
  38. * @return void
  39. */
  40. public function down()
  41. {
  42. Schema::dropIfExists('users');
  43. }
  44. }