mirror of
https://gitee.com/ctexthuang/hyperf-micro-svc.git
synced 2026-02-08 10:20:16 +08:00
first commit
This commit is contained in:
43
migrations/2025_09_11_174754_create_admin_user_table.php
Normal file
43
migrations/2025_09_11_174754_create_admin_user_table.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?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('admin_user', function (Blueprint $table) {
|
||||
$table->comment('管理员信息表');
|
||||
$table->bigIncrements('id')->comment('用户ID,主键');
|
||||
$table->string('username', 20)->unique()->comment('用户名')->unique();
|
||||
$table->string('password', 100)->comment('密码');
|
||||
$table->string('user_type', 3)->default('100')->comment('用户类型:100=系统用户');
|
||||
$table->string('nickname', 30)->default('')->comment('用户昵称');
|
||||
$table->string('phone', 11)->default('')->comment('手机');
|
||||
$table->string('email', 50)->default('')->comment('用户邮箱');
|
||||
$table->string('avatar', 255)->default('')->comment('用户头像');
|
||||
$table->string('signed', 255)->default('')->comment('个人签名');
|
||||
$table->tinyInteger('status')->default(1)->comment('状态:1=正常,2=停用');
|
||||
$table->ipAddress('login_ip')->default('127.0.0.1')->comment('最后登陆IP');
|
||||
$table->timestamp('login_time')->useCurrent()->comment('最后登陆时间');
|
||||
$table->json('backend_setting')->nullable()->comment('后台设置数据');
|
||||
$table->unsignedBigInteger('created_by')->default(0)->comment('创建人ID');
|
||||
$table->unsignedBigInteger('updated_by')->default(0)->comment('更新人ID');
|
||||
$table->datetimes();
|
||||
$table->string('remark', 255)->default('')->comment('备注');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('admin_user');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user