44 lines
1.5 KiB
PHP
44 lines
1.5 KiB
PHP
<?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('username')->unique()->nullable()->comment('用户名');
|
||
$table->string('password')->nullable()->comment('密码');
|
||
$table->string('phone')->unique()->nullable()->comment('手机号');
|
||
$table->timestamp('phone_verified_at')->nullable()->comment('手机号认证时间');
|
||
$table->string('email')->unique()->nullable()->comment('邮箱');
|
||
$table->timestamp('email_verified_at')->nullable()->comment('邮箱认证时间');
|
||
$table->ipAddress('last_login_ip')->nullable()->comment('最近登录IP');
|
||
$table->timestamp('last_login_at')->nullable()->comment('最近登录时间');
|
||
$table->ipAddress('register_ip')->nullable()->comment('注册IP');
|
||
$table->tinyInteger('status')->default(1)->comment('状态: -1 冻结,0 未激活,1 已激活');
|
||
$table->string('status_remark')->nullable()->comment('状态备注');
|
||
$table->rememberToken();
|
||
$table->timestamps();
|
||
});
|
||
}
|
||
|
||
/**
|
||
* Reverse the migrations.
|
||
*
|
||
* @return void
|
||
*/
|
||
public function down()
|
||
{
|
||
Schema::dropIfExists('users');
|
||
}
|
||
}
|