add user manager and auth for backend
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Hyperf\Database\Schema\Schema;
|
||||
use Hyperf\Database\Schema\Blueprint;
|
||||
use Hyperf\Database\Migrations\Migration;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('username', 100)->unique()->comment('用户名');
|
||||
$table->string('password')->comment('密码');
|
||||
$table->string('email', 100)->unique()->comment('邮箱');
|
||||
$table->tinyInteger('status')->default(1)->comment('状态:0=禁用,1=启用');
|
||||
$table->text('ext')->nullable()->comment('扩展信息(JSON格式)');
|
||||
$table->string('refresh_token', 500)->nullable()->comment('刷新令牌');
|
||||
$table->timestamp('refresh_token_expires_at')->nullable()->comment('刷新令牌过期时间');
|
||||
$table->datetimes();
|
||||
|
||||
$table->index('username');
|
||||
$table->index('email');
|
||||
$table->index('status');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user