fix(purchase): purchase_requests 테이블 스키마 — item_id NULL + 직접입력/사진 컬럼
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -33,10 +33,12 @@ CREATE TABLE IF NOT EXISTS consumable_items (
|
|||||||
UNIQUE KEY uq_name_maker (item_name, maker)
|
UNIQUE KEY uq_name_maker (item_name, maker)
|
||||||
);
|
);
|
||||||
|
|
||||||
-- 구매신청 (tkfb에서 CRUD)
|
-- 구매신청 (tkfb에서 CRUD) — item_id NULL 허용 + 직접입력/사진 컬럼 추가
|
||||||
CREATE TABLE IF NOT EXISTS purchase_requests (
|
CREATE TABLE IF NOT EXISTS purchase_requests (
|
||||||
request_id INT AUTO_INCREMENT PRIMARY KEY,
|
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,
|
quantity INT NOT NULL DEFAULT 1,
|
||||||
requester_id INT NOT NULL COMMENT 'FK → sso_users.user_id',
|
requester_id INT NOT NULL COMMENT 'FK → sso_users.user_id',
|
||||||
request_date DATE NOT NULL,
|
request_date DATE NOT NULL,
|
||||||
@@ -44,6 +46,7 @@ CREATE TABLE IF NOT EXISTS purchase_requests (
|
|||||||
COMMENT '대기, 구매완료, 보류',
|
COMMENT '대기, 구매완료, 보류',
|
||||||
hold_reason TEXT,
|
hold_reason TEXT,
|
||||||
notes TEXT,
|
notes TEXT,
|
||||||
|
photo_path VARCHAR(255) NULL COMMENT '첨부 사진',
|
||||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
FOREIGN KEY (item_id) REFERENCES consumable_items(item_id),
|
FOREIGN KEY (item_id) REFERENCES consumable_items(item_id),
|
||||||
|
|||||||
Reference in New Issue
Block a user