-- ============================================================
-- part_mng ALTER — 개발관리 메뉴(PART 등록/조회) 누락 컬럼 추가
-- 추출일: 2026-05-12
-- 출처: 211.115.91.141:11133/waceplm (PG 16.8)
-- 대상: 211.115.91.141:11134/vexplor_rps
--
-- 사유: wace PART 등록/조회 그리드 23개 컬럼 중 15개가 vexplor part_mng 에 부재.
--       전부 ADD COLUMN IF NOT EXISTS 로 안전하게 추가 (IDEMPOTENT).
-- ============================================================

BEGIN;

ALTER TABLE part_mng ADD COLUMN IF NOT EXISTS heat_treatment_hardness character varying;
ALTER TABLE part_mng ADD COLUMN IF NOT EXISTS heat_treatment_method   character varying;
ALTER TABLE part_mng ADD COLUMN IF NOT EXISTS surface_treatment       character varying;
ALTER TABLE part_mng ADD COLUMN IF NOT EXISTS acctfg                  character varying;
ALTER TABLE part_mng ADD COLUMN IF NOT EXISTS odrfg                   character varying;
ALTER TABLE part_mng ADD COLUMN IF NOT EXISTS unit_dc                 character varying(20);
ALTER TABLE part_mng ADD COLUMN IF NOT EXISTS unitmang_dc             character varying(20);
ALTER TABLE part_mng ADD COLUMN IF NOT EXISTS unitchng_nb             numeric(11,6);
ALTER TABLE part_mng ADD COLUMN IF NOT EXISTS lot_fg                  character(1);
ALTER TABLE part_mng ADD COLUMN IF NOT EXISTS use_yn                  character(1);
ALTER TABLE part_mng ADD COLUMN IF NOT EXISTS qc_fg                   character(1);
ALTER TABLE part_mng ADD COLUMN IF NOT EXISTS setitem_fg              character(1);
ALTER TABLE part_mng ADD COLUMN IF NOT EXISTS req_fg                  character(1);
ALTER TABLE part_mng ADD COLUMN IF NOT EXISTS unit_length             character varying(20);
ALTER TABLE part_mng ADD COLUMN IF NOT EXISTS unit_qty                character varying(20);

COMMENT ON COLUMN part_mng.heat_treatment_hardness IS '열처리경도';
COMMENT ON COLUMN part_mng.heat_treatment_method   IS '열처리방법';
COMMENT ON COLUMN part_mng.surface_treatment       IS '표면처리';
COMMENT ON COLUMN part_mng.acctfg                  IS '계정구분 (comm_code)';
COMMENT ON COLUMN part_mng.odrfg                   IS '조달구분 (comm_code)';
COMMENT ON COLUMN part_mng.unit_dc                 IS '재고단위 (comm_code)';
COMMENT ON COLUMN part_mng.unitmang_dc             IS '관리단위 (comm_code)';
COMMENT ON COLUMN part_mng.unitchng_nb             IS '환산수량';
COMMENT ON COLUMN part_mng.lot_fg                  IS 'LOT구분 (Y/N)';
COMMENT ON COLUMN part_mng.use_yn                  IS '사용여부 (Y/N)';
COMMENT ON COLUMN part_mng.qc_fg                   IS '검사여부 (Y/N)';
COMMENT ON COLUMN part_mng.setitem_fg              IS 'SET품여부 (Y/N)';
COMMENT ON COLUMN part_mng.req_fg                  IS '의뢰여부 (Y/N)';
COMMENT ON COLUMN part_mng.unit_length             IS '개당길이';
COMMENT ON COLUMN part_mng.unit_qty                IS '개당수량';

COMMIT;
