-- ====================================================================
-- A_WORKFLOW_HISTORY_PROPERTY Table
-- ====================================================================
-- Purpose: Store workflow history properties
-- ====================================================================

CREATE TABLE CT_MRDS.A_WORKFLOW_HISTORY_PROPERTY (
    A_WORKFLOW_HISTORY_KEY  NUMBER,
    SERVICE_NAME            VARCHAR2(200),
    PROPERTY                VARCHAR2(200),
    VALUE                   VARCHAR2(200),
    CONSTRAINT A_WORKFLOW_HISTORY_FK FOREIGN KEY (A_WORKFLOW_HISTORY_KEY, SERVICE_NAME) 
        REFERENCES CT_MRDS.A_WORKFLOW_HISTORY (A_WORKFLOW_HISTORY_KEY, SERVICE_NAME)
) TABLESPACE "DATA";

-- Index for performance on workflow history property queries
CREATE INDEX CT_MRDS.A_WORKFLOW_HISTORY_PROPERTY_IDX1 
ON CT_MRDS.A_WORKFLOW_HISTORY_PROPERTY(A_WORKFLOW_HISTORY_KEY, SERVICE_NAME);