composer require --dev kitloong/laravel-migrations-generator php artisan migrate:generate
43 lines
1.7 KiB
PHP
43 lines
1.7 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*/
|
|
public function up(): void
|
|
{
|
|
Schema::create('users', function (Blueprint $table) {
|
|
$table->bigIncrements('id');
|
|
$table->string('user_id', 100)->unique()->comment('회원 아이디');
|
|
$table->string('phone', 30)->nullable()->comment('회원 전화번호');
|
|
$table->json('options')->nullable()->comment('회사별 옵션 정보(계좌, 사번 등)');
|
|
$table->string('name')->comment('회원 이름');
|
|
$table->string('email')->unique('uk_users_tenant_email')->comment('이메일');
|
|
$table->timestamp('email_verified_at')->nullable();
|
|
$table->string('password')->comment('비밀번호');
|
|
$table->timestamp('last_login_at')->nullable()->comment('마지막 로그인 일시');
|
|
$table->text('two_factor_secret')->nullable();
|
|
$table->text('two_factor_recovery_codes')->nullable();
|
|
$table->timestamp('two_factor_confirmed_at')->nullable();
|
|
$table->rememberToken()->comment('자동로그인 토큰');
|
|
$table->unsignedBigInteger('current_team_id')->nullable();
|
|
$table->string('profile_photo_path', 2048)->nullable()->comment('프로필 사진 경로');
|
|
$table->timestamps();
|
|
$table->softDeletes()->comment('삭제일시(소프트삭제)');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('users');
|
|
}
|
|
};
|