postgres-init/ 는 신규 DB 부트스트랩(01 schema·02 learning·03 seed) 전용이라 ALTER(기존 DB 대상)는 별도 디렉터리로 분리. 앞으로 마이그레이션은 postgres-migrations/YYYY-MM-DD-설명.sql 로 추가한다. 04-alter-negodata-pricing.sql → 2026-06-26-pricing-classification.sql Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
28 lines
1.2 KiB
SQL
28 lines
1.2 KiB
SQL
-- negosium 견적 개편: 가격(매입/판매)·수수료율·앵커링가 + 견적/카드/협력사 분류 컬럼
|
|
-- 적용 대상: 이미 돌아가는 DB (신규/리셋 DB는 postgres-init/01-schema.sql 에 이미 포함).
|
|
|
|
-- 상품: 인터넷최저가 실값 + 매입가 + 판매가
|
|
ALTER TABLE partner.items
|
|
ADD COLUMN IF NOT EXISTS internet_lowest_price BIGINT,
|
|
ADD COLUMN IF NOT EXISTS purchase_price BIGINT,
|
|
ADD COLUMN IF NOT EXISTS selling_price BIGINT;
|
|
|
|
-- 견적 설정: 인터넷 평균 수수료율
|
|
ALTER TABLE quotation.quotation_settings
|
|
ADD COLUMN IF NOT EXISTS internet_average_fee NUMERIC(8,6) NOT NULL DEFAULT 0.078;
|
|
|
|
-- 세션: 앵커링가
|
|
ALTER TABLE negotiation.sessions
|
|
ADD COLUMN IF NOT EXISTS target_anchoring_price BIGINT;
|
|
|
|
-- 견적: MD 제시가 + 협력사(공급채널) 유형
|
|
ALTER TABLE quotation.quotations
|
|
ADD COLUMN IF NOT EXISTS md_price BIGINT,
|
|
ADD COLUMN IF NOT EXISTS supplier_type SMALLINT;
|
|
|
|
-- 카드: 사용 범위 구분(CardUsageType): 1=공통 2=신규견적전용 3=재견적전용
|
|
ALTER TABLE card.nego_cards
|
|
ADD COLUMN IF NOT EXISTS usage_type SMALLINT NOT NULL DEFAULT 1;
|
|
ALTER TABLE card.wild_cards
|
|
ADD COLUMN IF NOT EXISTS usage_type SMALLINT NOT NULL DEFAULT 1;
|