fix(purchase): purchase_requests 테이블 스키마 — item_id NULL + 직접입력/사진 컬럼

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-13 21:57:49 +09:00
parent cae735f243
commit aacd18be1c

View File

@@ -33,10 +33,12 @@ CREATE TABLE IF NOT EXISTS consumable_items (
UNIQUE KEY uq_name_maker (item_name, maker)
);
-- 구매신청 (tkfb에서 CRUD)
-- 구매신청 (tkfb에서 CRUD) — item_id NULL 허용 + 직접입력/사진 컬럼 추가
CREATE TABLE IF NOT EXISTS purchase_requests (
request_id INT AUTO_INCREMENT PRIMARY KEY,
item_id INT NOT NULL,
item_id INT NULL,
custom_item_name VARCHAR(100) NULL COMMENT '직접입력 품명',
custom_category ENUM('consumable','safety','repair','equipment') NULL COMMENT '직접입력 카테고리',
quantity INT NOT NULL DEFAULT 1,
requester_id INT NOT NULL COMMENT 'FK → sso_users.user_id',
request_date DATE NOT NULL,
@@ -44,6 +46,7 @@ CREATE TABLE IF NOT EXISTS purchase_requests (
COMMENT '대기, 구매완료, 보류',
hold_reason TEXT,
notes TEXT,
photo_path VARCHAR(255) NULL COMMENT '첨부 사진',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (item_id) REFERENCES consumable_items(item_id),