-
Notifications
You must be signed in to change notification settings - Fork 22
/
2019_10_31_100142_create_user_table.php
41 lines (36 loc) · 1.23 KB
/
2019_10_31_100142_create_user_table.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;
class CreateUserTable extends Migration {
/**
* Run the migrations.
*/
public function up(): void {
Schema::create('user', function (Blueprint $table) {
$table->bigIncrements('user_id');
$table->string('username', 50);
$table->string('password', 100);
$table->string('nick_name', 50);
$table->string('real_name', 10);
$table->tinyInteger('sex');
$table->string('phone', 15);
$table->string('avatar', 100)->comment('头像');
$table->timestamp('last_login_at')->nullable();
$table->timestamp('created_at')->nullable();
$table->timestamp('updated_at')->nullable();
$table->string('remember_token', 100);
$table->tinyInteger('status')->default(1)->comment('0为禁用,1为正常');
//
$table->unique('username');
$table->unique('phone');
$table->index('status');
});
}
/**
* Reverse the migrations.
*/
public function down(): void {
Schema::dropIfExists('user');
}
}