feat: Design BOM 템플릿 diff/clone API 및 모델버전 릴리즈 유효성 검사 도입
- Design BOM 템플릿 diff/clone 엔드포인트 추가 - 컨트롤러 검증 로직 FormRequest 분리(DiffRequest/CloneRequest/Upsert/ReplaceItems) - BomTemplateService에 diffTemplates/cloneTemplate/replaceItems/쇼우 로직 정리 - ModelVersionController createDraft FormRequest 적용 및 서비스 호출 정리 - 모델버전 release 전 유효성 검사(존재/활성/테넌트 일치, qty>0, 중복 금지) 추가 - DB enum 미사용 방침 준수(status 문자열 유지) - model_versions 인덱스 최적화(tenant_id, model_id, status / 기간 범위) - Swagger 문서(Design BOM) 및 i18n 메시지 키 추가
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?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::table('model_versions', function (Blueprint $table) {
|
||||
// 상태 조회 최적화(테넌트+모델+상태)
|
||||
$table->index(['tenant_id', 'model_id', 'status'], 'ix_model_versions_tenant_model_status');
|
||||
// 효력기간 교집합/정렬 조회 최적화(테넌트+모델+기간)
|
||||
$table->index(['tenant_id', 'model_id', 'effective_from', 'effective_to'], 'ix_model_versions_tenant_model_effective_range');
|
||||
// 주의: 유니크 제약은 기존 스키마(uq_model_versions_model_ver)와 충돌 우려로 추가하지 않음
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('model_versions', function (Blueprint $table) {
|
||||
$table->dropIndex('ix_model_versions_tenant_model_status');
|
||||
$table->dropIndex('ix_model_versions_tenant_model_effective_range');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user