--ABS-165180
CREATE TABLE DWH_PRICE_HISTORY_SETTINGS
(
  PRICE_TYPE           NUMBER,
  PARALLEL_DEGREE      NUMBER(2),
  PRICE_TYPE_PCK_CALL  VARCHAR2(1000),
  PRICE_TYPE_DESC      VARCHAR2(1000),
  PRICE_TYPE_SQL       CLOB,
  PRICE_TYPE_HIST_SQL  CLOB,
  PRICE_TYPE_SPLIT_SQL CLOB
);

CREATE TABLE DWH_PRICE_HISTORY
(
  PRICE_TYPE                   NUMBER,
  PRODUCTLISTPERCUSTOMER_ID    NUMBER,
  CUSTOMER_ID                  NUMBER,
  PRODUCT_ID                   NUMBER,
  SIZEDEFINITION_ID            NUMBER,
  FINISHINGMETHOD_ID           NUMBER,
  CHARGEWASHESONLYFORCOG       NUMBER,
  WEIGHINGCATEGORY_ID          NUMBER,
  TYPEOFMERCHANDISE            NUMBER,
  CURRENCYDECIMALS             NUMBER,
  COSTPRICEINCLWASHSALESPRICE  NUMBER,
  COSTPRICEINCLRENTPRICE       NUMBER,
  COSTPRICEINCLWEIGHTPRICE     NUMBER,
  COSTPRICEINCLCOSTREPORTPRICE NUMBER,
  PRICE_TYPE_CODE              VARCHAR2(1),
  PRICE_TYPE_DESCRIPTION       VARCHAR2(30),
  LINE_TYPE_DESCRIPTION        VARCHAR2(30),
  PRICE_DETAILS                VARCHAR2(1000),
  PRICE                        NUMBER,
  PRICE_LEVEL                  NUMBER,
  PRICE_CHF                    VARCHAR2(1),
  PRICE_GC                     VARCHAR2(1),
  PRICE_START_DATE             DATE,
  PRICE_LIST_CODE              VARCHAR2(15),
  PRICE_RESULT_CODE            VARCHAR2(1),
  PRICE_RESULT_DESCRIPTION     VARCHAR2(80),
  PRICE_LIST_DESCRIPTION       VARCHAR2(80),
  INSERT_TIME_STAMP            DATE,
  PRICE_FOUND                  VARCHAR2(1)
);
COMMENT ON COLUMN DWH_PRICE_HISTORY.PRICE_CHF
  IS 'C = Current price H = Historical price F = Future price';
COMMENT ON COLUMN DWH_PRICE_HISTORY.PRICE_GC
  IS 'General or customer specific';
COMMENT ON COLUMN DWH_PRICE_HISTORY.PRICE_FOUND
  IS 'Price exists Y or N';
CREATE INDEX XIE1DWHPRICEHISTORY ON DWH_PRICE_HISTORY (PRODUCTLISTPERCUSTOMER_ID);
CREATE INDEX XIE2DWHPRICEHISTORY ON DWH_PRICE_HISTORY (PRICE_TYPE);
CREATE INDEX XIE3DWHPRICEHISTORY ON DWH_PRICE_HISTORY (PRICE_CHF);
CREATE INDEX XIE4DWHPRICEHISTORY ON DWH_PRICE_HISTORY (PRICE_LEVEL);
CREATE INDEX XIE5DWHPRICEHISTORY ON DWH_PRICE_HISTORY (PRICE_FOUND);
CREATE INDEX XIE6DWHPRICEHISTORY ON DWH_PRICE_HISTORY (CUSTOMER_ID);
CREATE INDEX XIE7DWHPRICEHISTORY ON DWH_PRICE_HISTORY (PRODUCT_ID);
