|
@@ -11,7 +11,7 @@ return new class extends Migration
|
|
|
*/
|
|
|
public function up(): void
|
|
|
{
|
|
|
- Schema::create('users', function (Blueprint $table) {
|
|
|
+ Schema::create('system_users', function (Blueprint $table) {
|
|
|
$table->comment('用户信息表');
|
|
|
$table->id()->comment('用户ID');
|
|
|
$table->string('name')->unique()->comment('用户账号');
|
|
@@ -25,20 +25,21 @@ return new class extends Migration
|
|
|
$table->string('ip_address', 45)->nullable()->comment('最后登录IP');
|
|
|
$table->timestamp('last_activity_at')->nullable()->comment('最后登录时间');
|
|
|
$table->text('remark')->nullable()->comment('备注');
|
|
|
- $table->tinyInteger('status')->default(0)->comment('账户状态 (0正常 1停用)');
|
|
|
+ $table->tinyInteger('status')->default(1)->comment('账户状态 (1正常 0停用)');
|
|
|
$table->bigInteger('creator')->nullable()->comment('创建者');
|
|
|
$table->bigInteger('updater')->nullable()->comment('更新者');
|
|
|
$table->rememberToken();
|
|
|
$table->timestamps();
|
|
|
+ $table->softDeletes();
|
|
|
});
|
|
|
|
|
|
- Schema::create('password_reset_tokens', function (Blueprint $table) {
|
|
|
+ Schema::create('system_password_reset_tokens', function (Blueprint $table) {
|
|
|
$table->string('name')->primary();
|
|
|
$table->string('token');
|
|
|
$table->timestamp('created_at')->nullable();
|
|
|
});
|
|
|
|
|
|
- Schema::create('sessions', function (Blueprint $table) {
|
|
|
+ Schema::create('system_sessions', function (Blueprint $table) {
|
|
|
$table->string('id')->primary();
|
|
|
$table->foreignId('user_id')->nullable()->index();
|
|
|
$table->string('ip_address', 45)->nullable();
|
|
@@ -53,8 +54,8 @@ return new class extends Migration
|
|
|
*/
|
|
|
public function down(): void
|
|
|
{
|
|
|
- Schema::dropIfExists('users');
|
|
|
- Schema::dropIfExists('password_reset_tokens');
|
|
|
- Schema::dropIfExists('sessions');
|
|
|
+ Schema::dropIfExists('system_users');
|
|
|
+ Schema::dropIfExists('system_password_reset_tokens');
|
|
|
+ Schema::dropIfExists('system_sessions');
|
|
|
}
|
|
|
};
|