-- Assembly ruleset for Sales Order rules (ProductionRules module)
CREATE TABLE llx_prod_so_ruleset (
    rowid           integer AUTO_INCREMENT PRIMARY KEY,
    entity          integer DEFAULT 1 NOT NULL,
    ref             varchar(128) NOT NULL,
    fk_user_creat   integer,
    datec           datetime,
    tms             timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    active          tinyint DEFAULT 1 NOT NULL
) ENGINE=innodb;

ALTER TABLE llx_prod_so_ruleset ADD UNIQUE INDEX uk_prod_so_ruleset_ref (entity, ref);
