feat: [pmis] 시공관리 인원관리 테이블 생성 (job_types, construction_workers)

This commit is contained in:
김보곤
2026-03-12 14:02:50 +09:00
parent 6c208cfb2c
commit f231c60d3d
2 changed files with 69 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('pmis_job_types', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('tenant_id');
$table->string('name', 100);
$table->integer('sort_order')->default(0);
$table->boolean('is_active')->default(true);
$table->json('options')->nullable();
$table->timestamps();
$table->softDeletes();
$table->index('tenant_id');
$table->index(['tenant_id', 'name']);
});
}
public function down(): void
{
Schema::dropIfExists('pmis_job_types');
}
};

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('pmis_construction_workers', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('tenant_id');
$table->string('company_name', 200);
$table->string('trade_name', 100);
$table->unsignedBigInteger('job_type_id')->nullable();
$table->string('name', 50);
$table->string('phone', 20)->nullable();
$table->string('birth_date', 6)->nullable()->comment('YYMMDD');
$table->char('ssn_gender', 1)->nullable()->comment('주민번호 뒷자리 첫째');
$table->unsignedInteger('wage')->default(0);
$table->string('blood_type', 5)->nullable();
$table->text('remark')->nullable();
$table->json('options')->nullable();
$table->timestamps();
$table->softDeletes();
$table->index('tenant_id');
$table->index(['tenant_id', 'company_name']);
$table->index(['tenant_id', 'name']);
$table->foreign('job_type_id')->references('id')->on('pmis_job_types')->nullOnDelete();
});
}
public function down(): void
{
Schema::dropIfExists('pmis_construction_workers');
}
};