CREATE TABLE IF NOT EXISTS `licenses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `license_key` varchar(255) NOT NULL,
  `status` enum('active','inactive','expired') DEFAULT 'active',
  `site_url` varchar(255) DEFAULT NULL,
  `expires_at` date DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `last_checked` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `license_key` (`license_key`),
  KEY `status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `licenses` (`license_key`, `status`, `site_url`, `expires_at`) VALUES
('LICENSE-KEY-12345', 'active', NULL, '2025-12-31'),
('LICENSE-KEY-67890', 'active', NULL, '2026-12-31'),
('DEMO-LICENSE-KEY', 'active', NULL, '2025-12-31');

