-- Routing confirmation status per product.
-- confirmed = 0: not confirmed (default / not conform)
-- confirmed = 1: confirmed and compliant with production process

CREATE TABLE IF NOT EXISTS llx_productionrules_routing_confirm (
    rowid            INT          NOT NULL AUTO_INCREMENT,
    entity           INT          NOT NULL DEFAULT 1,
    fk_product       INT          NOT NULL,
    confirmed        TINYINT(1)   NOT NULL DEFAULT 0,
    date_confirm     DATETIME,
    fk_user_confirm  INT,
    date_revoke      DATETIME,
    fk_user_revoke   INT,
    PRIMARY KEY (rowid),
    UNIQUE KEY uk_routing_confirm_product (fk_product, entity)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
