1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- class CreateUsersTable extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('users', function (Blueprint $table) {
- $table->id();
-
- $table->string('wx_openid')->nullable()->comment('微信用户openid')->unique();
- $table->string('wx_nickname')->nullable()->comment('用户昵称');
- $table->integer('wx_sex')->default(0)->comment('性别 1:男性,2:女性,0:未知')->index();
- $table->string('wx_province')->nullable()->comment('省份');
- $table->string('wx_city')->nullable()->comment('城市');
- $table->string('wx_country')->nullable()->comment('国家');
- $table->string('wx_headimgurl')->nullable()->comment('用户头像');
-
- $table->timestamps();
- $table->softDeletes();
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('users');
- }
- }
|