sifangpay/database/migrations/2018_12_22_163326_create_us...

51 lines
1.9 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->integer('merchant_id')->default(0)->comment('服务商id,0表示本站');
$table->integer('from_user_id')->default(0)->comment('外站来源uid');
$table->string('nickname', 120)->comment('昵称');
$table->string('mobile', 11)->nullable()->comment('手机');
$table->string('email', 120)->nullable()->comment('邮箱');
$table->string('alipay_account', 220)->nullable()->comment('支付宝账号手机/邮箱');
$table->string('weixin_account', 220)->nullable()->comment('微信账号openid');
$table->string('password')->nullable()->comment('密码');
$table->tinyInteger('login_status')->default(1)->comment('登陆状态:1启用0禁用');
$table->integer('last_number')->default(0)->comment('登陆次数');
$table->string('ip', 60)->default('')->comment('登陆IP');
$table->string('host',200)->nullable()->comment('来源域名');
$table->string('from_ip',200)->nullable()->comment('注册IP');
$table->dateTime('last_time')->nullable()->comment('最后登陆时间');
$table->string('remember_token',120)->nullable()->comment('记录登陆');
$table->timestamps();
$table->softDeletes();//软删除
$table->index('merchant_id');
$table->index('nickname');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}