-- Same schema as engine database._METRIC_SCHEMA, not a separate PHP metric model. -- Engine owns collection, retention and writes; PHP initializes the empty log database. CREATE TABLE IF NOT EXISTS engine_vm_metric_samples ( host_scope CHAR(64) CHARACTER SET ascii COLLATE ascii_bin NOT NULL, vm_uuid CHAR(36) CHARACTER SET ascii COLLATE ascii_bin NOT NULL, sampled_at BIGINT UNSIGNED NOT NULL, cpu_percent DOUBLE NULL, memory_used_mib DOUBLE NULL, memory_total_mib DOUBLE NULL, disk_read_bps DOUBLE NULL, disk_write_bps DOUBLE NULL, network_rx_bps DOUBLE NULL, network_tx_bps DOUBLE NULL, PRIMARY KEY (host_scope, vm_uuid, sampled_at), KEY vm_metric_retention (sampled_at) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;