-- ============================================================================
-- Table structure for llx_tm_area
-- Production areas / departments owning their own competence matrix
-- e.g. "Trim and Chem wash", "Pressing", "Welding"
-- Admin-managed (requires trainmatrix->config right)
-- ============================================================================

CREATE TABLE IF NOT EXISTS llx_tm_area (
    rowid         INTEGER      NOT NULL AUTO_INCREMENT PRIMARY KEY,
    ref           VARCHAR(64)  NOT NULL,
    label         VARCHAR(255) NOT NULL,
    description   TEXT         DEFAULT NULL,
    active        TINYINT      NOT NULL DEFAULT 1,
    tms           TIMESTAMP    DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    fk_user_creat INTEGER      DEFAULT NULL,
    fk_user_modif INTEGER      DEFAULT NULL,
    import_key    VARCHAR(14)  DEFAULT NULL
) ENGINE=innodb DEFAULT CHARSET=utf8mb4;
