CREATE TABLE IF NOT EXISTS `fc_live_support_access` (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `email` varchar(255) NOT NULL,
  `plan_key` varchar(16) NOT NULL,
  `paystack_reference` varchar(128) NOT NULL,
  `currency` varchar(16) NOT NULL DEFAULT 'NGN',
  `amount_paid_smallest` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `paid_until` datetime NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `fc_live_support_access_paystack_reference_unique` (`paystack_reference`),
  KEY `idx_email_paid` (`email`, `paid_until`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
