CREATE TABLE coad_licenses (
  id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  product_key VARCHAR(64) NOT NULL,
  website VARCHAR(255) NOT NULL,
  status ENUM('active','blocked') NOT NULL DEFAULT 'active',
  expires_at DATETIME NULL,
  created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (id),
  UNIQUE KEY uq_product_key (product_key),
  UNIQUE KEY uq_website (website),
  KEY idx_status (status)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Example:
-- INSERT INTO coad_licenses (product_key, website, status, expires_at)
-- VALUES ('COAD-ABCD-1234-EFGH', 'client.com', 'active', '2027-09-01 23:59:59');
