CREATE TABLE llx_prod_ruleset (
    rowid         INT AUTO_INCREMENT PRIMARY KEY,
    ref           VARCHAR(64) NOT NULL,
    description   TEXT NULL,

    status        TINYINT(1) NOT NULL DEFAULT 1,      -- 1=active, 0=archived

    datec         DATETIME NULL,
    tms           TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

    fk_user_creat INTEGER NULL,
    fk_user_modif INTEGER NULL,
    entity        INT NOT NULL DEFAULT 1,

    UNIQUE KEY uk_ruleset_ref (ref, entity, fk_user_creat)
) ENGINE=innodb;
