CREATE TABLE llx_element_history (
                                 rowid INT AUTO_INCREMENT PRIMARY KEY,
                                 fk_element INT NOT NULL,
                                 element_type VARCHAR(50) NOT NULL,
                                 field_name VARCHAR(100) NOT NULL,
                                 old_value TEXT,
                                 new_value TEXT,
                                 fk_user INT,
                                 tms TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
                                 INDEX idx_fk_element (fk_element),
                                 INDEX idx_element_type (element_type),
                                 INDEX idx_field_name (field_name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
