refactor: [cleanup] kd_price_tables 레거시 단가 테이블 삭제 + 문서 업데이트

This commit is contained in:
2026-03-18 09:22:47 +09:00
parent 26e33fdc13
commit f6f08fb810
4 changed files with 45 additions and 907 deletions

View File

@@ -0,0 +1,44 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* kd_price_tables 테이블 삭제
*
* 레거시 5130 단가 데이터를 임시 저장하던 테이블.
* EstimatePriceService가 items + item_details + prices 기반으로 전환 완료되어
* 더 이상 사용하지 않음.
*/
return new class extends Migration
{
public function up(): void
{
Schema::dropIfExists('kd_price_tables');
}
public function down(): void
{
Schema::create('kd_price_tables', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('tenant_id')->default(287)->comment('경동기업 테넌트 ID');
$table->string('table_type', 50)->comment('테이블 유형: motor, shaft, pipe, angle, raw_material, bdmodels');
$table->string('item_code', 100)->nullable()->comment('품목 코드 (연동용)');
$table->string('item_name', 200)->nullable()->comment('품목명');
$table->string('category', 100)->nullable()->comment('분류');
$table->string('spec1', 100)->nullable()->comment('규격1');
$table->string('spec2', 100)->nullable()->comment('규격2');
$table->string('spec3', 100)->nullable()->comment('규격3');
$table->decimal('unit_price', 15, 2)->default(0)->comment('단가');
$table->string('unit', 20)->default('EA')->comment('단위');
$table->json('raw_data')->nullable()->comment('원본 JSON 데이터');
$table->boolean('is_active')->default(true)->comment('활성 여부');
$table->timestamps();
$table->index(['tenant_id', 'table_type']);
$table->index(['table_type', 'category']);
$table->index(['table_type', 'spec1', 'spec2']);
});
}
};