Files
sam-api/database/migrations/2025_07_26_051643_create_users_table.php
kent b436b635c2 fix : 테이블 추가 및 수정 신규로 작성 (generator 설치)
composer require --dev kitloong/laravel-migrations-generator
php artisan migrate:generate
2025-07-26 05:22:58 +09:00

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');
}
};