2019_08_05_155050_create_users_table.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  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->bigIncrements('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_source', 20)->nullable()->comment('注册来源');
  26. $table->string('register_area_name', 20)->nullable()->comment('注册区域名称');
  27. $table->bigInteger('register_area', 20)->nullable()->comment('注册区域id');
  28. $table->tinyInteger('is_card_certified')->default(0)->comment('是否实名认证');
  29. $table->tinyInteger('is_deposi')->default(0)->comment('是否缴纳押金');
  30. $table->tinyInteger('is_match_ride_age')->default(0)->comment('是否到了骑车的年龄');
  31. $table->decimal('deposit_money', 15, 2)->default(0.00)->comment('押金');
  32. $table->decimal('recharge', 15, 2)->default(0.00)->comment('充值金额');
  33. $table->decimal('wallet_money', 15, 2)->default(0.00)->comment('余额');
  34. $table->integer('score')->default(0)->comment('积分');
  35. $table->float('my_journey')->default(0.00)->comment('my_journey');
  36. $table->tinyInteger('status')->default(1);
  37. $table->timestamps();
  38. });
  39. }
  40. /**
  41. * Reverse the migrations.
  42. *
  43. * @return void
  44. */
  45. public function down()
  46. {
  47. Schema::dropIfExists('user');
  48. }
  49. }