<?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->integer('id')->primary()->unsigned()->comment('主键ID'); $table->string('name', 50)->comment('用户名')->default(''); $table->string('email', 100)->unique()->comment('邮箱')->default(''); $table->timestamp('email_verified_at')->nullable()->comment('邮箱校验时间'); $table->string('password', 255)->comment('密码')->default(''); $table->string('phone', 50)->comment('手机号码')->default(''); $table->rememberToken()->nullable(false)->comment('记住登陆token')->default(''); $table->tinyInteger('account_properties')->unsigned()->default(1)->comment('账号属性,1是个人,2是企业'); $table->tinyInteger('status')->default(1)->comment('状态,1是正常,-1是禁用'); $table->string('company_name', 100)->comment('公司名称')->default(''); $table->string('first_name', 100)->comment('名字')->default(''); $table->string('last_name', 100)->comment('姓氏')->default(''); $table->integer('created_time')->unsigned()->comment('创建时间')->default(0); $table->integer('update_time')->unsigned()->comment('更新时间')->default(0); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('users'); } }