CREATE TABLE `licenses` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `client_name` VARCHAR(100) NOT NULL,
  `license_key` VARCHAR(50) NOT NULL,
  `hwid` VARCHAR(255) NULL,
  `status` ENUM('active','blocked','expired') NOT NULL DEFAULT 'active',
  `expiry_date` DATE NOT NULL,
  `last_seen` DATETIME NULL,
  `current_activity` VARCHAR(255) NULL,
  `ip_address` VARCHAR(50) NULL,
  `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_license_key` (`license_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


