refactor: [pmis] 마이그레이션을 MNG 프로젝트로 이관

- PMIS 테이블은 MNG 전용이므로 API에서 제거
- pmis_workers, pmis_job_types, pmis_construction_workers, pmis_equipments, pmis_materials
This commit is contained in:
김보곤
2026-03-12 14:43:51 +09:00
parent 7b93fd7f68
commit 4e19e3ed67
5 changed files with 0 additions and 180 deletions

View File

@@ -1,38 +0,0 @@
<?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_workers', function (Blueprint $table) {
$table->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');
}
};

View File

@@ -1,30 +0,0 @@
<?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

@@ -1,39 +0,0 @@
<?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');
}
};

View File

@@ -1,39 +0,0 @@
<?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_equipments', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('tenant_id');
$table->string('company_name', 200);
$table->string('equipment_code', 50)->nullable();
$table->string('equipment_name', 200);
$table->string('specification', 300)->nullable();
$table->string('unit', 50)->nullable();
$table->string('equipment_number', 100);
$table->string('operator', 50)->nullable()->comment('운전원');
$table->date('inspection_end_date')->nullable()->comment('검사종료일');
$table->boolean('inspection_not_applicable')->default(false)->comment('검사 해당없음');
$table->date('insurance_end_date')->nullable()->comment('보험종료일');
$table->boolean('insurance_not_applicable')->default(false)->comment('보험 해당없음');
$table->json('options')->nullable();
$table->timestamps();
$table->softDeletes();
$table->index('tenant_id');
$table->index(['tenant_id', 'company_name']);
$table->index(['tenant_id', 'equipment_name']);
});
}
public function down(): void
{
Schema::dropIfExists('pmis_equipments');
}
};

View File

@@ -1,34 +0,0 @@
<?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_materials', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('tenant_id');
$table->string('company_name', 200);
$table->string('material_code', 50)->nullable();
$table->string('material_name', 200);
$table->string('specification', 300)->nullable();
$table->string('unit', 50)->nullable();
$table->decimal('design_quantity', 14, 2)->default(0)->comment('설계량');
$table->json('options')->nullable();
$table->timestamps();
$table->softDeletes();
$table->index('tenant_id');
$table->index(['tenant_id', 'company_name']);
$table->index(['tenant_id', 'material_name']);
});
}
public function down(): void
{
Schema::dropIfExists('pmis_materials');
}
};