diff --git a/postgres-init/01-schema.sql b/postgres-init/01-schema.sql index c744f16..3fab4a8 100644 --- a/postgres-init/01-schema.sql +++ b/postgres-init/01-schema.sql @@ -240,6 +240,7 @@ CREATE TABLE IF NOT EXISTS card.version_wild_cards ( -- ============================================================ CREATE TABLE IF NOT EXISTS quotation.quotation_settings ( qt_setting_id uuid PRIMARY KEY DEFAULT gen_random_uuid(), -- 견적 설정 식별자(PK) + user_id uuid NOT NULL, -- 견적 설정을 생성한 유저 아이디(company.users.user_id) target_margin_rate NUMERIC(8,6) NOT NULL, -- 목표 마진율 (정수부 2자리 + 소수 6자리, -99.999999~99.999999) anchoring_value NUMERIC(8,6) NOT NULL DEFAULT 0.01, -- 앵커링 값 (정수부 2자리 + 소수 6자리) card_count INTEGER NOT NULL DEFAULT 3, -- 한개의 협상 안에서 협상카드 사용 횟수 @@ -341,6 +342,7 @@ CREATE INDEX IF NOT EXISTS idx_vnc_version_id ON card.version_nego_ CREATE INDEX IF NOT EXISTS idx_vnc_nego_card_id ON card.version_nego_cards (nego_card_id); CREATE INDEX IF NOT EXISTS idx_vwc_version_id ON card.version_wild_cards (version_id); CREATE INDEX IF NOT EXISTS idx_vwc_wild_card_id ON card.version_wild_cards (wild_card_id); +CREATE INDEX IF NOT EXISTS idx_quotation_settings_user_id ON quotation.quotation_settings (user_id); CREATE INDEX IF NOT EXISTS idx_quotations_user_id ON quotation.quotations (user_id); CREATE INDEX IF NOT EXISTS idx_quotations_qt_setting_id ON quotation.quotations (qt_setting_id); CREATE INDEX IF NOT EXISTS idx_quotations_version_id ON quotation.quotations (version_id);