CREATE TABLE `auth_keys` (
  `id` INT AUTO_INCREMENT PRIMARY KEY,
  `name_key` VARCHAR(100),
  `key_code` VARCHAR(100) UNIQUE,
  `used_count` INT DEFAULT 0,
  `max_use` INT DEFAULT 100,
  `expiry_date` DATETIME
);

CREATE TABLE `auth_logs` (
  `id` INT AUTO_INCREMENT PRIMARY KEY,
  `key_id` INT,
  `key_code` VARCHAR(100),
  `ip` VARCHAR(50),
  `login_time` DATETIME
);
