From 723b5a8e1a241d54820cc4bd2e65c01e7c0356c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Thu, 12 Mar 2026 12:22:58 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[pmis]=20pmis=5Fworkers=20=ED=85=8C?= =?UTF-8?q?=EC=9D=B4=EB=B8=94=20=EB=A7=88=EC=9D=B4=EA=B7=B8=EB=A0=88?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 건설PMIS 현장 작업자 전용 프로필 테이블 - tenant_id + user_id 유니크 제약 포함 --- ...03_12_120000_create_pmis_workers_table.php | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 database/migrations/2026_03_12_120000_create_pmis_workers_table.php diff --git a/database/migrations/2026_03_12_120000_create_pmis_workers_table.php b/database/migrations/2026_03_12_120000_create_pmis_workers_table.php new file mode 100644 index 0000000..ffda5f3 --- /dev/null +++ b/database/migrations/2026_03_12_120000_create_pmis_workers_table.php @@ -0,0 +1,38 @@ +id(); + $table->unsignedBigInteger('tenant_id')->default(1)->index(); + $table->unsignedBigInteger('user_id')->nullable()->index()->comment('SAM users 테이블 FK (연결된 계정)'); + $table->string('name', 50); + $table->string('login_id', 50)->nullable()->comment('PMIS 로그인 아이디'); + $table->string('phone', 20)->nullable(); + $table->string('email', 255)->nullable(); + $table->string('department', 100)->nullable()->comment('소속 부서/현장소장 등'); + $table->string('position', 50)->nullable()->comment('직책'); + $table->string('role_type', 50)->nullable()->comment('권한 유형: 협력업체사용자, 원청관리자 등'); + $table->string('gender', 5)->nullable(); + $table->string('company', 100)->nullable()->comment('소속 업체명'); + $table->string('profile_photo_path', 500)->nullable(); + $table->json('options')->nullable(); + $table->timestamp('last_login_at')->nullable(); + $table->timestamps(); + $table->softDeletes(); + + $table->unique(['tenant_id', 'user_id'], 'pmis_workers_tenant_user_unique'); + }); + } + + public function down(): void + { + Schema::dropIfExists('pmis_workers'); + } +};