-- Production Order module - install
-- Draft wizard state table

CREATE TABLE IF NOT EXISTS llx_productionorder_draft (
    rowid       INT AUTO_INCREMENT PRIMARY KEY,
    entity      INT NOT NULL DEFAULT 1,
    fk_user     INT NOT NULL,
    fk_product  INT,
    qty         DECIMAL(10,3),
    job_number  INT,
    draft_data  LONGTEXT,
    datec       DATETIME,
    tms         TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    KEY idx_draft_user (fk_user, entity)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
