/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `account_setup_invitations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `account_setup_invitations` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `first_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `setup_token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('pending','completed','expired','declined') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `expires_at` timestamp NOT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `unsubscribed_at` timestamp NULL DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `campaign_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `source` enum('csv','bulk','api','manual','scheduled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'manual' COMMENT 'How campaign was created',
  `target_filter` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'For bulk campaigns: all, high_value, repeat_customers',
  `campaign_status` enum('scheduled','active','paused','completed','cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active' COMMENT 'Current campaign lifecycle state',
  `batch_config` json DEFAULT NULL COMMENT 'Stores: batch_size, batch_delay, max_per_hour',
  `progress_data` json DEFAULT NULL COMMENT 'Stores: current_batch, total_batches, sent, pending, failed, skipped',
  `paused_at` timestamp NULL DEFAULT NULL,
  `resumed_at` timestamp NULL DEFAULT NULL,
  `cancelled_at` timestamp NULL DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `sent_by` bigint unsigned DEFAULT NULL,
  `decline_reason` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `account_setup_invitations_setup_token_unique` (`setup_token`),
  KEY `account_setup_invitations_created_at_index` (`created_at`),
  KEY `account_setup_invitations_status_expires_at_index` (`status`,`expires_at`),
  KEY `account_setup_invitations_email_index` (`email`),
  KEY `account_setup_invitations_status_index` (`status`),
  KEY `account_setup_invitations_expires_at_index` (`expires_at`),
  KEY `account_setup_invitations_user_id_index` (`user_id`),
  KEY `idx_campaign_status` (`campaign_status`),
  KEY `idx_source` (`source`),
  KEY `idx_campaign_name` (`campaign_name`),
  KEY `idx_created_at` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `act_sponsor_photos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `act_sponsor_photos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `acts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `acts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `event_id` bigint unsigned NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `no_of_perticipant` int NOT NULL,
  `image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `video` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `added_by` bigint unsigned DEFAULT NULL,
  `deleted_by` bigint unsigned DEFAULT NULL,
  `status` tinyint NOT NULL DEFAULT '1',
  `is_deleted` tinyint NOT NULL DEFAULT '0' COMMENT 'allow only 0 / 1 for true and false',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `acts_event_id_foreign` (`event_id`),
  KEY `acts_added_by_foreign` (`added_by`),
  KEY `acts_deleted_by_foreign` (`deleted_by`),
  CONSTRAINT `acts_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`),
  CONSTRAINT `acts_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`),
  CONSTRAINT `acts_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `admin_permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `admin_permissions` (
  `admin_id` bigint unsigned NOT NULL,
  `permission_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`admin_id`,`permission_id`),
  KEY `idx_admin_id` (`admin_id`),
  CONSTRAINT `admin_permissions_admin_id_foreign` FOREIGN KEY (`admin_id`) REFERENCES `admins` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `admin_roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `admin_roles` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `display_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `permissions` json NOT NULL,
  `is_system` tinyint(1) NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `admin_roles_name_unique` (`name`),
  KEY `admin_roles_is_active_index` (`is_active`),
  KEY `admin_roles_is_system_index` (`is_system`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `admins`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `admins` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `backup_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `password_changed_at` timestamp NULL DEFAULT NULL,
  `profile_image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `role_id` bigint unsigned DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `last_login_at` timestamp NULL DEFAULT NULL,
  `last_login_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_action_at` timestamp NULL DEFAULT NULL,
  `last_action_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `suspension_reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `suspended_at` timestamp NULL DEFAULT NULL,
  `suspended_by` bigint unsigned DEFAULT NULL,
  `created_by` bigint unsigned DEFAULT NULL,
  `updated_by` bigint unsigned DEFAULT NULL,
  `remember_token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `admins_username_unique` (`username`),
  UNIQUE KEY `admins_email_unique` (`email`),
  KEY `admins_is_active_index` (`is_active`),
  KEY `admins_role_id_index` (`role_id`),
  KEY `admins_email_index` (`email`),
  KEY `admins_username_index` (`username`),
  KEY `admins_suspended_by_foreign` (`suspended_by`),
  KEY `admins_created_by_foreign` (`created_by`),
  KEY `admins_updated_by_foreign` (`updated_by`),
  KEY `admins_backup_email_index` (`backup_email`),
  KEY `admins_suspended_at_index` (`suspended_at`),
  KEY `admins_last_action_at_index` (`last_action_at`),
  CONSTRAINT `admins_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `admins` (`id`) ON DELETE SET NULL,
  CONSTRAINT `admins_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `admin_roles` (`id`) ON DELETE SET NULL,
  CONSTRAINT `admins_suspended_by_foreign` FOREIGN KEY (`suspended_by`) REFERENCES `admins` (`id`) ON DELETE SET NULL,
  CONSTRAINT `admins_updated_by_foreign` FOREIGN KEY (`updated_by`) REFERENCES `admins` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `banners`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `banners` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `status` int NOT NULL DEFAULT '1',
  `order` int NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `batch_jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `batch_jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `batch_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('initializing','processing','completed','failed','cancelled') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'initializing',
  `total_items` int NOT NULL DEFAULT '0',
  `processed_items` int NOT NULL DEFAULT '0',
  `failed_items` int NOT NULL DEFAULT '0',
  `chunk_size` int NOT NULL DEFAULT '100',
  `progress_percentage` decimal(5,2) NOT NULL DEFAULT '0.00',
  `options` json DEFAULT NULL,
  `error_message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `started_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `cancelled_at` timestamp NULL DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `result_summary` json DEFAULT NULL,
  `created_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `batch_jobs_batch_id_unique` (`batch_id`),
  KEY `batch_jobs_batch_id_index` (`batch_id`),
  KEY `batch_jobs_status_index` (`status`),
  KEY `batch_jobs_created_at_index` (`created_at`),
  KEY `batch_jobs_status_created_at_index` (`status`,`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `blog_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `blog_categories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` int NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `blogs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `blogs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `category_id` int NOT NULL,
  `sub_category_id` int DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_published` int NOT NULL,
  `show_on_homepage` int NOT NULL,
  `blog_views` int NOT NULL DEFAULT '0',
  `status` int NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `bulk_ticket_status_batches`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `bulk_ticket_status_batches` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `batch_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `operation_type` enum('block','unblock','shadow_sold','activate') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('initializing','processing','completed','failed','cancelled') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'initializing',
  `event_id` bigint unsigned DEFAULT NULL,
  `total_seats` int NOT NULL DEFAULT '0',
  `processed_seats` int NOT NULL DEFAULT '0',
  `successful_seats` int NOT NULL DEFAULT '0',
  `failed_seats` int NOT NULL DEFAULT '0',
  `failed_seat_ids` json DEFAULT NULL,
  `errors` json DEFAULT NULL,
  `csv_filename` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `started_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `created_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `bulk_ticket_status_batches_batch_id_unique` (`batch_id`),
  KEY `bulk_ticket_status_batches_created_at_index` (`created_at`),
  KEY `bulk_ticket_status_batches_status_created_at_index` (`status`,`created_at`),
  KEY `bulk_ticket_status_batches_operation_type_index` (`operation_type`),
  KEY `bulk_ticket_status_batches_status_index` (`status`),
  KEY `bulk_ticket_status_batches_event_id_index` (`event_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `cache`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `cache` (
  `key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiration` int NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `cache_locks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `cache_locks` (
  `key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `owner` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiration` int NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `campaign_audit_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `campaign_audit_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `campaign_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `event_type` enum('created','started','paused','resumed','cancelled','completed','settings_modified','invitation_sent','invitation_failed') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Type of campaign event',
  `user_id` bigint unsigned DEFAULT NULL COMMENT 'Admin user ID',
  `user_email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Admin email for reference',
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `details` json DEFAULT NULL COMMENT 'Event-specific data',
  PRIMARY KEY (`id`),
  KEY `idx_audit_campaign_name` (`campaign_name`),
  KEY `idx_event_type` (`event_type`),
  KEY `idx_timestamp` (`timestamp`),
  KEY `idx_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `carts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `carts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `event_id` int DEFAULT NULL,
  `ip` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `seat_id` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `seat` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` int NOT NULL DEFAULT '1',
  `amount` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `zone` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `category` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `sub_cat` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `seat_color` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_cart_seat` (`event_id`,`seat_id`,`seat`),
  KEY `idx_user_event` (`user_id`,`event_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `chargebacks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `chargebacks` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint unsigned NOT NULL,
  `payment_transaction_id` bigint unsigned DEFAULT NULL,
  `chargeback_amount` decimal(10,2) NOT NULL,
  `chargeback_reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `dispute_status` enum('needs_response','received','under_review','evidence_required','evidence_submitted','won','lost','accepted','withdrawn') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'received',
  `gateway` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `gateway_dispute_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gateway_charge_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gateway_payment_intent_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `evidence_submitted_at` timestamp NULL DEFAULT NULL,
  `evidence_due_by` timestamp NULL DEFAULT NULL,
  `admin_notified_at` timestamp NULL DEFAULT NULL,
  `resolved_at` timestamp NULL DEFAULT NULL,
  `resolution_outcome` enum('won','lost','accepted','withdrawn') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gateway_response` json DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `chargebacks_order_id_dispute_status_index` (`order_id`,`dispute_status`),
  KEY `chargebacks_payment_transaction_id_index` (`payment_transaction_id`),
  KEY `chargebacks_gateway_dispute_id_index` (`gateway_dispute_id`),
  KEY `chargebacks_dispute_status_index` (`dispute_status`),
  KEY `chargebacks_created_at_index` (`created_at`),
  KEY `chargebacks_gateway_payment_intent_id_index` (`gateway_payment_intent_id`),
  CONSTRAINT `chargebacks_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `chargebacks_payment_transaction_id_foreign` FOREIGN KEY (`payment_transaction_id`) REFERENCES `payment_transactions` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `clubs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `clubs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `contact_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `contact_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `contact_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `treasurer` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `logo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `bank_details` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_active` tinyint NOT NULL DEFAULT '1' COMMENT 'allow only 0 / 1 for true and false',
  `is_deleted` tinyint NOT NULL DEFAULT '0' COMMENT 'allow only 0 / 1 for true and false',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `cms_files`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `cms_files` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `stored_filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `path` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `mime_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `size` bigint unsigned NOT NULL,
  `category` enum('email','blog','general') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'general',
  `tags` json DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `is_public` tinyint(1) NOT NULL DEFAULT '1',
  `uploaded_by` bigint unsigned DEFAULT NULL,
  `usage_count` int unsigned NOT NULL DEFAULT '0',
  `last_accessed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `cms_files_stored_filename_unique` (`stored_filename`),
  KEY `cms_files_category_index` (`category`),
  KEY `cms_files_mime_type_index` (`mime_type`),
  KEY `cms_files_is_public_index` (`is_public`),
  KEY `cms_files_uploaded_by_index` (`uploaded_by`),
  KEY `cms_files_created_at_index` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `content_pages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `content_pages` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `sort_order` int NOT NULL DEFAULT '0',
  `display_section` enum('header','footer','event_info','standalone') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'footer',
  `meta_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `meta_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `meta_keywords` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by` bigint unsigned DEFAULT NULL,
  `updated_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `content_pages_slug_unique` (`slug`),
  KEY `content_pages_is_active_sort_order_index` (`is_active`,`sort_order`),
  KEY `content_pages_display_section_index` (`display_section`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `contents`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `contents` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `status` int NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `customers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `customers` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `preferred_payment_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `loyalty_points` int NOT NULL DEFAULT '0',
  `membership_tier` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `preferences` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `customers_user_id_index` (`user_id`),
  KEY `customers_membership_tier_index` (`membership_tier`),
  CONSTRAINT `customers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `device_tokens`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `device_tokens` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `device_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Human-readable device name',
  `scanner_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Unique scanner identifier',
  `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'entry_scanner' COMMENT 'Device type: entry_scanner, manager_device, etc.',
  `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'SHA256 hash of actual token',
  `is_active` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Device active status',
  `expires_at` timestamp NULL DEFAULT NULL COMMENT 'Token expiration time',
  `last_used_at` timestamp NULL DEFAULT NULL COMMENT 'Last successful authentication',
  `last_used_ip` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Last IP address used',
  `allowed_ips` json DEFAULT NULL COMMENT 'IP whitelist (CIDR supported)',
  `allowed_events` json DEFAULT NULL COMMENT 'Event IDs this device can access',
  `created_by` bigint unsigned DEFAULT NULL COMMENT 'Admin who created token',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'Admin notes about device',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `device_tokens_scanner_id_unique` (`scanner_id`),
  UNIQUE KEY `device_tokens_token_unique` (`token`),
  KEY `device_tokens_scanner_id_index` (`scanner_id`),
  KEY `device_tokens_token_index` (`token`),
  KEY `device_tokens_is_active_expires_at_index` (`is_active`,`expires_at`),
  KEY `device_tokens_type_index` (`type`),
  KEY `device_tokens_created_by_foreign` (`created_by`),
  CONSTRAINT `device_tokens_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Entry staff device authentication tokens';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `donation_amounts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `donation_amounts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `amount` int NOT NULL,
  `status` tinyint NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `email_accounts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `email_accounts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `display_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `purpose` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'transactional, support, finance, system, etc.',
  `daily_send_limit` int NOT NULL DEFAULT '500',
  `hourly_send_limit` int NOT NULL DEFAULT '50',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `auto_response` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `reply_to_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email_accounts_email_unique` (`email`),
  KEY `email_accounts_is_active_index` (`is_active`),
  KEY `email_accounts_purpose_is_active_index` (`purpose`,`is_active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `email_inbox`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `email_inbox` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `account_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `message_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `thread_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `from_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `from_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subject` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `body_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `body_html` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `received_at` timestamp NOT NULL,
  `is_read` tinyint(1) NOT NULL DEFAULT '0',
  `is_replied` tinyint(1) NOT NULL DEFAULT '0',
  `linked_order_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `linked_ticket_id` bigint unsigned DEFAULT NULL,
  `assigned_to_admin_id` bigint unsigned DEFAULT NULL,
  `priority` enum('low','normal','high','urgent') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'normal',
  `status` enum('new','open','pending','resolved','closed') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'new',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email_inbox_message_id_unique` (`message_id`),
  KEY `email_inbox_account_email_received_at_index` (`account_email`,`received_at`),
  KEY `email_inbox_thread_id_index` (`thread_id`),
  KEY `email_inbox_status_priority_index` (`status`,`priority`),
  KEY `email_inbox_linked_order_id_index` (`linked_order_id`),
  KEY `email_inbox_assigned_to_admin_id_foreign` (`assigned_to_admin_id`),
  CONSTRAINT `email_inbox_assigned_to_admin_id_foreign` FOREIGN KEY (`assigned_to_admin_id`) REFERENCES `admins` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `email_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `email_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `message_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `template_id` bigint unsigned DEFAULT NULL,
  `email_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'order, ticket, receipt, notification, etc.',
  `recipient_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `recipient_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `from_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subject` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `body_html` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `body_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `send_rate_hour` int NOT NULL DEFAULT '0',
  `error_message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `bounce_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `spam_score` decimal(3,2) DEFAULT NULL,
  `delivery_time_ms` int DEFAULT NULL,
  `sent_at` timestamp NULL DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `sent_by` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email_logs_message_id_unique` (`message_id`),
  KEY `email_logs_recipient_email_status_index` (`recipient_email`,`status`),
  KEY `email_logs_template_id_sent_at_index` (`template_id`,`sent_at`),
  KEY `email_logs_status_created_at_index` (`status`,`created_at`),
  KEY `idx_sent_at_account` (`sent_at`,`from_email`),
  KEY `idx_status_type` (`status`,`email_type`),
  CONSTRAINT `email_logs_template_id_foreign` FOREIGN KEY (`template_id`) REFERENCES `email_templates` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `email_rate_tracking`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `email_rate_tracking` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `account_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `hour_timestamp` timestamp NOT NULL COMMENT 'Rounded to hour for rate tracking',
  `emails_sent` int NOT NULL DEFAULT '0',
  `emails_bounced` int NOT NULL DEFAULT '0',
  `emails_spam_reported` int NOT NULL DEFAULT '0',
  `avg_delivery_time_ms` int NOT NULL DEFAULT '0',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_hour` (`account_email`,`hour_timestamp`),
  KEY `email_rate_tracking_account_email_hour_timestamp_index` (`account_email`,`hour_timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `email_reputation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `email_reputation` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `account_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `date` date NOT NULL,
  `emails_sent` int NOT NULL DEFAULT '0',
  `emails_delivered` int NOT NULL DEFAULT '0',
  `emails_bounced` int NOT NULL DEFAULT '0',
  `emails_failed` int NOT NULL DEFAULT '0',
  `hard_bounces` int NOT NULL DEFAULT '0',
  `soft_bounces` int NOT NULL DEFAULT '0',
  `spam_reports` int NOT NULL DEFAULT '0',
  `unsubscribes` int NOT NULL DEFAULT '0',
  `bounce_rate` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT 'Percentage',
  `spam_rate` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT 'Percentage',
  `delivery_rate` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT 'Percentage',
  `health_score` decimal(5,2) NOT NULL DEFAULT '100.00' COMMENT '0-100 score',
  `status` enum('good','warning','critical') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'good',
  `alert_sent` tinyint(1) NOT NULL DEFAULT '0',
  `alert_sent_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email_reputation_account_email_date_unique` (`account_email`,`date`),
  KEY `email_reputation_date_status_index` (`date`,`status`),
  KEY `email_reputation_account_email_date_status_index` (`account_email`,`date`,`status`),
  KEY `email_reputation_account_email_index` (`account_email`),
  KEY `email_reputation_date_index` (`date`),
  CONSTRAINT `email_reputation_account_email_foreign` FOREIGN KEY (`account_email`) REFERENCES `email_accounts` (`email`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `email_template_versions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `email_template_versions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `email_template_id` bigint unsigned NOT NULL,
  `version` int NOT NULL,
  `subject` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `html_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `text_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `variables` json DEFAULT NULL,
  `attachments` json DEFAULT NULL,
  `settings` json DEFAULT NULL,
  `changed_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `change_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email_template_versions_email_template_id_version_unique` (`email_template_id`,`version`),
  KEY `email_template_versions_version_index` (`version`),
  CONSTRAINT `email_template_versions_email_template_id_foreign` FOREIGN KEY (`email_template_id`) REFERENCES `email_templates` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `email_templates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `email_templates` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'system',
  `sender_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `sender_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `subject` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `body_html` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `body_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `placeholders` json DEFAULT NULL,
  `attachments` json DEFAULT NULL,
  `version` int NOT NULL DEFAULT '1',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `is_system` tinyint(1) NOT NULL DEFAULT '0',
  `include_event_reminder` tinyint(1) NOT NULL DEFAULT '1',
  `include_venue_directions` tinyint(1) NOT NULL DEFAULT '1',
  `include_support_contact` tinyint(1) NOT NULL DEFAULT '1',
  `attach_pdf_ticket` tinyint(1) NOT NULL DEFAULT '1',
  `times_used` int NOT NULL DEFAULT '0',
  `last_used_at` timestamp NULL DEFAULT NULL,
  `created_by` int DEFAULT NULL,
  `updated_by` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email_templates_slug_unique` (`slug`),
  KEY `email_templates_type_is_active_index` (`type`,`is_active`),
  KEY `email_templates_slug_index` (`slug`),
  KEY `email_templates_slug_is_active_index` (`slug`,`is_active`),
  KEY `email_templates_type_index` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `event_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `event_categories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `color` varchar(7) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sort_order` int NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `event_categories_name_unique` (`name`),
  UNIQUE KEY `event_categories_slug_unique` (`slug`),
  KEY `event_categories_slug_index` (`slug`),
  KEY `event_categories_is_active_index` (`is_active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `event_photos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `event_photos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `file_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `event_id` bigint unsigned NOT NULL,
  `is_featured` tinyint NOT NULL DEFAULT '0',
  `status` tinyint NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `event_photos_event_id_foreign` (`event_id`),
  CONSTRAINT `event_photos_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `event_venues`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `event_venues` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `event_id` bigint unsigned NOT NULL,
  `venue_template_id` bigint unsigned NOT NULL,
  `pricing_overrides` json DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_event_venue_template` (`event_id`,`venue_template_id`),
  KEY `idx_event_venues_event_id` (`event_id`),
  KEY `idx_event_venues_venue_template_id` (`venue_template_id`),
  KEY `idx_event_venues_event_active` (`event_id`,`is_active`),
  CONSTRAINT `fk_event_venues_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_event_venues_venue_template_id` FOREIGN KEY (`venue_template_id`) REFERENCES `venue_templates` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `event_wise_seat_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `event_wise_seat_categories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `event_id` bigint NOT NULL,
  `seats` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `ticket_category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `zone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `event_wise_seat_categories_seats_event_id_index` (`seats`,`event_id`),
  KEY `event_wise_seat_categories_event_id_index` (`event_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `events`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `events` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `theme_id` bigint unsigned DEFAULT NULL,
  `venue_id` bigint unsigned DEFAULT NULL,
  `club_id` bigint unsigned NOT NULL,
  `organizer_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `organizer_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `organizer_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `sub_title` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `event_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `event_image_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `event_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `page_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `start_time` time NOT NULL,
  `doors_open_time` time DEFAULT NULL,
  `timezone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'UTC',
  `voting_end_time` datetime NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `artists` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `inquiry_poll` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `event_email_thankyou_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `event_support_thankyou_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `meta_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `is_featured` tinyint(1) NOT NULL DEFAULT '0',
  `meta_title` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `meta_keyword` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_published` tinyint(1) NOT NULL DEFAULT '0',
  `publish_website` tinyint(1) NOT NULL DEFAULT '0',
  `slug` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `max_no_of_tickets` int NOT NULL,
  `ticket_template_id` bigint unsigned DEFAULT NULL,
  `bracelet_template_id` bigint unsigned DEFAULT NULL,
  `label_template_id` bigint unsigned DEFAULT NULL,
  `no_of_raffle_ticket` int DEFAULT NULL,
  `raffle_ticket_price` double(8,2) DEFAULT NULL,
  `video` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `main_page_banner` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `centered_banner` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `baner_wide` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `banner_tablet` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `banner_phone` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `destaque_home` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `imagem_poster` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `buttom_banner_frame` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` tinyint NOT NULL DEFAULT '1',
  `enable_booking_fee` tinyint(1) NOT NULL DEFAULT '0',
  `enable_vat` tinyint(1) NOT NULL DEFAULT '0',
  `booking_fee_rate` decimal(5,4) DEFAULT NULL,
  `booking_fee_min` decimal(8,2) DEFAULT NULL,
  `booking_fee_max` decimal(8,2) DEFAULT NULL,
  `vat_rate` decimal(5,4) DEFAULT NULL,
  `ticket_code_type` enum('qr','barcode','both') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'qr' COMMENT 'Primary code type for tickets (qr, barcode, or both)',
  `email_code_type` enum('qr','barcode') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'qr' COMMENT 'Code type to display in emails (qr or barcode only)',
  `wristband_code_type` enum('qr','barcode') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'barcode' COMMENT 'Code type for wristband printing (usually barcode)',
  `pdf_code_type` enum('qr','barcode','both') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'qr' COMMENT 'Code type for PDF tickets',
  `enable_wristband_printing` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Enable wristband printing for this event',
  `wristband_printer_id` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Zebra printer identifier for this event',
  `scanner_config` json DEFAULT NULL COMMENT 'Scanner configuration (allowed code types, duplicate window, etc.)',
  `is_deleted` tinyint NOT NULL DEFAULT '0' COMMENT 'allow only 0 / 1 for true and false',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `sell_start_date` date DEFAULT NULL,
  `sell_start_time` time DEFAULT NULL,
  `sell_end_date` date DEFAULT NULL,
  `sell_end_time` time DEFAULT NULL,
  `publish_start_date` date DEFAULT NULL,
  `publish_start_time` time DEFAULT NULL,
  `publish_end_date` date DEFAULT NULL,
  `publish_end_time` time DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `events_slug_unique` (`slug`),
  KEY `events_slug_index` (`slug`),
  KEY `events_venue_id_foreign` (`venue_id`),
  KEY `events_page_name_index` (`page_name`),
  KEY `events_is_published_index` (`is_published`),
  KEY `events_is_featured_index` (`is_featured`),
  KEY `events_theme_id_foreign` (`theme_id`),
  CONSTRAINT `events_theme_id_foreign` FOREIGN KEY (`theme_id`) REFERENCES `venue_themes` (`id`) ON DELETE SET NULL,
  CONSTRAINT `events_venue_id_foreign` FOREIGN KEY (`venue_id`) REFERENCES `venues` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `failed_invitation_attempts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `failed_invitation_attempts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `invitation_id` bigint unsigned NOT NULL,
  `campaign_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `failure_type` enum('invalid_email','server_error','timeout','hard_bounce','soft_bounce','unknown') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Categorized failure reason',
  `failure_reason` text COLLATE utf8mb4_unicode_ci COMMENT 'Human-readable failure description',
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `retry_count` int NOT NULL DEFAULT '0' COMMENT 'Number of retry attempts',
  `can_retry` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Whether retry is allowed',
  `last_error` text COLLATE utf8mb4_unicode_ci COMMENT 'Last SMTP or exception error',
  `metadata` json DEFAULT NULL COMMENT 'Additional failure context',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_failed_invitation_id` (`invitation_id`),
  KEY `idx_failed_campaign_name` (`campaign_name`),
  KEY `idx_failure_type` (`failure_type`),
  KEY `idx_can_retry` (`can_retry`),
  KEY `idx_failed_at` (`failed_at`),
  KEY `idx_failed_campaign_type` (`campaign_name`,`failure_type`),
  CONSTRAINT `failed_invitation_attempts_invitation_id_foreign` FOREIGN KEY (`invitation_id`) REFERENCES `account_setup_invitations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `failed_jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `failed_jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `faqs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `faqs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `question` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `answer` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `priority` int NOT NULL DEFAULT '0',
  `status` tinyint NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `fire_marshal_access_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `fire_marshal_access_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `token_id` bigint unsigned NOT NULL COMMENT 'Fire marshal token ID',
  `event_id` bigint unsigned DEFAULT NULL COMMENT 'Event accessed',
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'IP address of access',
  `user_agent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'Browser user agent',
  `accessed_at` timestamp NOT NULL COMMENT 'When report was accessed',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fire_marshal_access_logs_token_id_index` (`token_id`),
  KEY `fire_marshal_access_logs_event_id_index` (`event_id`),
  KEY `fire_marshal_access_logs_accessed_at_index` (`accessed_at`),
  KEY `fire_marshal_access_logs_ip_address_index` (`ip_address`),
  CONSTRAINT `fire_marshal_access_logs_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE SET NULL,
  CONSTRAINT `fire_marshal_access_logs_token_id_foreign` FOREIGN KEY (`token_id`) REFERENCES `fire_marshal_tokens` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Audit log of fire marshal report access';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `fire_marshal_tokens`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `fire_marshal_tokens` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'SHA256 hash of access token',
  `event_id` bigint unsigned DEFAULT NULL COMMENT 'Event ID (null = all events)',
  `authorized_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Fire marshal name',
  `authorized_agency` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Fire safety agency/department',
  `authorized_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Contact email',
  `authorized_phone` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Contact phone',
  `is_active` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Token active status',
  `expires_at` timestamp NULL DEFAULT NULL COMMENT 'Token expiration (e.g., 24 hours)',
  `max_uses` int DEFAULT NULL COMMENT 'Maximum number of uses (null = unlimited)',
  `use_count` int NOT NULL DEFAULT '0' COMMENT 'Number of times token has been used',
  `created_by` bigint unsigned DEFAULT NULL COMMENT 'Admin who issued token',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'Admin notes about access grant',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `fire_marshal_tokens_token_unique` (`token`),
  KEY `fire_marshal_tokens_token_index` (`token`),
  KEY `fire_marshal_tokens_event_id_index` (`event_id`),
  KEY `fire_marshal_tokens_is_active_expires_at_index` (`is_active`,`expires_at`),
  KEY `fire_marshal_tokens_authorized_agency_index` (`authorized_agency`),
  KEY `fire_marshal_tokens_created_by_foreign` (`created_by`),
  CONSTRAINT `fire_marshal_tokens_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `fire_marshal_tokens_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Fire marshal report access tokens';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `fundraising_profiles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `fundraising_profiles` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `profile_photo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'avatar.png',
  `cover_photo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sample1.jpg',
  `story` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `goal` int NOT NULL DEFAULT '0',
  `amount_raised` int NOT NULL DEFAULT '0',
  `type` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'U' COMMENT 'U-User, T-Team',
  `status` tinyint NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `fundraising_profiles_name_unique` (`name`),
  KEY `fundraising_profiles_user_id_foreign` (`user_id`),
  CONSTRAINT `fundraising_profiles_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `fundraising_transactions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `fundraising_transactions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `profile_id` bigint unsigned NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `message` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `amount` int NOT NULL,
  `reference` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Stripe ID',
  `anonymous` tinyint NOT NULL,
  `status` tinyint NOT NULL DEFAULT '0' COMMENT '0-Created,1-Paid',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fundraising_transactions_profile_id_foreign` (`profile_id`),
  CONSTRAINT `fundraising_transactions_profile_id_foreign` FOREIGN KEY (`profile_id`) REFERENCES `fundraising_profiles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `galleries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `galleries` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `images` json NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `display_order` int NOT NULL DEFAULT '0',
  `created_by` bigint unsigned DEFAULT NULL,
  `updated_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `galleries_is_active_display_order_index` (`is_active`,`display_order`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `gdpr_audit_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `gdpr_audit_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `event_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Type of GDPR event (export, anonymize, delete, access)',
  `entity_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Type of entity accessed (order, payment_transaction, user)',
  `entity_id` bigint unsigned DEFAULT NULL COMMENT 'ID of the entity accessed',
  `user_id` bigint unsigned DEFAULT NULL COMMENT 'User who initiated the action',
  `user_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Type of user (customer, admin, system)',
  `user_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Email of user who initiated action',
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'IP address of requester',
  `user_agent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'Browser user agent',
  `request_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'HTTP method (GET, POST, etc.)',
  `request_url` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'URL that was accessed',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'Human-readable description of action',
  `metadata` json DEFAULT NULL COMMENT 'Additional context data',
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'success' COMMENT 'Status of the action (success, failed, pending)',
  `error_message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'Error message if action failed',
  `data_retention_until` timestamp NULL DEFAULT NULL COMMENT 'When this audit log should be deleted',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `gdpr_audit_logs_event_type_index` (`event_type`),
  KEY `gdpr_audit_logs_entity_type_index` (`entity_type`),
  KEY `gdpr_audit_logs_entity_type_entity_id_index` (`entity_type`,`entity_id`),
  KEY `gdpr_audit_logs_user_id_index` (`user_id`),
  KEY `gdpr_audit_logs_created_at_index` (`created_at`),
  KEY `gdpr_audit_logs_data_retention_until_index` (`data_retention_until`),
  KEY `gdpr_audit_logs_event_type_created_at_index` (`event_type`,`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `queue` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` tinyint unsigned NOT NULL,
  `reserved_at` int unsigned DEFAULT NULL,
  `available_at` int unsigned NOT NULL,
  `created_at` int unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `manager_overrides`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `manager_overrides` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `ticket_id` bigint unsigned NOT NULL,
  `manager_id` bigint unsigned NOT NULL,
  `supervisor_id` bigint unsigned DEFAULT NULL,
  `override_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `override_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `pin_verification` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `validation_failure_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `validation_failure_reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `validation_context` json DEFAULT NULL,
  `supervisor_alerted` tinyint(1) NOT NULL DEFAULT '0',
  `supervisor_alerted_at` timestamp NULL DEFAULT NULL,
  `alert_details` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `session_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `device_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `scanner_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `overridden_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `manager_overrides_manager_id_created_at_index` (`manager_id`,`created_at`),
  KEY `manager_overrides_ticket_id_created_at_index` (`ticket_id`,`created_at`),
  KEY `manager_overrides_overridden_at_index` (`overridden_at`),
  KEY `manager_overrides_ticket_id_index` (`ticket_id`),
  KEY `manager_overrides_manager_id_index` (`manager_id`),
  KEY `manager_overrides_supervisor_id_index` (`supervisor_id`),
  KEY `manager_overrides_override_reason_index` (`override_reason`),
  CONSTRAINT `manager_overrides_manager_id_foreign` FOREIGN KEY (`manager_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `manager_overrides_supervisor_id_foreign` FOREIGN KEY (`supervisor_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `manager_overrides_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mbs_activity_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `mbs_activity_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `staff_user_id` bigint unsigned NOT NULL,
  `staff_user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `staff_user_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `event_id` bigint unsigned DEFAULT NULL,
  `event_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `order_id` bigint unsigned DEFAULT NULL,
  `order_reference` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `seat_id` bigint unsigned DEFAULT NULL,
  `seat_identifier` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `action_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `action_category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `action_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `request_method` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `request_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `old_values` json DEFAULT NULL,
  `new_values` json DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `success` tinyint(1) NOT NULL DEFAULT '1',
  `error_message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `correlation_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `severity` enum('low','medium','high','critical') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'medium',
  `requires_review` tinyint(1) NOT NULL DEFAULT '0',
  `reviewed_at` timestamp NULL DEFAULT NULL,
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `mbs_activity_logs_staff_user_id_index` (`staff_user_id`),
  KEY `mbs_activity_logs_event_id_index` (`event_id`),
  KEY `mbs_activity_logs_order_id_index` (`order_id`),
  KEY `mbs_activity_logs_created_at_index` (`created_at`),
  KEY `mbs_activity_logs_action_type_created_at_index` (`action_type`,`created_at`),
  KEY `mbs_activity_logs_staff_user_id_created_at_index` (`staff_user_id`,`created_at`),
  KEY `mbs_activity_logs_event_id_created_at_index` (`event_id`,`created_at`),
  KEY `mbs_activity_logs_success_created_at_index` (`success`,`created_at`),
  KEY `mbs_activity_logs_requires_review_index` (`requires_review`),
  KEY `mbs_activity_logs_action_type_index` (`action_type`),
  KEY `mbs_activity_logs_action_category_index` (`action_category`),
  KEY `mbs_activity_logs_correlation_id_index` (`correlation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `migrations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `newsletter_campaign_recipients`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `newsletter_campaign_recipients` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `campaign_id` bigint unsigned NOT NULL,
  `contact_id` bigint unsigned NOT NULL,
  `status` enum('pending','sent','failed','bounced') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `sent_at` timestamp NULL DEFAULT NULL,
  `opened_at` timestamp NULL DEFAULT NULL,
  `clicked_at` timestamp NULL DEFAULT NULL,
  `open_count` int NOT NULL DEFAULT '0',
  `click_count` int NOT NULL DEFAULT '0',
  `error_message` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `newsletter_campaign_recipients_campaign_id_contact_id_unique` (`campaign_id`,`contact_id`),
  KEY `newsletter_campaign_recipients_campaign_id_status_index` (`campaign_id`,`status`),
  KEY `newsletter_campaign_recipients_contact_id_campaign_id_index` (`contact_id`,`campaign_id`),
  CONSTRAINT `newsletter_campaign_recipients_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `newsletter_campaigns` (`id`) ON DELETE CASCADE,
  CONSTRAINT `newsletter_campaign_recipients_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `newsletter_contacts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `newsletter_campaigns`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `newsletter_campaigns` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `template_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Template identifier (e.g., welcome, event-announcement)',
  `field_values` json DEFAULT NULL COMMENT 'User-provided field values for the template',
  `subject` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `preview_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `html_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `text_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `template_components` json DEFAULT NULL,
  `email_template_id` bigint unsigned DEFAULT NULL,
  `template_data` json DEFAULT NULL,
  `audience_type` enum('all','active','new','custom','import_batch') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'all',
  `audience_filters` json DEFAULT NULL,
  `target_import_batch_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('draft','scheduled','sending','sent','failed','cancelled') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `scheduled_at` timestamp NULL DEFAULT NULL,
  `started_sending_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `from_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Global Gala',
  `from_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'info@showprima.com',
  `reply_to_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total_recipients` int NOT NULL DEFAULT '0',
  `sent_count` int NOT NULL DEFAULT '0',
  `failed_count` int NOT NULL DEFAULT '0',
  `opened_count` int NOT NULL DEFAULT '0',
  `clicked_count` int NOT NULL DEFAULT '0',
  `unsubscribed_count` int NOT NULL DEFAULT '0',
  `bounced_count` int NOT NULL DEFAULT '0',
  `complained_count` int NOT NULL DEFAULT '0',
  `created_by` bigint unsigned DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `newsletter_campaigns_email_template_id_foreign` (`email_template_id`),
  KEY `newsletter_campaigns_status_index` (`status`),
  KEY `newsletter_campaigns_scheduled_at_index` (`scheduled_at`),
  KEY `newsletter_campaigns_created_by_index` (`created_by`),
  KEY `newsletter_campaigns_status_scheduled_at_index` (`status`,`scheduled_at`),
  CONSTRAINT `newsletter_campaigns_email_template_id_foreign` FOREIGN KEY (`email_template_id`) REFERENCES `email_templates` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `newsletter_contacts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `newsletter_contacts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `first_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `full_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('subscribed','unsubscribed','bounced','complained') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'subscribed',
  `subscription_token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `consent_status` enum('explicit','legacy','imported') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'imported',
  `subscribed_at` timestamp NULL DEFAULT NULL,
  `unsubscribed_at` timestamp NULL DEFAULT NULL,
  `unsubscribe_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `source` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `import_batch_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `emails_sent` int NOT NULL DEFAULT '0',
  `emails_opened` int NOT NULL DEFAULT '0',
  `emails_clicked` int NOT NULL DEFAULT '0',
  `bounce_count` int NOT NULL DEFAULT '0',
  `last_sent_at` timestamp NULL DEFAULT NULL,
  `last_opened_at` timestamp NULL DEFAULT NULL,
  `consent_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `signup_ip` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `signup_user_agent` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `newsletter_contacts_email_unique` (`email`),
  UNIQUE KEY `newsletter_contacts_subscription_token_unique` (`subscription_token`),
  KEY `newsletter_contacts_status_index` (`status`),
  KEY `newsletter_contacts_import_batch_id_index` (`import_batch_id`),
  KEY `newsletter_contacts_status_consent_status_index` (`status`,`consent_status`),
  KEY `newsletter_contacts_created_at_index` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `newsletter_subscription_history`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `newsletter_subscription_history` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `contact_id` bigint unsigned NOT NULL,
  `action` enum('subscribed','unsubscribed','resubscribed','bounced','complained') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `created_at` timestamp NOT NULL,
  PRIMARY KEY (`id`),
  KEY `newsletter_subscription_history_contact_id_action_index` (`contact_id`,`action`),
  KEY `newsletter_subscription_history_created_at_index` (`created_at`),
  KEY `newsletter_subscription_history_action_index` (`action`),
  CONSTRAINT `newsletter_subscription_history_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `newsletter_contacts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `newsletter_subscriptions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `newsletter_subscriptions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `contact_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `subscription_type` enum('newsletter','event_updates','promotional','transactional') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'newsletter',
  `status` enum('active','paused','unsubscribed') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `subscribed_at` timestamp NOT NULL,
  `unsubscribed_at` timestamp NULL DEFAULT NULL,
  `source` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `newsletter_subscriptions_contact_id_subscription_type_unique` (`contact_id`,`subscription_type`),
  KEY `newsletter_subscriptions_contact_id_subscription_type_index` (`contact_id`,`subscription_type`),
  KEY `newsletter_subscriptions_user_id_status_index` (`user_id`,`status`),
  CONSTRAINT `newsletter_subscriptions_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `newsletter_contacts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `newsletter_subscriptions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `order_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `order_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint NOT NULL,
  `event_id` bigint NOT NULL,
  `user_id` bigint DEFAULT NULL,
  `amount` decimal(10,2) NOT NULL,
  `seat` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `zone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ticket_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `sub_cat` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` int NOT NULL DEFAULT '1',
  `status` tinyint NOT NULL DEFAULT '1',
  `pdf_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pdf_generation_status` enum('pending','processing','ready','failed') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `pdf_generation_error` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `pdf_generated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `order_items_event_id_seat_status_index` (`event_id`,`seat`,`status`),
  KEY `order_items_order_id_index` (`order_id`),
  KEY `order_items_user_id_index` (`user_id`),
  KEY `order_items_pdf_generation_status_index` (`pdf_generation_status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `order_line_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `order_line_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint unsigned NOT NULL COMMENT 'Foreign key to orders table',
  `session_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Session ID for order tracking',
  `seat_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Seat ID if this is a ticket line item',
  `item_type` enum('ticket','booking_fee','service_fee','tax','discount') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Type of line item',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Human-readable description',
  `unit_price` decimal(10,2) NOT NULL COMMENT 'Price per unit',
  `quantity` int NOT NULL DEFAULT '1' COMMENT 'Quantity of items',
  `line_total` decimal(10,2) NOT NULL COMMENT 'Total for this line (unit_price * quantity)',
  `metadata` json DEFAULT NULL COMMENT 'Additional metadata (seat_number, rates, etc.)',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `order_line_items_order_id_index` (`order_id`),
  KEY `order_line_items_session_id_index` (`session_id`),
  KEY `order_line_items_seat_id_index` (`seat_id`),
  KEY `order_line_items_item_type_index` (`item_type`),
  KEY `order_line_items_order_id_item_type_index` (`order_id`,`item_type`),
  CONSTRAINT `order_line_items_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `order_line_items_seat_id_foreign` FOREIGN KEY (`seat_id`) REFERENCES `seats` (`seat_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `order_modifications`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `order_modifications` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint unsigned DEFAULT NULL,
  `session_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `modification_type` enum('add_seats','remove_seats','apply_discount','apply_credit','adjust_total','reassign_seat') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('pending','approved','rejected','applied') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `amount_change` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT 'Positive for additions, negative for reductions',
  `old_total` decimal(10,2) DEFAULT NULL,
  `new_total` decimal(10,2) DEFAULT NULL,
  `modification_data` json DEFAULT NULL COMMENT 'Details of the modification (seats added/removed, discount info, etc.)',
  `reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `requested_by` bigint unsigned DEFAULT NULL COMMENT 'Admin user who requested the modification',
  `approved_by` bigint unsigned DEFAULT NULL COMMENT 'Admin user who approved the modification',
  `rejected_by` bigint unsigned DEFAULT NULL COMMENT 'Admin user who rejected the modification',
  `approved_at` timestamp NULL DEFAULT NULL,
  `rejected_at` timestamp NULL DEFAULT NULL,
  `applied_at` timestamp NULL DEFAULT NULL,
  `rejection_reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `idempotency_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `order_modifications_idempotency_key_unique` (`idempotency_key`),
  KEY `order_modifications_requested_by_foreign` (`requested_by`),
  KEY `order_modifications_approved_by_foreign` (`approved_by`),
  KEY `order_modifications_rejected_by_foreign` (`rejected_by`),
  KEY `order_modifications_modification_type_index` (`modification_type`),
  KEY `order_modifications_status_index` (`status`),
  KEY `order_modifications_order_id_status_index` (`order_id`,`status`),
  KEY `order_modifications_created_at_index` (`created_at`),
  KEY `order_modifications_session_id_index` (`session_id`),
  CONSTRAINT `order_modifications_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `order_modifications_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `order_modifications_rejected_by_foreign` FOREIGN KEY (`rejected_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `order_modifications_requested_by_foreign` FOREIGN KEY (`requested_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `order_notes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `order_notes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint unsigned NOT NULL,
  `admin_id` bigint unsigned NOT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_internal` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Internal staff notes vs customer-visible notes',
  `is_edited` tinyint(1) NOT NULL DEFAULT '0',
  `edited_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `order_notes_order_id_created_at_index` (`order_id`,`created_at`),
  KEY `order_notes_admin_id_index` (`admin_id`),
  CONSTRAINT `order_notes_admin_id_foreign` FOREIGN KEY (`admin_id`) REFERENCES `admins` (`id`) ON DELETE RESTRICT,
  CONSTRAINT `order_notes_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `order_refunds`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `order_refunds` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint unsigned NOT NULL,
  `event_id` bigint unsigned DEFAULT NULL,
  `refund_amount` decimal(10,2) NOT NULL,
  `refund_type` enum('full','partial') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'full',
  `refund_reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `payment_gateway` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gateway_refund_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gateway_response` json DEFAULT NULL,
  `status` enum('pending','processing','completed','failed','cancelled') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `processed_by` bigint unsigned DEFAULT NULL,
  `processed_at` timestamp NULL DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `order_refunds_event_id_foreign` (`event_id`),
  KEY `order_refunds_processed_by_foreign` (`processed_by`),
  KEY `order_refunds_order_id_status_index` (`order_id`,`status`),
  KEY `order_refunds_gateway_refund_id_index` (`gateway_refund_id`),
  KEY `order_refunds_created_at_index` (`created_at`),
  CONSTRAINT `order_refunds_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE SET NULL,
  CONSTRAINT `order_refunds_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `order_refunds_processed_by_foreign` FOREIGN KEY (`processed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `order_status_audit_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `order_status_audit_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint unsigned NOT NULL,
  `old_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `new_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `changed_by_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'system',
  `changed_by_id` bigint unsigned DEFAULT NULL,
  `trigger_source` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `trigger_event_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `metadata` json DEFAULT NULL,
  `changed_at` timestamp NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_audit_order_id` (`order_id`),
  KEY `idx_audit_new_status` (`new_status`),
  KEY `idx_audit_changed_at` (`changed_at`),
  KEY `idx_audit_order_timeline` (`order_id`,`changed_at`),
  CONSTRAINT `order_status_audit_logs_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `orders`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `orders` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `payment_intent_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `stripe_charge_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `stripe_customer_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `event_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `created_by_admin_id` bigint unsigned DEFAULT NULL,
  `session_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customer_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customer_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customer_phone` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `admin_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `total_amount` decimal(10,2) NOT NULL,
  `idempotency_key` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `payment_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `payment_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_mode` enum('immediate','cash','invoice','comp','shadow_sold') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'immediate',
  `revolut_payment_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `revolut_order_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `revolut_status` enum('pending','processing','completed','failed','declined','cancelled','refunded') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `revolut_payment_completed_at` timestamp NULL DEFAULT NULL,
  `payment_reference` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `confirmation_email_sent` tinyint(1) NOT NULL DEFAULT '0',
  `confirmation_email_sent_at` timestamp NULL DEFAULT NULL,
  `confirmation_email_opened_at` timestamp NULL DEFAULT NULL,
  `confirmation_email_tracking_id` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tickets_generated` tinyint(1) NOT NULL DEFAULT '0',
  `tickets_generated_at` timestamp NULL DEFAULT NULL,
  `tickets_pdf_path` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tickets_pdf_size_kb` int DEFAULT NULL,
  `wallet_pass_available` tinyint(1) NOT NULL DEFAULT '0',
  `wallet_pass_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `data_retention_until` timestamp NULL DEFAULT NULL COMMENT 'Date when this record should be anonymized/deleted per GDPR',
  `is_anonymized` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Whether personal data has been anonymized',
  `anonymized_at` timestamp NULL DEFAULT NULL COMMENT 'When the record was anonymized',
  `anonymized_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Reason for anonymization (e.g., retention_policy, user_request)',
  PRIMARY KEY (`id`),
  UNIQUE KEY `orders_idempotency_key_unique` (`idempotency_key`),
  KEY `orders_event_id_index` (`event_id`),
  KEY `orders_user_id_index` (`user_id`),
  KEY `orders_status_index` (`status`),
  KEY `orders_customer_email_index` (`customer_email`),
  KEY `orders_revolut_payment_id_index` (`revolut_payment_id`),
  KEY `orders_revolut_order_id_index` (`revolut_order_id`),
  KEY `idx_orders_created_at` (`created_at`),
  KEY `orders_payment_intent_id_index` (`payment_intent_id`),
  KEY `orders_stripe_charge_id_index` (`stripe_charge_id`),
  KEY `orders_payment_status_index` (`payment_status`),
  KEY `orders_stripe_customer_id_index` (`stripe_customer_id`),
  KEY `orders_data_retention_until_index` (`data_retention_until`),
  KEY `orders_is_anonymized_data_retention_until_index` (`is_anonymized`,`data_retention_until`),
  KEY `orders_created_by_admin_id_foreign` (`created_by_admin_id`),
  KEY `orders_payment_mode_index` (`payment_mode`),
  KEY `orders_confirmation_email_sent_index` (`confirmation_email_sent`),
  KEY `orders_tickets_generated_index` (`tickets_generated`),
  KEY `orders_confirmation_email_tracking_id_index` (`confirmation_email_tracking_id`),
  CONSTRAINT `orders_created_by_admin_id_foreign` FOREIGN KEY (`created_by_admin_id`) REFERENCES `admins` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `password_resets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `password_resets` (
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  KEY `password_resets_email_index` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `payment_audit_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `payment_audit_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `payment_transaction_id` bigint unsigned DEFAULT NULL,
  `order_id` bigint unsigned DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `action` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `old_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `new_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `source` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `trigger_event_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `action_at` timestamp NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_audit_payment_id` (`payment_transaction_id`),
  KEY `idx_audit_order_id` (`order_id`),
  KEY `idx_audit_user_id` (`user_id`),
  KEY `idx_audit_action` (`action`),
  KEY `idx_audit_new_status` (`new_status`),
  KEY `idx_audit_action_at` (`action_at`),
  KEY `idx_audit_payment_timeline` (`payment_transaction_id`,`action_at`),
  KEY `idx_audit_order_timeline` (`order_id`,`action_at`),
  CONSTRAINT `payment_audit_logs_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payment_audit_logs_payment_transaction_id_foreign` FOREIGN KEY (`payment_transaction_id`) REFERENCES `payment_transactions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payment_audit_logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `payment_reconciliations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `payment_reconciliations` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `reconciliation_date` date NOT NULL COMMENT 'Date being reconciled',
  `payment_gateway` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Payment gateway (stripe, paypal, etc.)',
  `total_database_transactions` int NOT NULL DEFAULT '0' COMMENT 'Total transactions in database',
  `total_database_amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT 'Total amount in database',
  `total_gateway_transactions` int NOT NULL DEFAULT '0' COMMENT 'Total transactions reported by gateway',
  `total_gateway_amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT 'Total amount reported by gateway',
  `transaction_count_difference` int NOT NULL DEFAULT '0' COMMENT 'Difference in transaction counts',
  `amount_difference` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT 'Difference in amounts (database - gateway)',
  `discrepancies_found` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Whether discrepancies were found',
  `discrepancies_details` json DEFAULT NULL COMMENT 'JSON array of specific discrepancies',
  `status` enum('pending','processing','completed','failed','requires_review') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `report_file_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Path to exported reconciliation report',
  `processed_by` bigint unsigned DEFAULT NULL COMMENT 'User ID who processed',
  `processed_at` timestamp NULL DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payment_reconciliations_reconciliation_date_index` (`reconciliation_date`),
  KEY `payment_reconciliations_payment_gateway_index` (`payment_gateway`),
  KEY `payment_reconciliations_status_index` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `payment_transactions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `payment_transactions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint unsigned NOT NULL,
  `payment_gateway` enum('stripe','paypal','revolut','cash','bank_transfer','comp') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Payment gateway used',
  `transaction_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'External payment gateway transaction ID',
  `amount` decimal(10,2) NOT NULL COMMENT 'Transaction amount',
  `currency` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'EUR' COMMENT 'ISO 4217 currency code',
  `status` enum('pending','processing','completed','failed','refunded','partially_refunded') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `metadata` json DEFAULT NULL COMMENT 'Additional transaction metadata',
  `initiated_at` timestamp NULL DEFAULT NULL COMMENT 'When payment was initiated',
  `completed_at` timestamp NULL DEFAULT NULL COMMENT 'When payment completed successfully',
  `failed_at` timestamp NULL DEFAULT NULL COMMENT 'When payment failed',
  `failure_reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'Reason for payment failure',
  `webhook_received_at` timestamp NULL DEFAULT NULL COMMENT 'When webhook notification was received',
  `refund_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'External refund transaction ID',
  `refunded_at` timestamp NULL DEFAULT NULL COMMENT 'When refund was processed',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `data_retention_until` timestamp NULL DEFAULT NULL COMMENT 'Date when this record should be anonymized/deleted per GDPR',
  `is_anonymized` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Whether personal data has been anonymized',
  `anonymized_at` timestamp NULL DEFAULT NULL COMMENT 'When the record was anonymized',
  `anonymized_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Reason for anonymization (e.g., retention_policy, user_request)',
  PRIMARY KEY (`id`),
  UNIQUE KEY `payment_transactions_transaction_id_unique` (`transaction_id`),
  KEY `payment_transactions_order_id_index` (`order_id`),
  KEY `payment_transactions_payment_gateway_index` (`payment_gateway`),
  KEY `payment_transactions_status_index` (`status`),
  KEY `payment_transactions_transaction_id_index` (`transaction_id`),
  KEY `payment_transactions_initiated_at_index` (`initiated_at`),
  KEY `payment_transactions_data_retention_until_index` (`data_retention_until`),
  KEY `payment_transactions_is_anonymized_data_retention_until_index` (`is_anonymized`,`data_retention_until`),
  CONSTRAINT `payment_transactions_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `permissions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `admin_id` int DEFAULT NULL,
  `value` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `parent` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `photos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `photos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `file_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `status` tinyint NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `photos_user_id_foreign` (`user_id`),
  CONSTRAINT `photos_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `posts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `posts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'News/Announcement/Notification',
  `title` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sample-blog.png',
  `body` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `footer` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` tinyint NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `qr_validations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `qr_validations` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `ticket_id` bigint unsigned NOT NULL,
  `scanned_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `scanner_device` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `location` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_valid` tinyint(1) NOT NULL,
  `validation_result` json NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_ticket_scanned` (`ticket_id`,`scanned_at`),
  KEY `qr_validations_is_valid_index` (`is_valid`),
  CONSTRAINT `qr_validations_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `queue_merge_acts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `queue_merge_acts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `act1` bigint unsigned NOT NULL,
  `act2` bigint unsigned NOT NULL,
  `new_act_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `new_act_slug` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `queue_monitor`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `queue_monitor` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `job_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `job_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('pending','running','completed','failed','retrying') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` int NOT NULL DEFAULT '0',
  `max_retries` int NOT NULL DEFAULT '3',
  `payload` json DEFAULT NULL,
  `exception` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `exception_message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `started_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `failed_at` timestamp NULL DEFAULT NULL,
  `execution_time_ms` int DEFAULT NULL,
  `memory_peak` int DEFAULT NULL,
  `retry_at` timestamp NULL DEFAULT NULL,
  `retry_delay_seconds` int DEFAULT NULL,
  `retry_strategy` enum('fixed','exponential','custom') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'exponential',
  `alert_sent` tinyint(1) NOT NULL DEFAULT '0',
  `alert_sent_at` timestamp NULL DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `correlation_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `batch_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `queue_monitor_job_id_index` (`job_id`),
  KEY `queue_monitor_job_name_index` (`job_name`),
  KEY `queue_monitor_queue_index` (`queue`),
  KEY `queue_monitor_status_index` (`status`),
  KEY `queue_monitor_created_at_index` (`created_at`),
  KEY `queue_monitor_failed_at_index` (`failed_at`),
  KEY `queue_monitor_status_queue_index` (`status`,`queue`),
  KEY `queue_monitor_job_name_status_index` (`job_name`,`status`),
  KEY `queue_monitor_correlation_id_index` (`correlation_id`),
  KEY `queue_monitor_batch_id_index` (`batch_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `seat_reassignments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `seat_reassignments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_item_id` bigint unsigned NOT NULL COMMENT 'Reference to order_items.id',
  `original_seat_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Original seat UUID from seats table',
  `new_seat_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'New seat UUID from seats table',
  `reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Reason for seat reassignment',
  `status` enum('pending','approved','rejected','cancelled') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending' COMMENT 'Reassignment approval status',
  `reassigned_by` bigint unsigned NOT NULL COMMENT 'Admin ID who initiated reassignment',
  `reassigned_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'When reassignment was initiated',
  `approved_by` bigint unsigned DEFAULT NULL COMMENT 'Admin ID who approved/rejected',
  `approved_at` timestamp NULL DEFAULT NULL COMMENT 'When reassignment was approved/rejected',
  `approval_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'Notes from approver',
  `customer_notified` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Whether customer was notified',
  `customer_notified_at` timestamp NULL DEFAULT NULL COMMENT 'When customer was notified',
  `metadata` json DEFAULT NULL COMMENT 'Additional JSON metadata',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `seat_reassignments_order_item_id_index` (`order_item_id`),
  KEY `seat_reassignments_original_seat_id_index` (`original_seat_id`),
  KEY `seat_reassignments_new_seat_id_index` (`new_seat_id`),
  KEY `seat_reassignments_status_index` (`status`),
  KEY `seat_reassignments_reassigned_by_index` (`reassigned_by`),
  KEY `seat_reassignments_approved_by_index` (`approved_by`),
  KEY `seat_reassignments_reassigned_at_index` (`reassigned_at`),
  KEY `seat_reassignments_status_reassigned_at_index` (`status`,`reassigned_at`),
  KEY `seat_reassignments_order_item_id_status_index` (`order_item_id`,`status`),
  CONSTRAINT `seat_reassignments_order_item_id_foreign` FOREIGN KEY (`order_item_id`) REFERENCES `order_items` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `seat_reservations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `seat_reservations` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `event_id` bigint unsigned NOT NULL,
  `seat_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('held','booked','shadow_sold','blocked','cancelled') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'held',
  `hold_token` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `order_id` bigint unsigned DEFAULT NULL,
  `user_session_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `session_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `price_snapshot` decimal(10,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_event_seat` (`event_id`,`seat_id`),
  KEY `seat_reservations_order_id_foreign` (`order_id`),
  KEY `seat_reservations_user_id_foreign` (`user_id`),
  KEY `seat_reservations_expires_at_index` (`expires_at`),
  KEY `seat_reservations_status_expires_at_index` (`expires_at`),
  KEY `idx_sr_session_id` (`session_id`),
  KEY `idx_sr_event_status` (`event_id`,`status`),
  KEY `idx_sr_created_at` (`created_at`),
  KEY `idx_sr_hold_token` (`hold_token`),
  CONSTRAINT `seat_reservations_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE,
  CONSTRAINT `seat_reservations_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `ticket_booking` (`id`) ON DELETE SET NULL,
  CONSTRAINT `seat_reservations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `seat_transfer_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `seat_transfer_requests` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint unsigned NOT NULL,
  `event_id` bigint unsigned NOT NULL,
  `from_seat_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `to_seat_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `session_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customer_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `customer_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `original_price` decimal(10,2) NOT NULL,
  `new_price` decimal(10,2) NOT NULL,
  `upgrade_fee` decimal(10,2) NOT NULL DEFAULT '0.00',
  `price_difference` decimal(10,2) NOT NULL DEFAULT '0.00',
  `reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `status` enum('pending','approved','rejected','completed','cancelled') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  `admin_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `rejection_reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `completed_at` timestamp NULL DEFAULT NULL,
  `completion_reference` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `seat_transfer_requests_reviewed_by_foreign` (`reviewed_by`),
  KEY `seat_transfer_requests_order_id_index` (`order_id`),
  KEY `seat_transfer_requests_event_id_index` (`event_id`),
  KEY `seat_transfer_requests_from_seat_id_index` (`from_seat_id`),
  KEY `seat_transfer_requests_to_seat_id_index` (`to_seat_id`),
  KEY `seat_transfer_requests_user_id_index` (`user_id`),
  KEY `seat_transfer_requests_session_id_index` (`session_id`),
  KEY `seat_transfer_requests_customer_email_index` (`customer_email`),
  KEY `seat_transfer_requests_status_index` (`status`),
  CONSTRAINT `seat_transfer_requests_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE,
  CONSTRAINT `seat_transfer_requests_from_seat_id_foreign` FOREIGN KEY (`from_seat_id`) REFERENCES `seats` (`seat_id`) ON DELETE CASCADE,
  CONSTRAINT `seat_transfer_requests_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `seat_transfer_requests_reviewed_by_foreign` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `seat_transfer_requests_to_seat_id_foreign` FOREIGN KEY (`to_seat_id`) REFERENCES `seats` (`seat_id`) ON DELETE CASCADE,
  CONSTRAINT `seat_transfer_requests_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `seats`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `seats` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `seat_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent_table_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `event_id` bigint unsigned NOT NULL,
  `row_letter` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `seat_number` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `seat_type` enum('individual','table','table_child') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'individual',
  `price` decimal(10,2) NOT NULL,
  `zone` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `parametric` json DEFAULT NULL,
  `child_seats` json DEFAULT NULL,
  `position` json DEFAULT NULL,
  `section_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_accessible` tinyint(1) NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `total_tables` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `seats_event_id_seat_id_unique` (`event_id`,`seat_id`),
  UNIQUE KEY `seats_seat_id_unique` (`seat_id`),
  KEY `seats_event_id_is_active_index` (`event_id`,`is_active`),
  KEY `seats_seat_id_index` (`seat_id`),
  KEY `seats_event_id_index` (`event_id`),
  KEY `seats_event_id_seat_type_index` (`event_id`,`seat_type`),
  KEY `seats_event_id_section_id_index` (`event_id`,`section_id`),
  KEY `seats_parent_table_id_seat_type_index` (`parent_table_id`,`seat_type`),
  KEY `seats_parent_table_id_index` (`parent_table_id`),
  KEY `seats_section_id_index` (`section_id`),
  KEY `idx_seats_price` (`price`),
  KEY `idx_seats_event_price` (`event_id`,`price`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `special_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `special_messages` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `block` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `content` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `strava_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `strava_users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `strava_id` bigint unsigned NOT NULL,
  `access_token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `refresh_token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `profile_photo` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `expires_at` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `strava_users_user_id_foreign` (`user_id`),
  CONSTRAINT `strava_users_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `stripe_webhook_events`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `stripe_webhook_events` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `event_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `event_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `received_at` timestamp NULL DEFAULT NULL,
  `processed_at` timestamp NULL DEFAULT NULL,
  `processing_result` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `stripe_webhook_events_event_id_unique` (`event_id`),
  KEY `stripe_webhook_events_event_id_index` (`event_id`),
  KEY `stripe_webhook_events_event_type_index` (`event_type`),
  KEY `stripe_webhook_events_received_at_index` (`received_at`),
  KEY `stripe_webhook_events_processed_at_index` (`processed_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `teams`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `teams` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `telescope_entries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `telescope_entries` (
  `sequence` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `family_hash` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `should_display_on_index` tinyint(1) NOT NULL DEFAULT '1',
  `type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `content` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`sequence`),
  UNIQUE KEY `telescope_entries_uuid_unique` (`uuid`),
  KEY `telescope_entries_batch_id_index` (`batch_id`),
  KEY `telescope_entries_family_hash_index` (`family_hash`),
  KEY `telescope_entries_created_at_index` (`created_at`),
  KEY `telescope_entries_type_should_display_on_index_index` (`type`,`should_display_on_index`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `telescope_entries_tags`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `telescope_entries_tags` (
  `entry_uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tag` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`entry_uuid`,`tag`),
  KEY `telescope_entries_tags_tag_index` (`tag`),
  CONSTRAINT `telescope_entries_tags_entry_uuid_foreign` FOREIGN KEY (`entry_uuid`) REFERENCES `telescope_entries` (`uuid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `telescope_monitoring`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `telescope_monitoring` (
  `tag` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`tag`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ticket_audit_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ticket_audit_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `event_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `event_subtype` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `severity` int NOT NULL DEFAULT '1',
  `ticket_id` bigint unsigned DEFAULT NULL,
  `ticket_tuid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `order_id` bigint unsigned DEFAULT NULL,
  `order_item_id` bigint unsigned DEFAULT NULL,
  `event_id` bigint unsigned DEFAULT NULL,
  `batch_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `user_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `admin_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `session_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `request_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `correlation_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `action` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `metadata` json DEFAULT NULL,
  `request_data` json DEFAULT NULL,
  `response_data` json DEFAULT NULL,
  `error_message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `error_trace` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `auth_method` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `access_token_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `signature_valid` tinyint(1) DEFAULT NULL,
  `scanner_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `scanner_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_size` int DEFAULT NULL,
  `template_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `duration_ms` decimal(10,2) DEFAULT NULL,
  `started_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `old_values` json DEFAULT NULL,
  `new_values` json DEFAULT NULL,
  `change_reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `download_token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `token_expires_at` timestamp NULL DEFAULT NULL,
  `download_count` int NOT NULL DEFAULT '0',
  `validation_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `qr_data_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `validation_errors` json DEFAULT NULL,
  `job_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `queue_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `retry_count` int NOT NULL DEFAULT '0',
  `webhook_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `webhook_status_code` int DEFAULT NULL,
  `webhook_response` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_audit_logs_event_type_status_index` (`event_type`,`status`),
  KEY `ticket_audit_logs_ticket_id_event_type_index` (`ticket_id`,`event_type`),
  KEY `ticket_audit_logs_user_id_event_type_index` (`user_id`,`event_type`),
  KEY `ticket_audit_logs_created_at_event_type_index` (`created_at`,`event_type`),
  KEY `ticket_audit_logs_order_id_event_type_index` (`order_id`,`event_type`),
  KEY `ticket_audit_logs_batch_id_status_index` (`batch_id`,`status`),
  KEY `ticket_audit_logs_event_type_index` (`event_type`),
  KEY `ticket_audit_logs_status_index` (`status`),
  KEY `ticket_audit_logs_ticket_id_index` (`ticket_id`),
  KEY `ticket_audit_logs_ticket_tuid_index` (`ticket_tuid`),
  KEY `ticket_audit_logs_order_id_index` (`order_id`),
  KEY `ticket_audit_logs_order_item_id_index` (`order_item_id`),
  KEY `ticket_audit_logs_event_id_index` (`event_id`),
  KEY `ticket_audit_logs_batch_id_index` (`batch_id`),
  KEY `ticket_audit_logs_user_id_index` (`user_id`),
  KEY `ticket_audit_logs_ip_address_index` (`ip_address`),
  KEY `ticket_audit_logs_session_id_index` (`session_id`),
  KEY `ticket_audit_logs_request_id_index` (`request_id`),
  KEY `ticket_audit_logs_correlation_id_index` (`correlation_id`),
  KEY `ticket_audit_logs_download_token_index` (`download_token`),
  KEY `ticket_audit_logs_validation_code_index` (`validation_code`),
  KEY `ticket_audit_logs_job_id_index` (`job_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ticket_booking`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ticket_booking` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `booking_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `cust_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `cust_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `cust_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `billing_address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `event_id` bigint unsigned NOT NULL,
  `tuids` json DEFAULT NULL,
  `total_amount` double(8,2) NOT NULL,
  `status` tinyint NOT NULL DEFAULT '0' COMMENT 'allow only 0 / 1 for pending and paid',
  `ticket_document` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ticket_booking_booking_id_unique` (`booking_id`),
  KEY `ticket_booking_event_id_foreign` (`event_id`),
  CONSTRAINT `ticket_booking_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ticket_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ticket_categories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ticket_download_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ticket_download_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `ticket_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `order_id` bigint unsigned DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_agent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `status` enum('attempted','success','unauthorized','failed') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `download_method` enum('direct','temporary_url') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_download_logs_ticket_id_index` (`ticket_id`),
  KEY `ticket_download_logs_order_id_index` (`order_id`),
  KEY `ticket_download_logs_user_id_index` (`user_id`),
  KEY `ticket_download_logs_status_index` (`status`),
  KEY `ticket_download_logs_created_at_index` (`created_at`),
  KEY `ticket_download_logs_ticket_id_status_index` (`ticket_id`,`status`),
  KEY `ticket_download_logs_user_id_created_at_index` (`user_id`,`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ticket_generation_batches`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ticket_generation_batches` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `batch_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('initializing','processing','completed','failed','cancelled') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'initializing',
  `priority` enum('normal','high') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'normal',
  `template_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'standard',
  `total_orders` int NOT NULL DEFAULT '0',
  `valid_orders` int NOT NULL DEFAULT '0',
  `total_tickets` int NOT NULL DEFAULT '0',
  `completed_tickets` int NOT NULL DEFAULT '0',
  `failed_tickets` int NOT NULL DEFAULT '0',
  `progress_percentage` decimal(5,2) NOT NULL DEFAULT '0.00',
  `started_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `cancelled_at` timestamp NULL DEFAULT NULL,
  `include_email` tinyint(1) NOT NULL DEFAULT '0',
  `webhook_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `invalid_orders` json DEFAULT NULL,
  `errors` json DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `created_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ticket_generation_batches_batch_id_unique` (`batch_id`),
  KEY `ticket_generation_batches_batch_id_index` (`batch_id`),
  KEY `ticket_generation_batches_status_index` (`status`),
  KEY `ticket_generation_batches_priority_index` (`priority`),
  KEY `ticket_generation_batches_created_at_index` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ticket_price`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ticket_price` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `event_id` bigint unsigned NOT NULL,
  `date` date NOT NULL,
  `level` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `price` double(8,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_price_event_id_foreign` (`event_id`),
  CONSTRAINT `ticket_price_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ticket_reissuances`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ticket_reissuances` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `ticket_id` bigint unsigned NOT NULL,
  `reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `issued_by` bigint unsigned DEFAULT NULL,
  `delivery_method` enum('email','download') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_reissuances_issued_by_foreign` (`issued_by`),
  KEY `ticket_reissuances_ticket_id_created_at_index` (`ticket_id`,`created_at`),
  CONSTRAINT `ticket_reissuances_issued_by_foreign` FOREIGN KEY (`issued_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `ticket_reissuances_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ticket_security_events`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ticket_security_events` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `event_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `ticket_id` bigint unsigned DEFAULT NULL,
  `details` json DEFAULT NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_agent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NOT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_security_events_event_type_index` (`event_type`),
  KEY `ticket_security_events_ticket_id_index` (`ticket_id`),
  KEY `ticket_security_events_created_at_index` (`created_at`),
  KEY `ticket_security_events_event_type_created_at_index` (`event_type`,`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ticket_templates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ticket_templates` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` enum('standard','vip','wristband','digital') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `html_template` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `css_styles` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `dimensions` json NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `version` int NOT NULL DEFAULT '1',
  `accessibility_compliant` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_templates_type_is_active_index` (`type`,`is_active`),
  KEY `ticket_templates_version_index` (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ticket_url_access_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ticket_url_access_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `ticket_id` bigint unsigned NOT NULL,
  `token_jti` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `event_id` bigint unsigned DEFAULT NULL,
  `order_id` bigint unsigned DEFAULT NULL,
  `accessed_at` timestamp NOT NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_agent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `metadata` json DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_url_access_logs_ticket_id_index` (`ticket_id`),
  KEY `ticket_url_access_logs_token_jti_index` (`token_jti`),
  KEY `ticket_url_access_logs_event_id_index` (`event_id`),
  KEY `ticket_url_access_logs_order_id_index` (`order_id`),
  KEY `ticket_url_access_logs_accessed_at_index` (`accessed_at`),
  KEY `ticket_url_access_logs_ticket_id_accessed_at_index` (`ticket_id`,`accessed_at`),
  KEY `ticket_url_access_logs_ip_address_accessed_at_index` (`ip_address`,`accessed_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ticket_url_generation_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ticket_url_generation_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `ticket_id` bigint unsigned NOT NULL,
  `event_id` bigint unsigned DEFAULT NULL,
  `order_id` bigint unsigned DEFAULT NULL,
  `generated_by` bigint unsigned DEFAULT NULL,
  `expiry_minutes` int NOT NULL,
  `access_limit` int DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `generated_at` timestamp NOT NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_url_generation_logs_ticket_id_index` (`ticket_id`),
  KEY `ticket_url_generation_logs_generated_by_index` (`generated_by`),
  KEY `ticket_url_generation_logs_generated_at_index` (`generated_at`),
  KEY `ticket_url_generation_logs_ticket_id_generated_at_index` (`ticket_id`,`generated_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ticket_validations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ticket_validations` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `ticket_id` bigint unsigned NOT NULL,
  `line_item_id` bigint unsigned DEFAULT NULL,
  `tuid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `event_id` bigint unsigned DEFAULT NULL,
  `validation_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('valid','invalid','duplicate','expired','tampered') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `scanner_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `scanner_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `qr_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `signature_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `signature_valid` tinyint(1) NOT NULL DEFAULT '0',
  `validation_errors` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `validated_at` datetime NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ticket_validations_validation_code_unique` (`validation_code`),
  KEY `ticket_validations_ticket_id_index` (`ticket_id`),
  KEY `ticket_validations_tuid_index` (`tuid`),
  KEY `ticket_validations_event_id_index` (`event_id`),
  KEY `ticket_validations_validation_code_index` (`validation_code`),
  KEY `ticket_validations_validated_at_index` (`validated_at`),
  KEY `ticket_validations_status_index` (`status`),
  KEY `ticket_validations_line_item_id_index` (`line_item_id`),
  CONSTRAINT `ticket_validations_line_item_id_foreign` FOREIGN KEY (`line_item_id`) REFERENCES `order_line_items` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ticket_verification_codes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ticket_verification_codes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `verification_code` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Short unique code for QR/barcode',
  `line_item_id` bigint unsigned NOT NULL COMMENT 'Reference to order_line_items table',
  `order_id` bigint unsigned NOT NULL COMMENT 'Reference to orders table',
  `event_id` bigint unsigned NOT NULL COMMENT 'Event this ticket is for',
  `ticket_type` enum('qr','barcode','both') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'both' COMMENT 'Type of code generated',
  `status` enum('active','used','revoked','expired') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active' COMMENT 'Current status of verification code',
  `qr_data` text COLLATE utf8mb4_unicode_ci COMMENT 'JSON with minimal ticket info for QR',
  `barcode_data` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'CODE128 data for barcode',
  `barcode_format` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'CODE128' COMMENT 'Barcode format type',
  `hmac_signature` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'HMAC signature for tamper detection',
  `generated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'When verification code was created',
  `expires_at` timestamp NULL DEFAULT NULL COMMENT 'Optional expiry (null = never expires)',
  `first_scanned_at` timestamp NULL DEFAULT NULL COMMENT 'First scan timestamp',
  `last_scanned_at` timestamp NULL DEFAULT NULL COMMENT 'Most recent scan timestamp',
  `scan_count` int unsigned NOT NULL DEFAULT '0' COMMENT 'Number of times scanned',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ticket_verification_codes_verification_code_unique` (`verification_code`),
  KEY `idx_event_status` (`event_id`,`status`),
  KEY `idx_order_status` (`order_id`,`status`),
  KEY `ticket_verification_codes_line_item_id_index` (`line_item_id`),
  KEY `ticket_verification_codes_order_id_index` (`order_id`),
  KEY `ticket_verification_codes_event_id_index` (`event_id`),
  KEY `ticket_verification_codes_status_index` (`status`),
  CONSTRAINT `ticket_verification_codes_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE,
  CONSTRAINT `ticket_verification_codes_line_item_id_foreign` FOREIGN KEY (`line_item_id`) REFERENCES `order_line_items` (`id`) ON DELETE CASCADE,
  CONSTRAINT `ticket_verification_codes_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ticket_wise_prices`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ticket_wise_prices` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `event_id` bigint unsigned NOT NULL,
  `ticket_category_id` bigint unsigned NOT NULL,
  `per_ticket_price` bigint unsigned NOT NULL,
  `ticket_quantity` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `tickets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tickets` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `event_id` bigint unsigned NOT NULL,
  `booking_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `tuid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('pending','processing','ready','generation_failed') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `ticket_status` enum('active','blocked','barred','revoked','transferred','cancelled') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `is_blocked` tinyint(1) NOT NULL DEFAULT '0',
  `is_barred` tinyint(1) NOT NULL DEFAULT '0',
  `denial_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `blocked_at` timestamp NULL DEFAULT NULL,
  `barred_by` bigint unsigned DEFAULT NULL,
  `barred_at` timestamp NULL DEFAULT NULL,
  `security_alerts_count` int NOT NULL DEFAULT '0',
  `last_security_alert_at` timestamp NULL DEFAULT NULL,
  `blocked_by` bigint unsigned DEFAULT NULL,
  `blocked_reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `unblocked_at` timestamp NULL DEFAULT NULL,
  `unblocked_by` bigint unsigned DEFAULT NULL,
  `ticket_type` enum('individual','party','group') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'individual' COMMENT 'Type of ticket: individual, party (child of a party ticket), or group',
  `parent_ticket_id` bigint unsigned DEFAULT NULL COMMENT 'For party tickets, reference to the parent ticket',
  `party_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Name for party/group bookings',
  `party_size` int unsigned DEFAULT NULL COMMENT 'Number of people in party/group booking',
  `used_at` datetime DEFAULT NULL,
  `expires_at` datetime DEFAULT NULL,
  `pdf_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pdf_generated_at` timestamp NULL DEFAULT NULL,
  `template_version` int NOT NULL DEFAULT '1',
  `reissued_at` timestamp NULL DEFAULT NULL,
  `reissued_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reissue_reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tickets_booking_id_unique` (`booking_id`),
  KEY `tickets_reissued_at_index` (`reissued_at`),
  KEY `tickets_reissued_by_index` (`reissued_by`),
  KEY `tickets_pdf_generated_at_index` (`pdf_generated_at`),
  KEY `idx_status` (`status`),
  KEY `idx_event_status` (`event_id`,`status`),
  KEY `idx_booking_event` (`booking_id`,`event_id`),
  KEY `idx_used_at` (`used_at`),
  KEY `idx_expires_at` (`expires_at`),
  KEY `idx_ticket_type` (`ticket_type`),
  KEY `idx_parent_ticket` (`parent_ticket_id`),
  KEY `tickets_unblocked_by_foreign` (`unblocked_by`),
  KEY `tickets_blocked_at_index` (`blocked_at`),
  KEY `tickets_blocked_by_index` (`blocked_by`),
  KEY `tickets_unblocked_at_index` (`unblocked_at`),
  KEY `tickets_is_blocked_index` (`is_blocked`),
  KEY `tickets_is_barred_index` (`is_barred`),
  KEY `tickets_is_blocked_is_barred_index` (`is_blocked`,`is_barred`),
  KEY `blocked_at_index` (`blocked_at`),
  CONSTRAINT `tickets_blocked_by_foreign` FOREIGN KEY (`blocked_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `tickets_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`),
  CONSTRAINT `tickets_parent_ticket_id_foreign` FOREIGN KEY (`parent_ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `tickets_unblocked_by_foreign` FOREIGN KEY (`unblocked_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `tshirt_trackings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tshirt_trackings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `registration_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `user_consents`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user_consents` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `consent_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `consent_given` tinyint(1) NOT NULL DEFAULT '0',
  `consent_version` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `source` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `consented_at` timestamp NULL DEFAULT NULL,
  `withdrawn_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_consents_user_id_consent_type_consent_given_index` (`user_id`,`consent_type`,`consent_given`),
  KEY `user_consents_email_consent_type_consent_given_index` (`email`,`consent_type`,`consent_given`),
  KEY `user_consents_user_id_index` (`user_id`),
  KEY `user_consents_email_index` (`email`),
  KEY `user_consents_consent_type_index` (`consent_type`),
  KEY `user_consents_consent_given_index` (`consent_given`),
  KEY `user_consents_consented_at_index` (`consented_at`),
  KEY `user_consents_withdrawn_at_index` (`withdrawn_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `user_groups`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user_groups` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `first_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `password_changed_at` timestamp NULL DEFAULT NULL,
  `full_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `gender` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `age_range` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `runner_walker` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `county` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `eircode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `corporate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tshirt` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_flag` tinyint(1) NOT NULL DEFAULT '0',
  `stripe_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `pin` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Hashed PIN for manager override authentication',
  `remember_token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `age` int DEFAULT NULL,
  `entry_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `profile_photo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_activity_distance` decimal(10,2) DEFAULT NULL,
  `last_activity_on` date DEFAULT NULL,
  `total_distance` decimal(10,2) DEFAULT NULL,
  `rank` int DEFAULT NULL,
  `registration_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `registration_ext_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `parent_user_id` bigint unsigned DEFAULT NULL,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `suspension_reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `suspended_at` timestamp NULL DEFAULT NULL,
  `suspended_by` bigint unsigned DEFAULT NULL,
  `locked_reason` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Reason for account lock (e.g., failed PIN attempts)',
  `locked_at` timestamp NULL DEFAULT NULL COMMENT 'When account was locked',
  `device_info` json DEFAULT NULL,
  `activity_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_group` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_unique` (`email`),
  UNIQUE KEY `users_username_unique` (`username`),
  KEY `users_email_index` (`email`),
  KEY `users_username_index` (`username`),
  KEY `users_entry_type_index` (`entry_type`),
  KEY `users_status_index` (`status`),
  KEY `users_email_verified_at_index` (`email_verified_at`),
  KEY `users_is_active_index` (`is_active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `venue_templates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `venue_templates` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `event_id` bigint unsigned DEFAULT NULL,
  `venue_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Venue Template',
  `version` int NOT NULL DEFAULT '1',
  `status` enum('draft','published','archived') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `save_type` enum('manual','auto') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'manual',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `author` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `template_data` json NOT NULL,
  `sections_data` json DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `total_seats` int NOT NULL DEFAULT '0',
  `total_tables` int NOT NULL DEFAULT '0',
  `total_capacity` int NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `venue_templates_event_id_is_active_index` (`event_id`,`is_active`),
  KEY `venue_templates_event_id_index` (`event_id`),
  KEY `venue_templates_event_id_version_index` (`event_id`,`version`),
  KEY `venue_templates_event_id_status_index` (`event_id`,`status`),
  KEY `venue_templates_event_id_version_status_index` (`event_id`,`version`,`status`),
  KEY `idx_venue_templates_venue_id` (`venue_id`),
  KEY `idx_venue_templates_venue_active` (`venue_id`,`is_active`),
  KEY `idx_venue_templates_venue_status` (`venue_id`,`status`),
  KEY `idx_venue_templates_venue_version` (`venue_id`,`version`),
  CONSTRAINT `fk_venue_templates_venue_id` FOREIGN KEY (`venue_id`) REFERENCES `venues` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `venue_themes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `venue_themes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `theme_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `config` json NOT NULL,
  `is_global` tinyint(1) NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `venue_id` bigint unsigned DEFAULT NULL,
  `event_id` bigint unsigned DEFAULT NULL,
  `author` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `version` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '1.0.0',
  `mode` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'custom',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `venue_themes_theme_id_unique` (`theme_id`),
  KEY `venue_themes_is_global_is_active_index` (`is_global`,`is_active`),
  KEY `venue_themes_venue_id_is_active_index` (`venue_id`,`is_active`),
  KEY `venue_themes_event_id_is_active_index` (`event_id`,`is_active`),
  KEY `venue_themes_name_index` (`name`),
  KEY `venue_themes_is_global_index` (`is_global`),
  KEY `venue_themes_is_active_index` (`is_active`),
  KEY `venue_themes_venue_id_index` (`venue_id`),
  KEY `venue_themes_event_id_index` (`event_id`),
  KEY `venue_themes_mode_index` (`mode`),
  CONSTRAINT `venue_themes_venue_id_foreign` FOREIGN KEY (`venue_id`) REFERENCES `venues` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `venues`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `venues` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `default_theme_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `postal_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `capacity` int DEFAULT NULL,
  `contact_info` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `venues_default_theme_id_foreign` (`default_theme_id`),
  CONSTRAINT `venues_default_theme_id_foreign` FOREIGN KEY (`default_theme_id`) REFERENCES `venue_themes` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `webhook_events`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `webhook_events` (
  `event_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `event_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `payment_intent_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'EDGE-013 FIX: Payment Intent ID for deduplication',
  `payload` json DEFAULT NULL,
  `status` enum('pending','processing','processed','failed') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `error_message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `retry_count` int NOT NULL DEFAULT '0',
  `received_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `processed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`event_id`),
  KEY `webhook_events_event_type_received_at_index` (`event_type`,`received_at`),
  KEY `webhook_events_status_received_at_index` (`status`,`received_at`),
  KEY `webhook_events_processed_at_index` (`processed_at`),
  KEY `webhook_events_payment_intent_id_index` (`payment_intent_id`),
  KEY `idx_webhook_dedup` (`event_type`(100),`payment_intent_id`(100))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

INSERT INTO `migrations` VALUES (1,'2014_10_12_000000_create_users_table',1);
INSERT INTO `migrations` VALUES (2,'2014_10_12_100000_create_password_resets_table',1);
INSERT INTO `migrations` VALUES (3,'2022_02_15_105028_create_fundraising_profiles_table',1);
INSERT INTO `migrations` VALUES (4,'2022_02_15_112347_create_fundraising_transactions_table',1);
INSERT INTO `migrations` VALUES (5,'2022_03_07_040816_modify_registration_ext',1);
INSERT INTO `migrations` VALUES (6,'2022_03_08_132523_create_photos_table',1);
INSERT INTO `migrations` VALUES (7,'2022_03_08_140817_modify_users',1);
INSERT INTO `migrations` VALUES (8,'2022_03_08_143720_create_faqs_table',1);
INSERT INTO `migrations` VALUES (9,'2022_03_08_163251_create_donation_amounts_table',1);
INSERT INTO `migrations` VALUES (10,'2022_03_15_041018_create_special_messages_table',1);
INSERT INTO `migrations` VALUES (11,'2022_03_16_090802_create_posts_table',1);
INSERT INTO `migrations` VALUES (12,'2022_03_23_081540_create_strava_users_table',1);
INSERT INTO `migrations` VALUES (13,'2022_03_24_061328_create_tshirt_trackings_table',1);
INSERT INTO `migrations` VALUES (14,'2022_03_28_053654_create_user_groups_table',1);
INSERT INTO `migrations` VALUES (15,'2022_04_13_104317_create_teams_table',1);
INSERT INTO `migrations` VALUES (16,'2022_08_24_152513_create_events_table',1);
INSERT INTO `migrations` VALUES (17,'2022_08_24_152536_create_acts_table',1);
INSERT INTO `migrations` VALUES (18,'2022_08_25_073206_create_clubs_table',1);
INSERT INTO `migrations` VALUES (19,'2022_08_25_075649_create_event_photos_table',1);
INSERT INTO `migrations` VALUES (20,'2022_08_25_085350_create_act_sponsor_photos_table',1);
INSERT INTO `migrations` VALUES (21,'2022_08_25_085418_create_ticket_booking_table',1);
INSERT INTO `migrations` VALUES (22,'2022_08_25_122500_create_ticket_price_table',1);
INSERT INTO `migrations` VALUES (23,'2022_08_25_124049_create_tickets_table',1);
INSERT INTO `migrations` VALUES (24,'2022_08_25_140000_create_carts_table',1);
INSERT INTO `migrations` VALUES (25,'2022_08_25_150000_create_permissions_table',1);
INSERT INTO `migrations` VALUES (26,'2022_08_25_160000_create_contents_table',1);
INSERT INTO `migrations` VALUES (27,'2022_08_26_110000_create_blog_categories_table',1);
INSERT INTO `migrations` VALUES (28,'2022_08_26_120000_create_blogs_table',1);
INSERT INTO `migrations` VALUES (29,'2022_08_26_130000_create_banners_table',1);
INSERT INTO `migrations` VALUES (30,'2022_12_02_054841_create_queue_merge_acts_table',1);
INSERT INTO `migrations` VALUES (31,'2023_07_05_172058_create_ticket_categories_table',1);
INSERT INTO `migrations` VALUES (32,'2023_07_05_193358_create_ticket_wise_prices_table',1);
INSERT INTO `migrations` VALUES (33,'2024_09_10_111500_add_unique_constraint_to_carts_table',1);
INSERT INTO `migrations` VALUES (34,'2025_09_09_100000_create_seat_reservations_table',1);
INSERT INTO `migrations` VALUES (35,'2025_09_09_105000_create_seats_table',1);
INSERT INTO `migrations` VALUES (36,'2025_09_09_110000_create_orders_table',1);
INSERT INTO `migrations` VALUES (37,'2025_09_09_120000_add_idempotency_key_to_orders_table',1);
INSERT INTO `migrations` VALUES (38,'2025_09_09_130000_make_user_id_nullable_in_orders_table',1);
INSERT INTO `migrations` VALUES (39,'2025_09_09_153015_create_cache_table',1);
INSERT INTO `migrations` VALUES (40,'2025_09_10_155059_create_order_items_table',1);
INSERT INTO `migrations` VALUES (41,'2025_09_10_155308_create_event_wise_seat_categories_table',1);
INSERT INTO `migrations` VALUES (42,'2025_09_12_225618_add_table_support_to_seats_table',1);
INSERT INTO `migrations` VALUES (43,'2025_09_12_230003_create_venue_templates_table',1);
INSERT INTO `migrations` VALUES (44,'2025_09_17_182524_add_shadow_sold_status_to_seat_reservations_table',1);
INSERT INTO `migrations` VALUES (45,'2025_09_23_140000_add_versioning_to_venue_templates',1);
INSERT INTO `migrations` VALUES (46,'2025_09_23_150000_fix_venue_templates_constraints',1);
INSERT INTO `migrations` VALUES (47,'2025_09_24_174638_create_admin_roles_table',1);
INSERT INTO `migrations` VALUES (48,'2025_09_24_174639_create_admins_table',1);
INSERT INTO `migrations` VALUES (49,'2025_09_24_175742_migrate_mbs_users_to_admin_system',1);
INSERT INTO `migrations` VALUES (50,'2025_09_24_180659_create_email_templates_table',1);
INSERT INTO `migrations` VALUES (51,'2025_09_24_183910_create_content_pages_table',1);
INSERT INTO `migrations` VALUES (52,'2025_09_26_163916_add_selling_period_columns_to_events_table',1);
INSERT INTO `migrations` VALUES (53,'2025_09_29_000000_add_reissue_fields_to_tickets_table',1);
INSERT INTO `migrations` VALUES (54,'2025_09_29_000001_create_email_templates_table',1);
INSERT INTO `migrations` VALUES (55,'2025_09_29_115701_create_ticket_templates_table',1);
INSERT INTO `migrations` VALUES (56,'2025_09_29_123239_add_pdf_tracking_to_tickets_table',1);
INSERT INTO `migrations` VALUES (57,'2025_09_29_123500_create_ticket_reissuances_table',1);
INSERT INTO `migrations` VALUES (58,'2025_09_29_124324_add_ticket_generation_status_to_order_items_table',1);
INSERT INTO `migrations` VALUES (59,'2025_09_29_140000_create_ticket_generation_batches_table',1);
INSERT INTO `migrations` VALUES (60,'2025_09_29_150000_create_ticket_download_logs_table',1);
INSERT INTO `migrations` VALUES (61,'2025_09_29_160000_create_ticket_url_access_logs_table',1);
INSERT INTO `migrations` VALUES (62,'2025_09_29_160001_create_ticket_url_generation_logs_table',1);
INSERT INTO `migrations` VALUES (63,'2025_09_29_160002_create_ticket_security_events_table',1);
INSERT INTO `migrations` VALUES (64,'2025_09_29_163525_create_jobs_table',1);
INSERT INTO `migrations` VALUES (65,'2025_09_29_163527_create_failed_jobs_table',1);
INSERT INTO `migrations` VALUES (66,'2025_09_29_163807_create_batch_jobs_table',1);
INSERT INTO `migrations` VALUES (67,'2025_09_29_170653_create_ticket_validations_table',1);
INSERT INTO `migrations` VALUES (68,'2025_09_29_170912_add_used_at_expires_at_to_tickets_table',1);
INSERT INTO `migrations` VALUES (69,'2025_09_29_172114_create_queue_monitor_table',1);
INSERT INTO `migrations` VALUES (70,'2025_09_29_200000_create_ticket_audit_logs_table',1);
INSERT INTO `migrations` VALUES (71,'2025_09_29_210000_create_qr_validations_table',1);
INSERT INTO `migrations` VALUES (72,'2025_09_29_214724_add_performance_indexes_to_tickets_table',1);
INSERT INTO `migrations` VALUES (73,'2025_10_01_185741_update_users_table_for_generic_accounts',1);
INSERT INTO `migrations` VALUES (75,'2025_10_02_100255_add_customer_data_to_orders_table',2);
INSERT INTO `migrations` VALUES (78,'2025_10_03_132354_add_price_indexes_to_seats_table',3);
INSERT INTO `migrations` VALUES (79,'2025_10_06_123322_create_galleries_table',3);
INSERT INTO `migrations` VALUES (80,'2025_10_06_000000_create_payment_transactions_table',4);
INSERT INTO `migrations` VALUES (81,'2025_10_06_164501_create_order_refunds_table',4);
INSERT INTO `migrations` VALUES (82,'2025_10_06_170147_create_stripe_webhook_events_table',4);
INSERT INTO `migrations` VALUES (83,'2025_10_06_170603_add_revolut_fields_to_orders_table',4);
INSERT INTO `migrations` VALUES (84,'2025_10_06_184106_add_ticket_type_fields_to_tickets_table',4);
INSERT INTO `migrations` VALUES (85,'2025_10_06_184117_add_ticket_status_management_to_tickets_table',4);
INSERT INTO `migrations` VALUES (86,'2025_10_06_184142_add_ticket_status_validation_fields_to_tickets_table',4);
INSERT INTO `migrations` VALUES (87,'2025_10_06_184212_add_blocking_fields_to_tickets_table',4);
INSERT INTO `migrations` VALUES (88,'2025_10_06_184243_add_blocked_status_to_seat_reservations',4);
INSERT INTO `migrations` VALUES (89,'2025_10_06_184306_create_bulk_ticket_status_batches_table',4);
INSERT INTO `migrations` VALUES (90,'2025_10_06_184843_create_seat_reassignments_table',4);
INSERT INTO `migrations` VALUES (91,'2025_10_06_190356_add_unique_constraint_to_seat_id',4);
INSERT INTO `migrations` VALUES (92,'2025_10_06_190357_create_seat_transfer_requests_table',5);
INSERT INTO `migrations` VALUES (93,'2025_10_06_194918_add_profile_fields_to_customers_table',5);
INSERT INTO `migrations` VALUES (94,'2025_10_06_212929_add_granular_statuses_to_orders_table',5);
INSERT INTO `migrations` VALUES (95,'2025_10_06_212954_create_order_modifications_table',5);
INSERT INTO `migrations` VALUES (96,'2025_10_06_213007_create_order_status_audit_logs_table',5);
INSERT INTO `migrations` VALUES (97,'2025_10_06_213324_add_cancelled_status_to_seat_reservations_table',5);
INSERT INTO `migrations` VALUES (98,'2025_10_06_213327_add_cancelled_status_to_tickets_table',5);
INSERT INTO `migrations` VALUES (99,'2025_10_06_224236_create_payment_audit_logs_table',6);
INSERT INTO `migrations` VALUES (100,'2025_10_07_143833_add_stripe_fields_to_orders_table',7);
INSERT INTO `migrations` VALUES (101,'2025_10_07_144937_create_webhook_events_table',8);
INSERT INTO `migrations` VALUES (102,'2025_10_08_121909_create_order_line_items_table',9);
INSERT INTO `migrations` VALUES (103,'2025_10_08_135135_add_stripe_customer_id_to_orders_table',10);
INSERT INTO `migrations` VALUES (104,'2025_10_06_224306_create_payment_reconciliations_table',11);
INSERT INTO `migrations` VALUES (105,'2025_10_06_224348_add_gdpr_fields_to_payment_transactions_and_orders',11);
INSERT INTO `migrations` VALUES (106,'2025_10_06_224418_create_gdpr_audit_logs_table',11);
INSERT INTO `migrations` VALUES (107,'2025_10_08_152651_add_payment_mode_to_orders',12);
INSERT INTO `migrations` VALUES (108,'2025_10_08_152751_add_cash_and_comp_gateways_to_payment_transactions',12);
INSERT INTO `migrations` VALUES (109,'2025_10_08_155245_create_user_consents_table',13);
INSERT INTO `migrations` VALUES (111,'2025_10_09_133231_add_performance_indexes_to_seat_reservations',14);
INSERT INTO `migrations` VALUES (112,'2025_10_09_172052_create_email_accounts_table',15);
INSERT INTO `migrations` VALUES (113,'2025_10_09_172117_create_email_rate_tracking_table',16);
INSERT INTO `migrations` VALUES (114,'2025_10_09_172119_enhance_email_logs_table',17);
INSERT INTO `migrations` VALUES (115,'2025_10_09_172115_create_email_inbox_table',18);
INSERT INTO `migrations` VALUES (116,'2025_10_09_000000_create_mbs_activity_logs_table',19);
INSERT INTO `migrations` VALUES (117,'2025_10_09_150340_create_order_notes_table',19);
INSERT INTO `migrations` VALUES (118,'2025_10_09_180449_create_manager_overrides_table',20);
INSERT INTO `migrations` VALUES (119,'2025_10_09_200000_create_device_tokens_table',20);
INSERT INTO `migrations` VALUES (120,'2025_10_09_200001_create_fire_marshal_tokens_table',20);
INSERT INTO `migrations` VALUES (121,'2025_10_09_184012_add_pin_to_users_table',21);
INSERT INTO `migrations` VALUES (122,'2025_10_09_172120_create_email_reputation_table',22);
INSERT INTO `migrations` VALUES (123,'2025_10_10_115019_create_newsletter_contacts_table',23);
INSERT INTO `migrations` VALUES (124,'2025_10_10_115023_create_newsletter_campaigns_table',23);
INSERT INTO `migrations` VALUES (125,'2025_10_10_115026_create_newsletter_subscriptions_table',23);
INSERT INTO `migrations` VALUES (126,'2025_10_10_000000_create_chargebacks_table',24);
INSERT INTO `migrations` VALUES (127,'2025_10_11_140242_add_missing_fields_to_chargebacks_table',25);
INSERT INTO `migrations` VALUES (128,'2025_10_11_142240_add_needs_response_status_to_chargebacks',26);
INSERT INTO `migrations` VALUES (129,'2025_10_11_000000_add_suspension_fields_to_users_table',27);
INSERT INTO `migrations` VALUES (130,'2025_10_11_170737_add_missing_fields_to_admins_table',27);
INSERT INTO `migrations` VALUES (131,'2025_10_11_172424_create_admin_permissions_table',27);
INSERT INTO `migrations` VALUES (132,'2025_10_11_175141_add_password_changed_at_to_admins_table',27);
INSERT INTO `migrations` VALUES (133,'2025_10_12_171127_add_new_event_fields_to_events_table',28);
INSERT INTO `migrations` VALUES (134,'2025_10_12_171815_add_seo_and_publishing_fields_to_events_table',28);
INSERT INTO `migrations` VALUES (135,'2025_10_12_175638_create_event_categories_table',29);
INSERT INTO `migrations` VALUES (136,'2025_10_12_183527_add_publishing_status_columns_to_events_table',29);
INSERT INTO `migrations` VALUES (137,'2025_10_13_123422_create_venues_table',30);
INSERT INTO `migrations` VALUES (138,'2025_10_13_125852_add_venue_id_to_events_table',31);
INSERT INTO `migrations` VALUES (139,'2025_10_13_131302_refactor_venue_templates_add_venue_id',32);
INSERT INTO `migrations` VALUES (140,'2025_10_13_132027_create_event_venues_table',32);
INSERT INTO `migrations` VALUES (141,'2025_10_13_142019_populate_event_venues_table',33);
INSERT INTO `migrations` VALUES (142,'2025_10_14_120000_add_missing_columns_to_events_table',34);
INSERT INTO `migrations` VALUES (143,'2025_10_15_000001_add_template_support_to_newsletter_campaigns',34);
INSERT INTO `migrations` VALUES (144,'2018_08_08_100000_create_telescope_entries_table',35);
INSERT INTO `migrations` VALUES (145,'2025_01_21_000001_create_venue_themes_table',35);
INSERT INTO `migrations` VALUES (146,'2025_10_16_000001_add_email_tracking_to_orders',35);
INSERT INTO `migrations` VALUES (147,'2025_10_16_171509_add_fee_tax_settings_to_events_table',35);
INSERT INTO `migrations` VALUES (148,'2025_10_16_173156_create_ticket_verification_codes_table',35);
INSERT INTO `migrations` VALUES (149,'2025_10_16_174631_add_code_type_preferences_to_events_table',35);
INSERT INTO `migrations` VALUES (150,'2025_10_17_124724_add_line_item_id_to_ticket_validations_table',35);
INSERT INTO `migrations` VALUES (151,'2025_10_21_000002_add_payment_intent_id_to_webhook_events',35);
INSERT INTO `migrations` VALUES (152,'2025_10_22_112045_create_cms_files_table',35);
INSERT INTO `migrations` VALUES (153,'2025_10_22_130045_create_account_setup_invitations_table',35);
INSERT INTO `migrations` VALUES (154,'2025_10_23_120718_add_campaign_metadata_to_invitations',35);
INSERT INTO `migrations` VALUES (155,'2025_10_23_120750_create_failed_invitation_attempts_table',35);
INSERT INTO `migrations` VALUES (156,'2025_10_23_120827_create_campaign_audit_logs_table',35);
INSERT INTO `migrations` VALUES (157,'2025_10_23_143224_add_indexes_to_account_setup_invitations',35);
INSERT INTO `migrations` VALUES (158,'2025_10_24_000001_clean_venue_architecture',35);
INSERT INTO `migrations` VALUES (159,'2025_10_24_134926_add_is_published_and_publish_website_to_events_table',35);
INSERT INTO `migrations` VALUES (160,'2025_10_24_185319_add_theme_foreign_keys_to_events_and_venues',35);
