Laravel_api/database/migrations/2014_10_12_000000_create_us...

36 lines
951 B
PHP
Raw Permalink Normal View History

2019-03-01 14:08:34 +08:00
<?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) {
2019-03-01 14:50:28 +08:00
$table->increments('id')->comment('主键ID');
$table->string('name',12)->unique()->comment('用户名称');
$table->string('password',80)->comment('密码');
$table->text('last_token')->nullable()->comment('登陆时的token');
$table->tinyInteger('status')->default(0)->comment('用户状态 -1代表已删除 0代表正常 1代表冻结');
2019-03-01 14:08:34 +08:00
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}