diff --git a/database/migrations/2025_07_26_051643_create_bom_items_table.php b/database/migrations/2025_07_26_051643_create_bom_items_table.php index 1fa57cf..a6bb1de 100644 --- a/database/migrations/2025_07_26_051643_create_bom_items_table.php +++ b/database/migrations/2025_07_26_051643_create_bom_items_table.php @@ -21,6 +21,8 @@ public function up(): void $table->decimal('quantity', 18, 4)->default(1); $table->json('attributes')->nullable()->comment('동적 속성'); $table->integer('sort_order')->default(0); + $table->unsignedBigInteger('created_by')->comment('생성자(회원PK)'); + $table->unsignedBigInteger('updated_by')->nullable()->comment('수정자(회원PK)'); $table->timestamps(); $table->softDeletes(); }); diff --git a/database/migrations/2025_07_26_051643_create_boms_table.php b/database/migrations/2025_07_26_051643_create_boms_table.php index 1da7472..7f8270f 100644 --- a/database/migrations/2025_07_26_051643_create_boms_table.php +++ b/database/migrations/2025_07_26_051643_create_boms_table.php @@ -23,6 +23,8 @@ public function up(): void $table->boolean('is_default')->default(false)->comment('기본BOM여부'); $table->boolean('is_active')->default(true)->comment('사용여부'); $table->unsignedBigInteger('image_file_id')->nullable()->index('boms_image_file_id_foreign')->comment('첨부파일ID'); + $table->unsignedBigInteger('created_by')->comment('생성자(회원PK)'); + $table->unsignedBigInteger('updated_by')->nullable()->comment('수정자(회원PK)'); $table->timestamps(); $table->softDeletes(); diff --git a/database/migrations/2025_07_26_051643_create_parts_table.php b/database/migrations/2025_07_26_051643_create_parts_table.php index fe5ba50..d468739 100644 --- a/database/migrations/2025_07_26_051643_create_parts_table.php +++ b/database/migrations/2025_07_26_051643_create_parts_table.php @@ -22,6 +22,8 @@ public function up(): void $table->json('attributes')->nullable()->comment('동적 속성'); $table->string('description')->nullable()->comment('설명'); $table->tinyInteger('is_active')->default(1)->comment('사용여부'); + $table->unsignedBigInteger('created_by')->comment('생성자(회원PK)'); + $table->unsignedBigInteger('updated_by')->nullable()->comment('수정자(회원PK)'); $table->timestamps(); $table->softDeletes(); diff --git a/database/migrations/2025_07_26_051643_create_price_histories_table.php b/database/migrations/2025_07_26_051643_create_price_histories_table.php index 1b9c376..dac7c92 100644 --- a/database/migrations/2025_07_26_051643_create_price_histories_table.php +++ b/database/migrations/2025_07_26_051643_create_price_histories_table.php @@ -20,6 +20,8 @@ public function up(): void $table->decimal('price', 18, 4)->comment('단가'); $table->date('started_at'); $table->date('ended_at')->nullable(); + $table->unsignedBigInteger('created_by')->comment('생성자(회원PK)'); + $table->unsignedBigInteger('updated_by')->nullable()->comment('수정자(회원PK)'); $table->timestamps(); $table->softDeletes(); diff --git a/database/migrations/2025_07_26_051643_create_products_table.php b/database/migrations/2025_07_26_051643_create_products_table.php index 3ab6e13..71d1e7f 100644 --- a/database/migrations/2025_07_26_051643_create_products_table.php +++ b/database/migrations/2025_07_26_051643_create_products_table.php @@ -20,6 +20,8 @@ public function up(): void $table->json('attributes')->nullable()->comment('동적 속성'); $table->string('description')->nullable()->comment('설명'); $table->tinyInteger('is_active')->default(1)->comment('사용여부'); + $table->unsignedBigInteger('created_by')->comment('생성자(회원PK)'); + $table->unsignedBigInteger('updated_by')->nullable()->comment('수정자(회원PK)'); $table->timestamps(); $table->softDeletes(); diff --git a/database/migrations/2025_07_28_183746_create_materials_table.php b/database/migrations/2025_07_28_183746_create_materials_table.php index 7d27903..4741ca4 100644 --- a/database/migrations/2025_07_28_183746_create_materials_table.php +++ b/database/migrations/2025_07_28_183746_create_materials_table.php @@ -10,6 +10,7 @@ public function up(): void { Schema::create('materials', function (Blueprint $table) { $table->id()->comment('자재 PK'); + $table->unsignedBigInteger('tenant_id')->comment('테넌트ID'); $table->string('name', 100)->comment('자재명(품명)'); $table->string('specification', 100)->nullable()->comment('규격'); $table->string('material_code', 50)->unique()->comment('자재코드'); @@ -17,6 +18,8 @@ public function up(): void $table->char('is_inspection', 1)->default('N')->comment('검사대상 여부(Y/N)'); $table->text('search_tag')->nullable()->comment('검색 태그'); $table->text('remarks')->nullable()->comment('비고'); + $table->unsignedBigInteger('created_by')->comment('생성자(회원PK)'); + $table->unsignedBigInteger('updated_by')->nullable()->comment('수정자(회원PK)'); $table->timestamps(); $table->softDeletes(); }); diff --git a/database/migrations/2025_07_28_183747_create_lot_sales_table.php b/database/migrations/2025_07_28_183747_create_lot_sales_table.php index a8903e1..9d20ceb 100644 --- a/database/migrations/2025_07_28_183747_create_lot_sales_table.php +++ b/database/migrations/2025_07_28_183747_create_lot_sales_table.php @@ -10,11 +10,14 @@ public function up(): void { Schema::create('lot_sales', function (Blueprint $table) { $table->id()->comment('로트별 판매기록 PK'); + $table->unsignedBigInteger('tenant_id')->comment('테넌트ID'); $table->unsignedBigInteger('lot_id')->comment('로트ID'); $table->date('sale_date')->comment('판매일'); $table->string('author', 50)->nullable()->comment('등록자'); $table->string('workplace_name', 60)->nullable()->comment('작업장명'); $table->text('remarks')->nullable()->comment('비고'); + $table->unsignedBigInteger('created_by')->comment('생성자(회원PK)'); + $table->unsignedBigInteger('updated_by')->nullable()->comment('수정자(회원PK)'); $table->timestamps(); $table->softDeletes(); $table->index('lot_id', 'idx_sales_lot_id'); diff --git a/database/migrations/2025_07_28_183747_create_lots_table.php b/database/migrations/2025_07_28_183747_create_lots_table.php index 9ac9f43..82e1a2c 100644 --- a/database/migrations/2025_07_28_183747_create_lots_table.php +++ b/database/migrations/2025_07_28_183747_create_lots_table.php @@ -10,6 +10,7 @@ public function up(): void { Schema::create('lots', function (Blueprint $table) { $table->id()->comment('로트관리 PK'); + $table->unsignedBigInteger('tenant_id')->comment('테넌트ID'); $table->string('lot_number', 30)->unique()->comment('로트번호'); $table->unsignedBigInteger('material_id')->comment('자재ID'); $table->string('specification', 100)->nullable()->comment('규격'); @@ -19,6 +20,8 @@ public function up(): void $table->string('fabric_lot', 30)->nullable()->comment('원단 로트'); $table->string('author', 50)->nullable()->comment('작성자'); $table->text('remarks')->nullable()->comment('비고'); + $table->unsignedBigInteger('created_by')->comment('생성자(회원PK)'); + $table->unsignedBigInteger('updated_by')->nullable()->comment('수정자(회원PK)'); $table->timestamps(); $table->softDeletes(); $table->index('material_id', 'idx_lots_material_id'); diff --git a/database/migrations/2025_07_28_183747_create_material_inspection_items_table.php b/database/migrations/2025_07_28_183747_create_material_inspection_items_table.php index b02428a..08987db 100644 --- a/database/migrations/2025_07_28_183747_create_material_inspection_items_table.php +++ b/database/migrations/2025_07_28_183747_create_material_inspection_items_table.php @@ -13,6 +13,8 @@ public function up(): void $table->unsignedBigInteger('inspection_id')->comment('수입검사ID'); $table->string('item_name', 100)->comment('검사항목명'); $table->char('is_checked', 1)->default('N')->comment('체크여부(Y/N)'); + $table->unsignedBigInteger('created_by')->comment('생성자(회원PK)'); + $table->unsignedBigInteger('updated_by')->nullable()->comment('수정자(회원PK)'); $table->timestamps(); $table->softDeletes(); $table->index('inspection_id', 'idx_items_inspection_id'); diff --git a/database/migrations/2025_07_28_183747_create_material_inspections_table.php b/database/migrations/2025_07_28_183747_create_material_inspections_table.php index 70407bb..45ea7f7 100644 --- a/database/migrations/2025_07_28_183747_create_material_inspections_table.php +++ b/database/migrations/2025_07_28_183747_create_material_inspections_table.php @@ -11,6 +11,7 @@ public function up(): void Schema::create('material_inspections', function (Blueprint $table) { $table->id()->comment('수입검사 PK'); $table->unsignedBigInteger('receipt_id')->comment('자재입고ID'); + $table->unsignedBigInteger('tenant_id')->comment('테넌트ID'); $table->date('inspection_date')->comment('검사일자'); $table->string('inspector_name', 50)->nullable()->comment('검사자'); $table->string('approver_name', 50)->nullable()->comment('결재자'); @@ -18,6 +19,8 @@ public function up(): void $table->string('status_code', 30)->comment('상태코드(common_codes)'); $table->text('result_file_path')->nullable()->comment('성적서 PDF 경로'); $table->text('remarks')->nullable()->comment('비고'); + $table->unsignedBigInteger('created_by')->comment('생성자(회원PK)'); + $table->unsignedBigInteger('updated_by')->nullable()->comment('수정자(회원PK)'); $table->timestamps(); $table->softDeletes(); $table->index('receipt_id', 'idx_inspections_receipt_id'); diff --git a/database/migrations/2025_07_28_183747_create_material_receipts_table.php b/database/migrations/2025_07_28_183747_create_material_receipts_table.php index a09ea50..f2c3318 100644 --- a/database/migrations/2025_07_28_183747_create_material_receipts_table.php +++ b/database/migrations/2025_07_28_183747_create_material_receipts_table.php @@ -11,6 +11,7 @@ public function up(): void Schema::create('material_receipts', function (Blueprint $table) { $table->id()->comment('자재입고 PK'); $table->unsignedBigInteger('material_id')->comment('자재ID'); + $table->unsignedBigInteger('tenant_id')->comment('테넌트ID'); $table->date('receipt_date')->comment('입고일'); $table->string('lot_number', 30)->comment('로트번호'); $table->decimal('received_qty', 12, 2)->comment('입고수량'); @@ -23,6 +24,8 @@ public function up(): void $table->char('is_inspection', 1)->default('N')->comment('검사대상 여부(Y/N)'); $table->date('inspection_date')->nullable()->comment('검사일자'); $table->text('remarks')->nullable()->comment('비고'); + $table->unsignedBigInteger('created_by')->comment('생성자(회원PK)'); + $table->unsignedBigInteger('updated_by')->nullable()->comment('수정자(회원PK)'); $table->timestamps(); $table->softDeletes(); $table->index('material_id', 'idx_receipts_material_id');