CREATE TABLE IF NOT EXISTS users_api_keys (
    id_api_key INT UNSIGNED NOT NULL AUTO_INCREMENT,
    id_user INT UNSIGNED NOT NULL,
    token VARCHAR(80) NOT NULL,
    label VARCHAR(190) NULL,
    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    last_used_at DATETIME NULL,
    PRIMARY KEY (id_api_key),
    UNIQUE KEY uniq_token (token),
    KEY idx_user (id_user)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
