-- MailTrixy Database Backup
-- Date: 2026-07-26T09:11:27+00:00


CREATE TABLE `ab_test_variants` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `campaign_id` bigint(20) unsigned NOT NULL,
  `variant` varchar(1) NOT NULL,
  `subject` varchar(255) NOT NULL,
  `body_html` text DEFAULT NULL,
  `percentage` tinyint(3) unsigned NOT NULL DEFAULT 50,
  `is_winner` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ab_test_variants_campaign_variant_unique` (`campaign_id`,`variant`),
  KEY `ab_test_variants_campaign_id_index` (`campaign_id`),
  CONSTRAINT `ab_test_variants_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `campaigns` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `activity_log` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `log_name` varchar(255) DEFAULT NULL,
  `description` text NOT NULL,
  `subject_type` varchar(255) DEFAULT NULL,
  `event` varchar(255) DEFAULT NULL,
  `subject_id` bigint(20) unsigned DEFAULT NULL,
  `causer_type` varchar(255) DEFAULT NULL,
  `causer_id` bigint(20) unsigned DEFAULT NULL,
  `properties` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`properties`)),
  `batch_uuid` char(36) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `subject` (`subject_type`,`subject_id`),
  KEY `causer` (`causer_type`,`causer_id`),
  KEY `activity_log_log_name_index` (`log_name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `activity_log` VALUES ('1', 'email_accounts', 'Email account created', 'App\\Models\\EmailAccount', 'created', '1', 'App\\Models\\User', '2', '{\"attributes\":{\"email\":\"workspace@govaio.in\",\"status\":\"connected\",\"provider\":\"imap\",\"display_name\":\"govaio\"},\"workspace_id\":2}', NULL, '2026-07-26 09:05:29', '2026-07-26 09:05:29');

CREATE TABLE `admin_impersonations` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `admin_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `session_id` varchar(100) NOT NULL,
  `expires_at` timestamp NOT NULL,
  `ended_at` timestamp NULL DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `admin_impersonations_admin_id_foreign` (`admin_id`),
  KEY `admin_impersonations_user_id_foreign` (`user_id`),
  KEY `admin_impersonations_session_id_expires_at_index` (`session_id`,`expires_at`),
  CONSTRAINT `admin_impersonations_admin_id_foreign` FOREIGN KEY (`admin_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `admin_impersonations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `admins` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `two_factor_enabled` tinyint(1) NOT NULL DEFAULT 0,
  `two_factor_secret` varchar(255) DEFAULT NULL,
  `two_factor_recovery_codes` text DEFAULT NULL,
  `ip_whitelist` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`ip_whitelist`)),
  `role` enum('super_admin','admin','support') NOT NULL DEFAULT 'admin',
  `remember_token` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `admins_email_unique` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `ai_channel_configs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `channel` enum('email','whatsapp','sms','live_chat','telegram') NOT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 0,
  `personality_preset` varchar(32) NOT NULL DEFAULT 'friendly',
  `custom_prompt` text DEFAULT NULL,
  `additional_instructions` text DEFAULT NULL,
  `send_mode` enum('autonomous','approval','suggestions') NOT NULL DEFAULT 'approval',
  `confidence_threshold` tinyint(3) unsigned NOT NULL DEFAULT 75,
  `max_reply_length` enum('short','medium','long','very_long') NOT NULL DEFAULT 'medium',
  `temperature` decimal(3,2) DEFAULT NULL,
  `skip_filters` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`skip_filters`)),
  `first_message_only` tinyint(1) NOT NULL DEFAULT 0,
  `max_replies_per_conversation` tinyint(3) unsigned NOT NULL DEFAULT 3,
  `skip_own_threads` tinyint(1) NOT NULL DEFAULT 1,
  `reply_delay` enum('none','30s','1m','2m','5m','random') NOT NULL DEFAULT 'none',
  `escalation_enabled` tinyint(1) NOT NULL DEFAULT 0,
  `escalate_below_confidence` tinyint(3) unsigned NOT NULL DEFAULT 50,
  `escalation_assignee_id` bigint(20) unsigned DEFAULT NULL,
  `escalation_tag` varchar(64) NOT NULL DEFAULT 'needs_human',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ai_channel_workspace_unique` (`workspace_id`,`channel`),
  KEY `ai_channel_configs_channel_index` (`channel`),
  CONSTRAINT `ai_channel_configs_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `ai_exclusion_rules` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `rule_key` varchar(255) NOT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 1,
  `config` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`config`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ai_exclusion_rules_workspace_id_rule_key_unique` (`workspace_id`,`rule_key`),
  CONSTRAINT `ai_exclusion_rules_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `ai_exclusions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `type` enum('email','domain','keyword') NOT NULL,
  `value` varchar(255) NOT NULL,
  `match_type` varchar(20) NOT NULL DEFAULT 'contains',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ai_exclusions_workspace_id_type_index` (`workspace_id`,`type`),
  CONSTRAINT `ai_exclusions_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `ai_usage_logs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `provider` varchar(255) NOT NULL,
  `model` varchar(255) NOT NULL,
  `type` enum('reply','sentiment','embedding','playground','classification') NOT NULL DEFAULT 'reply',
  `tokens_in` int(10) unsigned NOT NULL DEFAULT 0,
  `tokens_out` int(10) unsigned NOT NULL DEFAULT 0,
  `cost` decimal(8,5) NOT NULL DEFAULT 0.00000,
  `response_time_ms` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ai_usage_logs_workspace_id_created_at_index` (`workspace_id`,`created_at`),
  KEY `ai_usage_logs_workspace_id_type_index` (`workspace_id`,`type`),
  KEY `idx_ai_usage_ws_created` (`workspace_id`,`created_at`),
  CONSTRAINT `ai_usage_logs_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `attachments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `message_id` bigint(20) unsigned NOT NULL,
  `workspace_id` bigint(20) unsigned DEFAULT NULL,
  `filename` varchar(255) NOT NULL,
  `original_filename` varchar(255) NOT NULL,
  `mime_type` varchar(255) NOT NULL,
  `size` bigint(20) unsigned NOT NULL,
  `storage_path` varchar(255) NOT NULL,
  `thumbnail_path` varchar(255) DEFAULT NULL,
  `is_inline` tinyint(1) NOT NULL DEFAULT 0,
  `content_id` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `attachments_message_mime_idx` (`message_id`,`mime_type`),
  KEY `attachments_workspace_id_index` (`workspace_id`),
  CONSTRAINT `attachments_message_id_foreign` FOREIGN KEY (`message_id`) REFERENCES `messages` (`id`) ON DELETE CASCADE,
  CONSTRAINT `attachments_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `audit_logs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `auditable_type` varchar(255) DEFAULT NULL,
  `auditable_id` bigint(20) unsigned DEFAULT NULL,
  `event` varchar(255) NOT NULL,
  `actor_type` varchar(255) DEFAULT NULL,
  `actor_id` bigint(20) unsigned DEFAULT NULL,
  `actor_name` varchar(255) DEFAULT NULL,
  `old_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`old_values`)),
  `new_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`new_values`)),
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `audit_logs_auditable_type_auditable_id_index` (`auditable_type`,`auditable_id`),
  KEY `audit_logs_actor_type_actor_id_index` (`actor_type`,`actor_id`),
  KEY `audit_logs_event_index` (`event`),
  KEY `audit_logs_created_at_index` (`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `audit_logs` VALUES ('1', 'App\\Models\\User', '2', 'user_created', 'admin', '1', 'Jitu', NULL, '{\"email\":\"workspace@govaio.com\",\"name\":\"Jitu Rajak\",\"roles\":[\"User\"],\"is_admin\":false}', '49.37.74.152', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36', '2026-07-26 09:02:41', '2026-07-26 09:02:41');

CREATE TABLE `auto_reply_rules` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `keywords` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`keywords`)),
  `match_type` enum('any','all','exact') NOT NULL DEFAULT 'any',
  `reply_body` text NOT NULL,
  `reply_subject` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `channel` enum('all','email','whatsapp','sms','chat') NOT NULL DEFAULT 'all',
  `first_message_only` tinyint(1) NOT NULL DEFAULT 1,
  `priority` int(11) NOT NULL DEFAULT 0,
  `usage_count` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `auto_reply_rules_workspace_id_is_active_index` (`workspace_id`,`is_active`),
  CONSTRAINT `auto_reply_rules_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `blocked_ips` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `ip_address` varchar(45) NOT NULL,
  `reason` varchar(255) DEFAULT NULL,
  `blocked_until` timestamp NULL DEFAULT NULL,
  `blocked_by` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `blocked_ips_ip_address_unique` (`ip_address`),
  KEY `blocked_ips_blocked_until_index` (`blocked_until`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `blocked_locations` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `country_code` varchar(5) DEFAULT NULL,
  `country_name` varchar(100) DEFAULT NULL,
  `state` varchar(100) DEFAULT NULL,
  `city` varchar(100) DEFAULT NULL,
  `reason` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `blocked_locations_created_by_foreign` (`created_by`),
  CONSTRAINT `blocked_locations_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `cache` (
  `key` varchar(255) NOT NULL,
  `value` mediumtext NOT NULL,
  `expiration` int(11) NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `cache` VALUES ('email-govaio-cache-8b6218dbc107f8a2c1c159ef6688b1b2', 'i:1;', '1785056639');
INSERT INTO `cache` VALUES ('email-govaio-cache-8b6218dbc107f8a2c1c159ef6688b1b2:timer', 'i:1785056639;', '1785056639');
INSERT INTO `cache` VALUES ('email-govaio-cache-active_languages', 'O:39:\"Illuminate\\Database\\Eloquent\\Collection\":2:{s:8:\"\0*\0items\";a:10:{i:0;O:19:\"App\\Models\\Language\":33:{s:13:\"\0*\0connection\";s:5:\"mysql\";s:8:\"\0*\0table\";s:9:\"languages\";s:13:\"\0*\0primaryKey\";s:2:\"id\";s:10:\"\0*\0keyType\";s:3:\"int\";s:12:\"incrementing\";b:1;s:7:\"\0*\0with\";a:0:{}s:12:\"\0*\0withCount\";a:0:{}s:19:\"preventsLazyLoading\";b:0;s:10:\"\0*\0perPage\";i:15;s:6:\"exists\";b:1;s:18:\"wasRecentlyCreated\";b:0;s:28:\"\0*\0escapeWhenCastingToString\";b:0;s:13:\"\0*\0attributes\";a:11:{s:2:\"id\";i:1;s:4:\"name\";s:7:\"English\";s:4:\"code\";s:2:\"en\";s:11:\"native_name\";s:7:\"English\";s:9:\"direction\";s:3:\"ltr\";s:4:\"flag\";s:8:\"🇺🇸\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:1;s:10:\"sort_order\";i:1;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:11:\"\0*\0original\";a:11:{s:2:\"id\";i:1;s:4:\"name\";s:7:\"English\";s:4:\"code\";s:2:\"en\";s:11:\"native_name\";s:7:\"English\";s:9:\"direction\";s:3:\"ltr\";s:4:\"flag\";s:8:\"🇺🇸\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:1;s:10:\"sort_order\";i:1;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:10:\"\0*\0changes\";a:0:{}s:11:\"\0*\0previous\";a:0:{}s:8:\"\0*\0casts\";a:2:{s:9:\"is_active\";s:7:\"boolean\";s:10:\"is_default\";s:7:\"boolean\";}s:17:\"\0*\0classCastCache\";a:0:{}s:21:\"\0*\0attributeCastCache\";a:0:{}s:13:\"\0*\0dateFormat\";N;s:10:\"\0*\0appends\";a:0:{}s:19:\"\0*\0dispatchesEvents\";a:0:{}s:14:\"\0*\0observables\";a:0:{}s:12:\"\0*\0relations\";a:0:{}s:10:\"\0*\0touches\";a:0:{}s:27:\"\0*\0relationAutoloadCallback\";N;s:26:\"\0*\0relationAutoloadContext\";N;s:10:\"timestamps\";b:1;s:13:\"usesUniqueIds\";b:0;s:9:\"\0*\0hidden\";a:0:{}s:10:\"\0*\0visible\";a:0:{}s:11:\"\0*\0fillable\";a:8:{i:0;s:4:\"name\";i:1;s:4:\"code\";i:2;s:11:\"native_name\";i:3;s:9:\"direction\";i:4;s:4:\"flag\";i:5;s:9:\"is_active\";i:6;s:10:\"is_default\";i:7;s:10:\"sort_order\";}s:10:\"\0*\0guarded\";a:1:{i:0;s:1:\"*\";}}i:1;O:19:\"App\\Models\\Language\":33:{s:13:\"\0*\0connection\";s:5:\"mysql\";s:8:\"\0*\0table\";s:9:\"languages\";s:13:\"\0*\0primaryKey\";s:2:\"id\";s:10:\"\0*\0keyType\";s:3:\"int\";s:12:\"incrementing\";b:1;s:7:\"\0*\0with\";a:0:{}s:12:\"\0*\0withCount\";a:0:{}s:19:\"preventsLazyLoading\";b:0;s:10:\"\0*\0perPage\";i:15;s:6:\"exists\";b:1;s:18:\"wasRecentlyCreated\";b:0;s:28:\"\0*\0escapeWhenCastingToString\";b:0;s:13:\"\0*\0attributes\";a:11:{s:2:\"id\";i:2;s:4:\"name\";s:7:\"Spanish\";s:4:\"code\";s:2:\"es\";s:11:\"native_name\";s:8:\"Español\";s:9:\"direction\";s:3:\"ltr\";s:4:\"flag\";s:8:\"🇪🇸\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:0;s:10:\"sort_order\";i:2;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:11:\"\0*\0original\";a:11:{s:2:\"id\";i:2;s:4:\"name\";s:7:\"Spanish\";s:4:\"code\";s:2:\"es\";s:11:\"native_name\";s:8:\"Español\";s:9:\"direction\";s:3:\"ltr\";s:4:\"flag\";s:8:\"🇪🇸\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:0;s:10:\"sort_order\";i:2;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:10:\"\0*\0changes\";a:0:{}s:11:\"\0*\0previous\";a:0:{}s:8:\"\0*\0casts\";a:2:{s:9:\"is_active\";s:7:\"boolean\";s:10:\"is_default\";s:7:\"boolean\";}s:17:\"\0*\0classCastCache\";a:0:{}s:21:\"\0*\0attributeCastCache\";a:0:{}s:13:\"\0*\0dateFormat\";N;s:10:\"\0*\0appends\";a:0:{}s:19:\"\0*\0dispatchesEvents\";a:0:{}s:14:\"\0*\0observables\";a:0:{}s:12:\"\0*\0relations\";a:0:{}s:10:\"\0*\0touches\";a:0:{}s:27:\"\0*\0relationAutoloadCallback\";N;s:26:\"\0*\0relationAutoloadContext\";N;s:10:\"timestamps\";b:1;s:13:\"usesUniqueIds\";b:0;s:9:\"\0*\0hidden\";a:0:{}s:10:\"\0*\0visible\";a:0:{}s:11:\"\0*\0fillable\";a:8:{i:0;s:4:\"name\";i:1;s:4:\"code\";i:2;s:11:\"native_name\";i:3;s:9:\"direction\";i:4;s:4:\"flag\";i:5;s:9:\"is_active\";i:6;s:10:\"is_default\";i:7;s:10:\"sort_order\";}s:10:\"\0*\0guarded\";a:1:{i:0;s:1:\"*\";}}i:2;O:19:\"App\\Models\\Language\":33:{s:13:\"\0*\0connection\";s:5:\"mysql\";s:8:\"\0*\0table\";s:9:\"languages\";s:13:\"\0*\0primaryKey\";s:2:\"id\";s:10:\"\0*\0keyType\";s:3:\"int\";s:12:\"incrementing\";b:1;s:7:\"\0*\0with\";a:0:{}s:12:\"\0*\0withCount\";a:0:{}s:19:\"preventsLazyLoading\";b:0;s:10:\"\0*\0perPage\";i:15;s:6:\"exists\";b:1;s:18:\"wasRecentlyCreated\";b:0;s:28:\"\0*\0escapeWhenCastingToString\";b:0;s:13:\"\0*\0attributes\";a:11:{s:2:\"id\";i:3;s:4:\"name\";s:6:\"French\";s:4:\"code\";s:2:\"fr\";s:11:\"native_name\";s:9:\"Français\";s:9:\"direction\";s:3:\"ltr\";s:4:\"flag\";s:8:\"🇫🇷\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:0;s:10:\"sort_order\";i:3;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:11:\"\0*\0original\";a:11:{s:2:\"id\";i:3;s:4:\"name\";s:6:\"French\";s:4:\"code\";s:2:\"fr\";s:11:\"native_name\";s:9:\"Français\";s:9:\"direction\";s:3:\"ltr\";s:4:\"flag\";s:8:\"🇫🇷\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:0;s:10:\"sort_order\";i:3;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:10:\"\0*\0changes\";a:0:{}s:11:\"\0*\0previous\";a:0:{}s:8:\"\0*\0casts\";a:2:{s:9:\"is_active\";s:7:\"boolean\";s:10:\"is_default\";s:7:\"boolean\";}s:17:\"\0*\0classCastCache\";a:0:{}s:21:\"\0*\0attributeCastCache\";a:0:{}s:13:\"\0*\0dateFormat\";N;s:10:\"\0*\0appends\";a:0:{}s:19:\"\0*\0dispatchesEvents\";a:0:{}s:14:\"\0*\0observables\";a:0:{}s:12:\"\0*\0relations\";a:0:{}s:10:\"\0*\0touches\";a:0:{}s:27:\"\0*\0relationAutoloadCallback\";N;s:26:\"\0*\0relationAutoloadContext\";N;s:10:\"timestamps\";b:1;s:13:\"usesUniqueIds\";b:0;s:9:\"\0*\0hidden\";a:0:{}s:10:\"\0*\0visible\";a:0:{}s:11:\"\0*\0fillable\";a:8:{i:0;s:4:\"name\";i:1;s:4:\"code\";i:2;s:11:\"native_name\";i:3;s:9:\"direction\";i:4;s:4:\"flag\";i:5;s:9:\"is_active\";i:6;s:10:\"is_default\";i:7;s:10:\"sort_order\";}s:10:\"\0*\0guarded\";a:1:{i:0;s:1:\"*\";}}i:3;O:19:\"App\\Models\\Language\":33:{s:13:\"\0*\0connection\";s:5:\"mysql\";s:8:\"\0*\0table\";s:9:\"languages\";s:13:\"\0*\0primaryKey\";s:2:\"id\";s:10:\"\0*\0keyType\";s:3:\"int\";s:12:\"incrementing\";b:1;s:7:\"\0*\0with\";a:0:{}s:12:\"\0*\0withCount\";a:0:{}s:19:\"preventsLazyLoading\";b:0;s:10:\"\0*\0perPage\";i:15;s:6:\"exists\";b:1;s:18:\"wasRecentlyCreated\";b:0;s:28:\"\0*\0escapeWhenCastingToString\";b:0;s:13:\"\0*\0attributes\";a:11:{s:2:\"id\";i:4;s:4:\"name\";s:6:\"German\";s:4:\"code\";s:2:\"de\";s:11:\"native_name\";s:7:\"Deutsch\";s:9:\"direction\";s:3:\"ltr\";s:4:\"flag\";s:8:\"🇩🇪\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:0;s:10:\"sort_order\";i:4;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:11:\"\0*\0original\";a:11:{s:2:\"id\";i:4;s:4:\"name\";s:6:\"German\";s:4:\"code\";s:2:\"de\";s:11:\"native_name\";s:7:\"Deutsch\";s:9:\"direction\";s:3:\"ltr\";s:4:\"flag\";s:8:\"🇩🇪\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:0;s:10:\"sort_order\";i:4;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:10:\"\0*\0changes\";a:0:{}s:11:\"\0*\0previous\";a:0:{}s:8:\"\0*\0casts\";a:2:{s:9:\"is_active\";s:7:\"boolean\";s:10:\"is_default\";s:7:\"boolean\";}s:17:\"\0*\0classCastCache\";a:0:{}s:21:\"\0*\0attributeCastCache\";a:0:{}s:13:\"\0*\0dateFormat\";N;s:10:\"\0*\0appends\";a:0:{}s:19:\"\0*\0dispatchesEvents\";a:0:{}s:14:\"\0*\0observables\";a:0:{}s:12:\"\0*\0relations\";a:0:{}s:10:\"\0*\0touches\";a:0:{}s:27:\"\0*\0relationAutoloadCallback\";N;s:26:\"\0*\0relationAutoloadContext\";N;s:10:\"timestamps\";b:1;s:13:\"usesUniqueIds\";b:0;s:9:\"\0*\0hidden\";a:0:{}s:10:\"\0*\0visible\";a:0:{}s:11:\"\0*\0fillable\";a:8:{i:0;s:4:\"name\";i:1;s:4:\"code\";i:2;s:11:\"native_name\";i:3;s:9:\"direction\";i:4;s:4:\"flag\";i:5;s:9:\"is_active\";i:6;s:10:\"is_default\";i:7;s:10:\"sort_order\";}s:10:\"\0*\0guarded\";a:1:{i:0;s:1:\"*\";}}i:4;O:19:\"App\\Models\\Language\":33:{s:13:\"\0*\0connection\";s:5:\"mysql\";s:8:\"\0*\0table\";s:9:\"languages\";s:13:\"\0*\0primaryKey\";s:2:\"id\";s:10:\"\0*\0keyType\";s:3:\"int\";s:12:\"incrementing\";b:1;s:7:\"\0*\0with\";a:0:{}s:12:\"\0*\0withCount\";a:0:{}s:19:\"preventsLazyLoading\";b:0;s:10:\"\0*\0perPage\";i:15;s:6:\"exists\";b:1;s:18:\"wasRecentlyCreated\";b:0;s:28:\"\0*\0escapeWhenCastingToString\";b:0;s:13:\"\0*\0attributes\";a:11:{s:2:\"id\";i:5;s:4:\"name\";s:10:\"Portuguese\";s:4:\"code\";s:2:\"pt\";s:11:\"native_name\";s:10:\"Português\";s:9:\"direction\";s:3:\"ltr\";s:4:\"flag\";s:8:\"🇧🇷\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:0;s:10:\"sort_order\";i:5;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:11:\"\0*\0original\";a:11:{s:2:\"id\";i:5;s:4:\"name\";s:10:\"Portuguese\";s:4:\"code\";s:2:\"pt\";s:11:\"native_name\";s:10:\"Português\";s:9:\"direction\";s:3:\"ltr\";s:4:\"flag\";s:8:\"🇧🇷\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:0;s:10:\"sort_order\";i:5;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:10:\"\0*\0changes\";a:0:{}s:11:\"\0*\0previous\";a:0:{}s:8:\"\0*\0casts\";a:2:{s:9:\"is_active\";s:7:\"boolean\";s:10:\"is_default\";s:7:\"boolean\";}s:17:\"\0*\0classCastCache\";a:0:{}s:21:\"\0*\0attributeCastCache\";a:0:{}s:13:\"\0*\0dateFormat\";N;s:10:\"\0*\0appends\";a:0:{}s:19:\"\0*\0dispatchesEvents\";a:0:{}s:14:\"\0*\0observables\";a:0:{}s:12:\"\0*\0relations\";a:0:{}s:10:\"\0*\0touches\";a:0:{}s:27:\"\0*\0relationAutoloadCallback\";N;s:26:\"\0*\0relationAutoloadContext\";N;s:10:\"timestamps\";b:1;s:13:\"usesUniqueIds\";b:0;s:9:\"\0*\0hidden\";a:0:{}s:10:\"\0*\0visible\";a:0:{}s:11:\"\0*\0fillable\";a:8:{i:0;s:4:\"name\";i:1;s:4:\"code\";i:2;s:11:\"native_name\";i:3;s:9:\"direction\";i:4;s:4:\"flag\";i:5;s:9:\"is_active\";i:6;s:10:\"is_default\";i:7;s:10:\"sort_order\";}s:10:\"\0*\0guarded\";a:1:{i:0;s:1:\"*\";}}i:5;O:19:\"App\\Models\\Language\":33:{s:13:\"\0*\0connection\";s:5:\"mysql\";s:8:\"\0*\0table\";s:9:\"languages\";s:13:\"\0*\0primaryKey\";s:2:\"id\";s:10:\"\0*\0keyType\";s:3:\"int\";s:12:\"incrementing\";b:1;s:7:\"\0*\0with\";a:0:{}s:12:\"\0*\0withCount\";a:0:{}s:19:\"preventsLazyLoading\";b:0;s:10:\"\0*\0perPage\";i:15;s:6:\"exists\";b:1;s:18:\"wasRecentlyCreated\";b:0;s:28:\"\0*\0escapeWhenCastingToString\";b:0;s:13:\"\0*\0attributes\";a:11:{s:2:\"id\";i:6;s:4:\"name\";s:6:\"Arabic\";s:4:\"code\";s:2:\"ar\";s:11:\"native_name\";s:14:\"العربية\";s:9:\"direction\";s:3:\"rtl\";s:4:\"flag\";s:8:\"🇸🇦\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:0;s:10:\"sort_order\";i:6;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:11:\"\0*\0original\";a:11:{s:2:\"id\";i:6;s:4:\"name\";s:6:\"Arabic\";s:4:\"code\";s:2:\"ar\";s:11:\"native_name\";s:14:\"العربية\";s:9:\"direction\";s:3:\"rtl\";s:4:\"flag\";s:8:\"🇸🇦\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:0;s:10:\"sort_order\";i:6;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:10:\"\0*\0changes\";a:0:{}s:11:\"\0*\0previous\";a:0:{}s:8:\"\0*\0casts\";a:2:{s:9:\"is_active\";s:7:\"boolean\";s:10:\"is_default\";s:7:\"boolean\";}s:17:\"\0*\0classCastCache\";a:0:{}s:21:\"\0*\0attributeCastCache\";a:0:{}s:13:\"\0*\0dateFormat\";N;s:10:\"\0*\0appends\";a:0:{}s:19:\"\0*\0dispatchesEvents\";a:0:{}s:14:\"\0*\0observables\";a:0:{}s:12:\"\0*\0relations\";a:0:{}s:10:\"\0*\0touches\";a:0:{}s:27:\"\0*\0relationAutoloadCallback\";N;s:26:\"\0*\0relationAutoloadContext\";N;s:10:\"timestamps\";b:1;s:13:\"usesUniqueIds\";b:0;s:9:\"\0*\0hidden\";a:0:{}s:10:\"\0*\0visible\";a:0:{}s:11:\"\0*\0fillable\";a:8:{i:0;s:4:\"name\";i:1;s:4:\"code\";i:2;s:11:\"native_name\";i:3;s:9:\"direction\";i:4;s:4:\"flag\";i:5;s:9:\"is_active\";i:6;s:10:\"is_default\";i:7;s:10:\"sort_order\";}s:10:\"\0*\0guarded\";a:1:{i:0;s:1:\"*\";}}i:6;O:19:\"App\\Models\\Language\":33:{s:13:\"\0*\0connection\";s:5:\"mysql\";s:8:\"\0*\0table\";s:9:\"languages\";s:13:\"\0*\0primaryKey\";s:2:\"id\";s:10:\"\0*\0keyType\";s:3:\"int\";s:12:\"incrementing\";b:1;s:7:\"\0*\0with\";a:0:{}s:12:\"\0*\0withCount\";a:0:{}s:19:\"preventsLazyLoading\";b:0;s:10:\"\0*\0perPage\";i:15;s:6:\"exists\";b:1;s:18:\"wasRecentlyCreated\";b:0;s:28:\"\0*\0escapeWhenCastingToString\";b:0;s:13:\"\0*\0attributes\";a:11:{s:2:\"id\";i:7;s:4:\"name\";s:5:\"Hindi\";s:4:\"code\";s:2:\"hi\";s:11:\"native_name\";s:18:\"हिन्दी\";s:9:\"direction\";s:3:\"ltr\";s:4:\"flag\";s:8:\"🇮🇳\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:0;s:10:\"sort_order\";i:7;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:11:\"\0*\0original\";a:11:{s:2:\"id\";i:7;s:4:\"name\";s:5:\"Hindi\";s:4:\"code\";s:2:\"hi\";s:11:\"native_name\";s:18:\"हिन्दी\";s:9:\"direction\";s:3:\"ltr\";s:4:\"flag\";s:8:\"🇮🇳\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:0;s:10:\"sort_order\";i:7;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:10:\"\0*\0changes\";a:0:{}s:11:\"\0*\0previous\";a:0:{}s:8:\"\0*\0casts\";a:2:{s:9:\"is_active\";s:7:\"boolean\";s:10:\"is_default\";s:7:\"boolean\";}s:17:\"\0*\0classCastCache\";a:0:{}s:21:\"\0*\0attributeCastCache\";a:0:{}s:13:\"\0*\0dateFormat\";N;s:10:\"\0*\0appends\";a:0:{}s:19:\"\0*\0dispatchesEvents\";a:0:{}s:14:\"\0*\0observables\";a:0:{}s:12:\"\0*\0relations\";a:0:{}s:10:\"\0*\0touches\";a:0:{}s:27:\"\0*\0relationAutoloadCallback\";N;s:26:\"\0*\0relationAutoloadContext\";N;s:10:\"timestamps\";b:1;s:13:\"usesUniqueIds\";b:0;s:9:\"\0*\0hidden\";a:0:{}s:10:\"\0*\0visible\";a:0:{}s:11:\"\0*\0fillable\";a:8:{i:0;s:4:\"name\";i:1;s:4:\"code\";i:2;s:11:\"native_name\";i:3;s:9:\"direction\";i:4;s:4:\"flag\";i:5;s:9:\"is_active\";i:6;s:10:\"is_default\";i:7;s:10:\"sort_order\";}s:10:\"\0*\0guarded\";a:1:{i:0;s:1:\"*\";}}i:7;O:19:\"App\\Models\\Language\":33:{s:13:\"\0*\0connection\";s:5:\"mysql\";s:8:\"\0*\0table\";s:9:\"languages\";s:13:\"\0*\0primaryKey\";s:2:\"id\";s:10:\"\0*\0keyType\";s:3:\"int\";s:12:\"incrementing\";b:1;s:7:\"\0*\0with\";a:0:{}s:12:\"\0*\0withCount\";a:0:{}s:19:\"preventsLazyLoading\";b:0;s:10:\"\0*\0perPage\";i:15;s:6:\"exists\";b:1;s:18:\"wasRecentlyCreated\";b:0;s:28:\"\0*\0escapeWhenCastingToString\";b:0;s:13:\"\0*\0attributes\";a:11:{s:2:\"id\";i:11;s:4:\"name\";s:7:\"Turkish\";s:4:\"code\";s:2:\"tr\";s:11:\"native_name\";s:8:\"Türkçe\";s:9:\"direction\";s:3:\"ltr\";s:4:\"flag\";s:8:\"🇹🇷\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:0;s:10:\"sort_order\";i:11;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:11:\"\0*\0original\";a:11:{s:2:\"id\";i:11;s:4:\"name\";s:7:\"Turkish\";s:4:\"code\";s:2:\"tr\";s:11:\"native_name\";s:8:\"Türkçe\";s:9:\"direction\";s:3:\"ltr\";s:4:\"flag\";s:8:\"🇹🇷\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:0;s:10:\"sort_order\";i:11;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:10:\"\0*\0changes\";a:0:{}s:11:\"\0*\0previous\";a:0:{}s:8:\"\0*\0casts\";a:2:{s:9:\"is_active\";s:7:\"boolean\";s:10:\"is_default\";s:7:\"boolean\";}s:17:\"\0*\0classCastCache\";a:0:{}s:21:\"\0*\0attributeCastCache\";a:0:{}s:13:\"\0*\0dateFormat\";N;s:10:\"\0*\0appends\";a:0:{}s:19:\"\0*\0dispatchesEvents\";a:0:{}s:14:\"\0*\0observables\";a:0:{}s:12:\"\0*\0relations\";a:0:{}s:10:\"\0*\0touches\";a:0:{}s:27:\"\0*\0relationAutoloadCallback\";N;s:26:\"\0*\0relationAutoloadContext\";N;s:10:\"timestamps\";b:1;s:13:\"usesUniqueIds\";b:0;s:9:\"\0*\0hidden\";a:0:{}s:10:\"\0*\0visible\";a:0:{}s:11:\"\0*\0fillable\";a:8:{i:0;s:4:\"name\";i:1;s:4:\"code\";i:2;s:11:\"native_name\";i:3;s:9:\"direction\";i:4;s:4:\"flag\";i:5;s:9:\"is_active\";i:6;s:10:\"is_default\";i:7;s:10:\"sort_order\";}s:10:\"\0*\0guarded\";a:1:{i:0;s:1:\"*\";}}i:8;O:19:\"App\\Models\\Language\":33:{s:13:\"\0*\0connection\";s:5:\"mysql\";s:8:\"\0*\0table\";s:9:\"languages\";s:13:\"\0*\0primaryKey\";s:2:\"id\";s:10:\"\0*\0keyType\";s:3:\"int\";s:12:\"incrementing\";b:1;s:7:\"\0*\0with\";a:0:{}s:12:\"\0*\0withCount\";a:0:{}s:19:\"preventsLazyLoading\";b:0;s:10:\"\0*\0perPage\";i:15;s:6:\"exists\";b:1;s:18:\"wasRecentlyCreated\";b:0;s:28:\"\0*\0escapeWhenCastingToString\";b:0;s:13:\"\0*\0attributes\";a:11:{s:2:\"id\";i:13;s:4:\"name\";s:7:\"Italian\";s:4:\"code\";s:2:\"it\";s:11:\"native_name\";s:8:\"Italiano\";s:9:\"direction\";s:3:\"ltr\";s:4:\"flag\";s:8:\"🇮🇹\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:0;s:10:\"sort_order\";i:13;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:11:\"\0*\0original\";a:11:{s:2:\"id\";i:13;s:4:\"name\";s:7:\"Italian\";s:4:\"code\";s:2:\"it\";s:11:\"native_name\";s:8:\"Italiano\";s:9:\"direction\";s:3:\"ltr\";s:4:\"flag\";s:8:\"🇮🇹\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:0;s:10:\"sort_order\";i:13;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:10:\"\0*\0changes\";a:0:{}s:11:\"\0*\0previous\";a:0:{}s:8:\"\0*\0casts\";a:2:{s:9:\"is_active\";s:7:\"boolean\";s:10:\"is_default\";s:7:\"boolean\";}s:17:\"\0*\0classCastCache\";a:0:{}s:21:\"\0*\0attributeCastCache\";a:0:{}s:13:\"\0*\0dateFormat\";N;s:10:\"\0*\0appends\";a:0:{}s:19:\"\0*\0dispatchesEvents\";a:0:{}s:14:\"\0*\0observables\";a:0:{}s:12:\"\0*\0relations\";a:0:{}s:10:\"\0*\0touches\";a:0:{}s:27:\"\0*\0relationAutoloadCallback\";N;s:26:\"\0*\0relationAutoloadContext\";N;s:10:\"timestamps\";b:1;s:13:\"usesUniqueIds\";b:0;s:9:\"\0*\0hidden\";a:0:{}s:10:\"\0*\0visible\";a:0:{}s:11:\"\0*\0fillable\";a:8:{i:0;s:4:\"name\";i:1;s:4:\"code\";i:2;s:11:\"native_name\";i:3;s:9:\"direction\";i:4;s:4:\"flag\";i:5;s:9:\"is_active\";i:6;s:10:\"is_default\";i:7;s:10:\"sort_order\";}s:10:\"\0*\0guarded\";a:1:{i:0;s:1:\"*\";}}i:9;O:19:\"App\\Models\\Language\":33:{s:13:\"\0*\0connection\";s:5:\"mysql\";s:8:\"\0*\0table\";s:9:\"languages\";s:13:\"\0*\0primaryKey\";s:2:\"id\";s:10:\"\0*\0keyType\";s:3:\"int\";s:12:\"incrementing\";b:1;s:7:\"\0*\0with\";a:0:{}s:12:\"\0*\0withCount\";a:0:{}s:19:\"preventsLazyLoading\";b:0;s:10:\"\0*\0perPage\";i:15;s:6:\"exists\";b:1;s:18:\"wasRecentlyCreated\";b:0;s:28:\"\0*\0escapeWhenCastingToString\";b:0;s:13:\"\0*\0attributes\";a:11:{s:2:\"id\";i:15;s:4:\"name\";s:7:\"Bengali\";s:4:\"code\";s:2:\"bn\";s:11:\"native_name\";s:15:\"বাংলা\";s:9:\"direction\";s:3:\"ltr\";s:4:\"flag\";s:8:\"🇧🇩\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:0;s:10:\"sort_order\";i:15;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:11:\"\0*\0original\";a:11:{s:2:\"id\";i:15;s:4:\"name\";s:7:\"Bengali\";s:4:\"code\";s:2:\"bn\";s:11:\"native_name\";s:15:\"বাংলা\";s:9:\"direction\";s:3:\"ltr\";s:4:\"flag\";s:8:\"🇧🇩\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:0;s:10:\"sort_order\";i:15;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:10:\"\0*\0changes\";a:0:{}s:11:\"\0*\0previous\";a:0:{}s:8:\"\0*\0casts\";a:2:{s:9:\"is_active\";s:7:\"boolean\";s:10:\"is_default\";s:7:\"boolean\";}s:17:\"\0*\0classCastCache\";a:0:{}s:21:\"\0*\0attributeCastCache\";a:0:{}s:13:\"\0*\0dateFormat\";N;s:10:\"\0*\0appends\";a:0:{}s:19:\"\0*\0dispatchesEvents\";a:0:{}s:14:\"\0*\0observables\";a:0:{}s:12:\"\0*\0relations\";a:0:{}s:10:\"\0*\0touches\";a:0:{}s:27:\"\0*\0relationAutoloadCallback\";N;s:26:\"\0*\0relationAutoloadContext\";N;s:10:\"timestamps\";b:1;s:13:\"usesUniqueIds\";b:0;s:9:\"\0*\0hidden\";a:0:{}s:10:\"\0*\0visible\";a:0:{}s:11:\"\0*\0fillable\";a:8:{i:0;s:4:\"name\";i:1;s:4:\"code\";i:2;s:11:\"native_name\";i:3;s:9:\"direction\";i:4;s:4:\"flag\";i:5;s:9:\"is_active\";i:6;s:10:\"is_default\";i:7;s:10:\"sort_order\";}s:10:\"\0*\0guarded\";a:1:{i:0;s:1:\"*\";}}}s:28:\"\0*\0escapeWhenCastingToString\";b:0;}', '1785060016');
INSERT INTO `cache` VALUES ('email-govaio-cache-admin:dashboard', 'a:23:{s:3:\"mrr\";i:0;s:3:\"arr\";i:0;s:16:\"revenueThisMonth\";i:0;s:16:\"revenueLastMonth\";i:0;s:13:\"revenueGrowth\";i:0;s:10:\"totalUsers\";i:2;s:11:\"activeUsers\";s:1:\"2\";s:17:\"newUsersThisMonth\";s:1:\"2\";s:10:\"userGrowth\";i:0;s:15:\"totalWorkspaces\";i:2;s:16:\"planDistribution\";O:29:\"Illuminate\\Support\\Collection\":2:{s:8:\"\0*\0items\";a:0:{}s:28:\"\0*\0escapeWhenCastingToString\";b:0;}s:16:\"openTicketsCount\";i:0;s:16:\"aiUsageThisMonth\";O:8:\"stdClass\":3:{s:14:\"total_requests\";i:0;s:12:\"total_tokens\";s:1:\"0\";s:10:\"total_cost\";s:7:\"0.00000\";}s:11:\"recentUsers\";O:39:\"Illuminate\\Database\\Eloquent\\Collection\":2:{s:8:\"\0*\0items\";a:2:{i:0;O:15:\"App\\Models\\User\":36:{s:13:\"\0*\0connection\";s:5:\"mysql\";s:8:\"\0*\0table\";s:5:\"users\";s:13:\"\0*\0primaryKey\";s:2:\"id\";s:10:\"\0*\0keyType\";s:3:\"int\";s:12:\"incrementing\";b:1;s:7:\"\0*\0with\";a:0:{}s:12:\"\0*\0withCount\";a:0:{}s:19:\"preventsLazyLoading\";b:0;s:10:\"\0*\0perPage\";i:15;s:6:\"exists\";b:1;s:18:\"wasRecentlyCreated\";b:0;s:28:\"\0*\0escapeWhenCastingToString\";b:0;s:13:\"\0*\0attributes\";a:31:{s:2:\"id\";i:2;s:4:\"uuid\";s:36:\"d7e34fe1-cc92-4fe1-aa4d-58fbd0d7e68e\";s:4:\"name\";s:10:\"Jitu Rajak\";s:5:\"email\";s:20:\"workspace@govaio.com\";s:17:\"email_verified_at\";s:19:\"2026-07-26 09:03:00\";s:8:\"password\";s:60:\"$2y$12$aeXpdY6tna3C2XZw03gHJOeXObNESA/rjznNXoUMDmBwDyO61IFKy\";s:5:\"phone\";s:13:\"+918877111199\";s:11:\"avatar_path\";N;s:8:\"timezone\";s:3:\"UTC\";s:6:\"locale\";s:2:\"en\";s:8:\"language\";s:2:\"en\";s:13:\"currency_code\";s:3:\"USD\";s:24:\"notification_preferences\";N;s:6:\"status\";s:6:\"active\";s:8:\"is_admin\";i:0;s:10:\"admin_role\";N;s:12:\"suspended_at\";N;s:17:\"suspension_reason\";N;s:21:\"deletion_requested_at\";N;s:13:\"referral_code\";s:8:\"KXYBT8XS\";s:11:\"referred_by\";N;s:18:\"two_factor_enabled\";i:0;s:17:\"two_factor_secret\";N;s:25:\"two_factor_recovery_codes\";N;s:17:\"two_factor_method\";N;s:23:\"two_factor_confirmed_at\";N;s:19:\"active_workspace_id\";i:2;s:20:\"force_password_reset\";i:0;s:14:\"remember_token\";N;s:10:\"created_at\";s:19:\"2026-07-26 09:02:41\";s:10:\"updated_at\";s:19:\"2026-07-26 09:03:09\";}s:11:\"\0*\0original\";a:31:{s:2:\"id\";i:2;s:4:\"uuid\";s:36:\"d7e34fe1-cc92-4fe1-aa4d-58fbd0d7e68e\";s:4:\"name\";s:10:\"Jitu Rajak\";s:5:\"email\";s:20:\"workspace@govaio.com\";s:17:\"email_verified_at\";s:19:\"2026-07-26 09:03:00\";s:8:\"password\";s:60:\"$2y$12$aeXpdY6tna3C2XZw03gHJOeXObNESA/rjznNXoUMDmBwDyO61IFKy\";s:5:\"phone\";s:13:\"+918877111199\";s:11:\"avatar_path\";N;s:8:\"timezone\";s:3:\"UTC\";s:6:\"locale\";s:2:\"en\";s:8:\"language\";s:2:\"en\";s:13:\"currency_code\";s:3:\"USD\";s:24:\"notification_preferences\";N;s:6:\"status\";s:6:\"active\";s:8:\"is_admin\";i:0;s:10:\"admin_role\";N;s:12:\"suspended_at\";N;s:17:\"suspension_reason\";N;s:21:\"deletion_requested_at\";N;s:13:\"referral_code\";s:8:\"KXYBT8XS\";s:11:\"referred_by\";N;s:18:\"two_factor_enabled\";i:0;s:17:\"two_factor_secret\";N;s:25:\"two_factor_recovery_codes\";N;s:17:\"two_factor_method\";N;s:23:\"two_factor_confirmed_at\";N;s:19:\"active_workspace_id\";i:2;s:20:\"force_password_reset\";i:0;s:14:\"remember_token\";N;s:10:\"created_at\";s:19:\"2026-07-26 09:02:41\";s:10:\"updated_at\";s:19:\"2026-07-26 09:03:09\";}s:10:\"\0*\0changes\";a:0:{}s:11:\"\0*\0previous\";a:0:{}s:8:\"\0*\0casts\";a:11:{s:17:\"email_verified_at\";s:8:\"datetime\";s:8:\"password\";s:6:\"hashed\";s:8:\"is_admin\";s:7:\"boolean\";s:18:\"two_factor_enabled\";s:7:\"boolean\";s:23:\"two_factor_confirmed_at\";s:8:\"datetime\";s:20:\"force_password_reset\";s:7:\"boolean\";s:12:\"suspended_at\";s:8:\"datetime\";s:21:\"deletion_requested_at\";s:8:\"datetime\";s:24:\"notification_preferences\";s:5:\"array\";s:17:\"two_factor_secret\";s:9:\"encrypted\";s:25:\"two_factor_recovery_codes\";s:9:\"encrypted\";}s:17:\"\0*\0classCastCache\";a:0:{}s:21:\"\0*\0attributeCastCache\";a:0:{}s:13:\"\0*\0dateFormat\";N;s:10:\"\0*\0appends\";a:0:{}s:19:\"\0*\0dispatchesEvents\";a:0:{}s:14:\"\0*\0observables\";a:0:{}s:12:\"\0*\0relations\";a:1:{s:11:\"currentPlan\";N;}s:10:\"\0*\0touches\";a:0:{}s:27:\"\0*\0relationAutoloadCallback\";N;s:26:\"\0*\0relationAutoloadContext\";N;s:10:\"timestamps\";b:1;s:13:\"usesUniqueIds\";b:0;s:9:\"\0*\0hidden\";a:4:{i:0;s:8:\"password\";i:1;s:14:\"remember_token\";i:2;s:17:\"two_factor_secret\";i:3;s:25:\"two_factor_recovery_codes\";}s:10:\"\0*\0visible\";a:0:{}s:11:\"\0*\0fillable\";a:18:{i:0;s:4:\"name\";i:1;s:5:\"email\";i:2;s:8:\"password\";i:3;s:5:\"phone\";i:4;s:11:\"avatar_path\";i:5;s:8:\"timezone\";i:6;s:6:\"locale\";i:7;s:8:\"language\";i:8;s:13:\"currency_code\";i:9;s:6:\"status\";i:10;s:13:\"referral_code\";i:11;s:11:\"referred_by\";i:12;s:19:\"active_workspace_id\";i:13;s:18:\"two_factor_enabled\";i:14;s:17:\"two_factor_secret\";i:15;s:25:\"two_factor_recovery_codes\";i:16;s:17:\"two_factor_method\";i:17;s:24:\"notification_preferences\";}s:10:\"\0*\0guarded\";a:1:{i:0;s:1:\"*\";}s:19:\"\0*\0authPasswordName\";s:8:\"password\";s:20:\"\0*\0rememberTokenName\";s:14:\"remember_token\";s:14:\"\0*\0accessToken\";N;}i:1;O:15:\"App\\Models\\User\":36:{s:13:\"\0*\0connection\";s:5:\"mysql\";s:8:\"\0*\0table\";s:5:\"users\";s:13:\"\0*\0primaryKey\";s:2:\"id\";s:10:\"\0*\0keyType\";s:3:\"int\";s:12:\"incrementing\";b:1;s:7:\"\0*\0with\";a:0:{}s:12:\"\0*\0withCount\";a:0:{}s:19:\"preventsLazyLoading\";b:0;s:10:\"\0*\0perPage\";i:15;s:6:\"exists\";b:1;s:18:\"wasRecentlyCreated\";b:0;s:28:\"\0*\0escapeWhenCastingToString\";b:0;s:13:\"\0*\0attributes\";a:31:{s:2:\"id\";i:1;s:4:\"uuid\";s:36:\"164ce420-678e-4342-b41e-4c23edc67d55\";s:4:\"name\";s:4:\"Jitu\";s:5:\"email\";s:19:\"workspace@govaio.in\";s:17:\"email_verified_at\";s:19:\"2026-07-26 09:00:46\";s:8:\"password\";s:60:\"$2y$12$SgrxhRImi2gxiaLVFChlNOnZRjPV6q1YADnNM2OB4Az2JNfcBwgP2\";s:5:\"phone\";N;s:11:\"avatar_path\";N;s:8:\"timezone\";s:3:\"UTC\";s:6:\"locale\";s:2:\"en\";s:8:\"language\";s:2:\"en\";s:13:\"currency_code\";s:3:\"USD\";s:24:\"notification_preferences\";N;s:6:\"status\";s:6:\"active\";s:8:\"is_admin\";i:1;s:10:\"admin_role\";s:11:\"super_admin\";s:12:\"suspended_at\";N;s:17:\"suspension_reason\";N;s:21:\"deletion_requested_at\";N;s:13:\"referral_code\";s:8:\"6WGJRARZ\";s:11:\"referred_by\";N;s:18:\"two_factor_enabled\";i:0;s:17:\"two_factor_secret\";N;s:25:\"two_factor_recovery_codes\";N;s:17:\"two_factor_method\";N;s:23:\"two_factor_confirmed_at\";N;s:19:\"active_workspace_id\";i:1;s:20:\"force_password_reset\";i:0;s:14:\"remember_token\";N;s:10:\"created_at\";s:19:\"2026-07-26 09:00:12\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:46\";}s:11:\"\0*\0original\";a:31:{s:2:\"id\";i:1;s:4:\"uuid\";s:36:\"164ce420-678e-4342-b41e-4c23edc67d55\";s:4:\"name\";s:4:\"Jitu\";s:5:\"email\";s:19:\"workspace@govaio.in\";s:17:\"email_verified_at\";s:19:\"2026-07-26 09:00:46\";s:8:\"password\";s:60:\"$2y$12$SgrxhRImi2gxiaLVFChlNOnZRjPV6q1YADnNM2OB4Az2JNfcBwgP2\";s:5:\"phone\";N;s:11:\"avatar_path\";N;s:8:\"timezone\";s:3:\"UTC\";s:6:\"locale\";s:2:\"en\";s:8:\"language\";s:2:\"en\";s:13:\"currency_code\";s:3:\"USD\";s:24:\"notification_preferences\";N;s:6:\"status\";s:6:\"active\";s:8:\"is_admin\";i:1;s:10:\"admin_role\";s:11:\"super_admin\";s:12:\"suspended_at\";N;s:17:\"suspension_reason\";N;s:21:\"deletion_requested_at\";N;s:13:\"referral_code\";s:8:\"6WGJRARZ\";s:11:\"referred_by\";N;s:18:\"two_factor_enabled\";i:0;s:17:\"two_factor_secret\";N;s:25:\"two_factor_recovery_codes\";N;s:17:\"two_factor_method\";N;s:23:\"two_factor_confirmed_at\";N;s:19:\"active_workspace_id\";i:1;s:20:\"force_password_reset\";i:0;s:14:\"remember_token\";N;s:10:\"created_at\";s:19:\"2026-07-26 09:00:12\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:46\";}s:10:\"\0*\0changes\";a:0:{}s:11:\"\0*\0previous\";a:0:{}s:8:\"\0*\0casts\";a:11:{s:17:\"email_verified_at\";s:8:\"datetime\";s:8:\"password\";s:6:\"hashed\";s:8:\"is_admin\";s:7:\"boolean\";s:18:\"two_factor_enabled\";s:7:\"boolean\";s:23:\"two_factor_confirmed_at\";s:8:\"datetime\";s:20:\"force_password_reset\";s:7:\"boolean\";s:12:\"suspended_at\";s:8:\"datetime\";s:21:\"deletion_requested_at\";s:8:\"datetime\";s:24:\"notification_preferences\";s:5:\"array\";s:17:\"two_factor_secret\";s:9:\"encrypted\";s:25:\"two_factor_recovery_codes\";s:9:\"encrypted\";}s:17:\"\0*\0classCastCache\";a:0:{}s:21:\"\0*\0attributeCastCache\";a:0:{}s:13:\"\0*\0dateFormat\";N;s:10:\"\0*\0appends\";a:0:{}s:19:\"\0*\0dispatchesEvents\";a:0:{}s:14:\"\0*\0observables\";a:0:{}s:12:\"\0*\0relations\";a:1:{s:11:\"currentPlan\";N;}s:10:\"\0*\0touches\";a:0:{}s:27:\"\0*\0relationAutoloadCallback\";N;s:26:\"\0*\0relationAutoloadContext\";N;s:10:\"timestamps\";b:1;s:13:\"usesUniqueIds\";b:0;s:9:\"\0*\0hidden\";a:4:{i:0;s:8:\"password\";i:1;s:14:\"remember_token\";i:2;s:17:\"two_factor_secret\";i:3;s:25:\"two_factor_recovery_codes\";}s:10:\"\0*\0visible\";a:0:{}s:11:\"\0*\0fillable\";a:18:{i:0;s:4:\"name\";i:1;s:5:\"email\";i:2;s:8:\"password\";i:3;s:5:\"phone\";i:4;s:11:\"avatar_path\";i:5;s:8:\"timezone\";i:6;s:6:\"locale\";i:7;s:8:\"language\";i:8;s:13:\"currency_code\";i:9;s:6:\"status\";i:10;s:13:\"referral_code\";i:11;s:11:\"referred_by\";i:12;s:19:\"active_workspace_id\";i:13;s:18:\"two_factor_enabled\";i:14;s:17:\"two_factor_secret\";i:15;s:25:\"two_factor_recovery_codes\";i:16;s:17:\"two_factor_method\";i:17;s:24:\"notification_preferences\";}s:10:\"\0*\0guarded\";a:1:{i:0;s:1:\"*\";}s:19:\"\0*\0authPasswordName\";s:8:\"password\";s:20:\"\0*\0rememberTokenName\";s:14:\"remember_token\";s:14:\"\0*\0accessToken\";N;}}s:28:\"\0*\0escapeWhenCastingToString\";b:0;}s:14:\"recentPayments\";O:39:\"Illuminate\\Database\\Eloquent\\Collection\":2:{s:8:\"\0*\0items\";a:0:{}s:28:\"\0*\0escapeWhenCastingToString\";b:0;}s:13:\"recentTickets\";O:29:\"Illuminate\\Support\\Collection\":2:{s:8:\"\0*\0items\";a:0:{}s:28:\"\0*\0escapeWhenCastingToString\";b:0;}s:14:\"monthlyRevenue\";a:6:{i:0;a:2:{s:5:\"month\";s:3:\"Feb\";s:7:\"revenue\";d:0;}i:1;a:2:{s:5:\"month\";s:3:\"Mar\";s:7:\"revenue\";d:0;}i:2;a:2:{s:5:\"month\";s:3:\"Apr\";s:7:\"revenue\";d:0;}i:3;a:2:{s:5:\"month\";s:3:\"May\";s:7:\"revenue\";d:0;}i:4;a:2:{s:5:\"month\";s:3:\"Jun\";s:7:\"revenue\";d:0;}i:5;a:2:{s:5:\"month\";s:3:\"Jul\";s:7:\"revenue\";d:0;}}s:14:\"monthlySignups\";a:6:{i:0;a:2:{s:5:\"month\";s:3:\"Feb\";s:5:\"count\";d:0;}i:1;a:2:{s:5:\"month\";s:3:\"Mar\";s:5:\"count\";d:0;}i:2;a:2:{s:5:\"month\";s:3:\"Apr\";s:5:\"count\";d:0;}i:3;a:2:{s:5:\"month\";s:3:\"May\";s:5:\"count\";d:0;}i:4;a:2:{s:5:\"month\";s:3:\"Jun\";s:5:\"count\";d:0;}i:5;a:2:{s:5:\"month\";s:3:\"Jul\";s:5:\"count\";d:2;}}s:11:\"payingUsers\";i:0;s:9:\"churnRate\";i:0;s:14:\"systemSnapshot\";a:6:{s:10:\"two_factor\";s:3:\"0/1\";s:11:\"blocked_ips\";i:0;s:13:\"queue_pending\";i:0;s:11:\"failed_jobs\";i:0;s:14:\"email_accounts\";i:1;s:12:\"social_login\";s:8:\"Disabled\";}s:14:\"recentActivity\";O:29:\"Illuminate\\Support\\Collection\":2:{s:8:\"\0*\0items\";a:1:{i:0;a:4:{s:4:\"user\";s:4:\"Jitu\";s:6:\"action\";s:12:\"User created\";s:11:\"description\";s:7:\"User #2\";s:4:\"time\";s:6:\"5m ago\";}}s:28:\"\0*\0escapeWhenCastingToString\";b:0;}s:17:\"newUsersLastMonth\";s:1:\"0\";}', '1785056954');
INSERT INTO `cache` VALUES ('email-govaio-cache-blocked_ip:49.37.74.152', 'b:0;', '1785057321');
INSERT INTO `cache` VALUES ('email-govaio-cache-currency_USD', 'O:19:\"App\\Models\\Currency\":33:{s:13:\"\0*\0connection\";s:5:\"mysql\";s:8:\"\0*\0table\";s:10:\"currencies\";s:13:\"\0*\0primaryKey\";s:2:\"id\";s:10:\"\0*\0keyType\";s:3:\"int\";s:12:\"incrementing\";b:1;s:7:\"\0*\0with\";a:0:{}s:12:\"\0*\0withCount\";a:0:{}s:19:\"preventsLazyLoading\";b:0;s:10:\"\0*\0perPage\";i:15;s:6:\"exists\";b:1;s:18:\"wasRecentlyCreated\";b:0;s:28:\"\0*\0escapeWhenCastingToString\";b:0;s:13:\"\0*\0attributes\";a:14:{s:2:\"id\";i:1;s:4:\"name\";s:9:\"US Dollar\";s:4:\"code\";s:3:\"USD\";s:6:\"symbol\";s:1:\"$\";s:15:\"symbol_position\";s:6:\"before\";s:17:\"decimal_separator\";s:1:\".\";s:18:\"thousand_separator\";s:1:\",\";s:14:\"decimal_digits\";i:2;s:13:\"exchange_rate\";s:8:\"1.000000\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:1;s:10:\"sort_order\";i:1;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:11:\"\0*\0original\";a:14:{s:2:\"id\";i:1;s:4:\"name\";s:9:\"US Dollar\";s:4:\"code\";s:3:\"USD\";s:6:\"symbol\";s:1:\"$\";s:15:\"symbol_position\";s:6:\"before\";s:17:\"decimal_separator\";s:1:\".\";s:18:\"thousand_separator\";s:1:\",\";s:14:\"decimal_digits\";i:2;s:13:\"exchange_rate\";s:8:\"1.000000\";s:9:\"is_active\";i:1;s:10:\"is_default\";i:1;s:10:\"sort_order\";i:1;s:10:\"created_at\";s:19:\"2026-07-26 09:00:11\";s:10:\"updated_at\";s:19:\"2026-07-26 09:00:11\";}s:10:\"\0*\0changes\";a:0:{}s:11:\"\0*\0previous\";a:0:{}s:8:\"\0*\0casts\";a:3:{s:13:\"exchange_rate\";s:9:\"decimal:6\";s:9:\"is_active\";s:7:\"boolean\";s:10:\"is_default\";s:7:\"boolean\";}s:17:\"\0*\0classCastCache\";a:0:{}s:21:\"\0*\0attributeCastCache\";a:0:{}s:13:\"\0*\0dateFormat\";N;s:10:\"\0*\0appends\";a:0:{}s:19:\"\0*\0dispatchesEvents\";a:0:{}s:14:\"\0*\0observables\";a:0:{}s:12:\"\0*\0relations\";a:0:{}s:10:\"\0*\0touches\";a:0:{}s:27:\"\0*\0relationAutoloadCallback\";N;s:26:\"\0*\0relationAutoloadContext\";N;s:10:\"timestamps\";b:1;s:13:\"usesUniqueIds\";b:0;s:9:\"\0*\0hidden\";a:0:{}s:10:\"\0*\0visible\";a:0:{}s:11:\"\0*\0fillable\";a:11:{i:0;s:4:\"name\";i:1;s:4:\"code\";i:2;s:6:\"symbol\";i:3;s:15:\"symbol_position\";i:4;s:17:\"decimal_separator\";i:5;s:18:\"thousand_separator\";i:6;s:14:\"decimal_digits\";i:7;s:13:\"exchange_rate\";i:8;s:9:\"is_active\";i:9;s:10:\"is_default\";i:10;s:10:\"sort_order\";}s:10:\"\0*\0guarded\";a:1:{i:0;s:1:\"*\";}}', '1785060046');
INSERT INTO `cache` VALUES ('email-govaio-cache-da4b9237bacccdf19c0760cab7aec4a8359010b0', 'i:2;', '1785057054');
INSERT INTO `cache` VALUES ('email-govaio-cache-da4b9237bacccdf19c0760cab7aec4a8359010b0:timer', 'i:1785057054;', '1785057054');
INSERT INTO `cache` VALUES ('email-govaio-cache-dashboard:checklist:2', 'a:6:{s:15:\"hasEmailAccount\";b:1;s:9:\"hasKbDocs\";b:0;s:14:\"hasSentAiReply\";b:0;s:11:\"hasAiConfig\";b:1;s:11:\"hasChannels\";b:0;s:14:\"hasTeamMembers\";b:0;}', '1785057248');
INSERT INTO `cache` VALUES ('email-govaio-cache-dashboard:core-stats:2', 'a:4:{s:18:\"conversation_count\";i:0;s:8:\"avg_time\";N;s:16:\"ai_replies_count\";i:0;s:13:\"contact_count\";i:0;}', '1785056978');
INSERT INTO `cache` VALUES ('email-govaio-cache-e1b4e26e34fecaf31a438cf15dac5194', 'i:1;', '1785056953');
INSERT INTO `cache` VALUES ('email-govaio-cache-e1b4e26e34fecaf31a438cf15dac5194:timer', 'i:1785056953;', '1785056953');
INSERT INTO `cache` VALUES ('email-govaio-cache-php_timezones', 'a:419:{i:0;s:14:\"Africa/Abidjan\";i:1;s:12:\"Africa/Accra\";i:2;s:18:\"Africa/Addis_Ababa\";i:3;s:14:\"Africa/Algiers\";i:4;s:13:\"Africa/Asmara\";i:5;s:13:\"Africa/Bamako\";i:6;s:13:\"Africa/Bangui\";i:7;s:13:\"Africa/Banjul\";i:8;s:13:\"Africa/Bissau\";i:9;s:15:\"Africa/Blantyre\";i:10;s:18:\"Africa/Brazzaville\";i:11;s:16:\"Africa/Bujumbura\";i:12;s:12:\"Africa/Cairo\";i:13;s:17:\"Africa/Casablanca\";i:14;s:12:\"Africa/Ceuta\";i:15;s:14:\"Africa/Conakry\";i:16;s:12:\"Africa/Dakar\";i:17;s:20:\"Africa/Dar_es_Salaam\";i:18;s:15:\"Africa/Djibouti\";i:19;s:13:\"Africa/Douala\";i:20;s:15:\"Africa/El_Aaiun\";i:21;s:15:\"Africa/Freetown\";i:22;s:15:\"Africa/Gaborone\";i:23;s:13:\"Africa/Harare\";i:24;s:19:\"Africa/Johannesburg\";i:25;s:11:\"Africa/Juba\";i:26;s:14:\"Africa/Kampala\";i:27;s:15:\"Africa/Khartoum\";i:28;s:13:\"Africa/Kigali\";i:29;s:15:\"Africa/Kinshasa\";i:30;s:12:\"Africa/Lagos\";i:31;s:17:\"Africa/Libreville\";i:32;s:11:\"Africa/Lome\";i:33;s:13:\"Africa/Luanda\";i:34;s:17:\"Africa/Lubumbashi\";i:35;s:13:\"Africa/Lusaka\";i:36;s:13:\"Africa/Malabo\";i:37;s:13:\"Africa/Maputo\";i:38;s:13:\"Africa/Maseru\";i:39;s:14:\"Africa/Mbabane\";i:40;s:16:\"Africa/Mogadishu\";i:41;s:15:\"Africa/Monrovia\";i:42;s:14:\"Africa/Nairobi\";i:43;s:15:\"Africa/Ndjamena\";i:44;s:13:\"Africa/Niamey\";i:45;s:17:\"Africa/Nouakchott\";i:46;s:18:\"Africa/Ouagadougou\";i:47;s:17:\"Africa/Porto-Novo\";i:48;s:15:\"Africa/Sao_Tome\";i:49;s:14:\"Africa/Tripoli\";i:50;s:12:\"Africa/Tunis\";i:51;s:15:\"Africa/Windhoek\";i:52;s:12:\"America/Adak\";i:53;s:17:\"America/Anchorage\";i:54;s:16:\"America/Anguilla\";i:55;s:15:\"America/Antigua\";i:56;s:17:\"America/Araguaina\";i:57;s:30:\"America/Argentina/Buenos_Aires\";i:58;s:27:\"America/Argentina/Catamarca\";i:59;s:25:\"America/Argentina/Cordoba\";i:60;s:23:\"America/Argentina/Jujuy\";i:61;s:26:\"America/Argentina/La_Rioja\";i:62;s:25:\"America/Argentina/Mendoza\";i:63;s:30:\"America/Argentina/Rio_Gallegos\";i:64;s:23:\"America/Argentina/Salta\";i:65;s:26:\"America/Argentina/San_Juan\";i:66;s:26:\"America/Argentina/San_Luis\";i:67;s:25:\"America/Argentina/Tucuman\";i:68;s:25:\"America/Argentina/Ushuaia\";i:69;s:13:\"America/Aruba\";i:70;s:16:\"America/Asuncion\";i:71;s:16:\"America/Atikokan\";i:72;s:13:\"America/Bahia\";i:73;s:22:\"America/Bahia_Banderas\";i:74;s:16:\"America/Barbados\";i:75;s:13:\"America/Belem\";i:76;s:14:\"America/Belize\";i:77;s:20:\"America/Blanc-Sablon\";i:78;s:17:\"America/Boa_Vista\";i:79;s:14:\"America/Bogota\";i:80;s:13:\"America/Boise\";i:81;s:21:\"America/Cambridge_Bay\";i:82;s:20:\"America/Campo_Grande\";i:83;s:14:\"America/Cancun\";i:84;s:15:\"America/Caracas\";i:85;s:15:\"America/Cayenne\";i:86;s:14:\"America/Cayman\";i:87;s:15:\"America/Chicago\";i:88;s:17:\"America/Chihuahua\";i:89;s:21:\"America/Ciudad_Juarez\";i:90;s:18:\"America/Costa_Rica\";i:91;s:17:\"America/Coyhaique\";i:92;s:15:\"America/Creston\";i:93;s:14:\"America/Cuiaba\";i:94;s:15:\"America/Curacao\";i:95;s:20:\"America/Danmarkshavn\";i:96;s:14:\"America/Dawson\";i:97;s:20:\"America/Dawson_Creek\";i:98;s:14:\"America/Denver\";i:99;s:15:\"America/Detroit\";i:100;s:16:\"America/Dominica\";i:101;s:16:\"America/Edmonton\";i:102;s:16:\"America/Eirunepe\";i:103;s:19:\"America/El_Salvador\";i:104;s:19:\"America/Fort_Nelson\";i:105;s:17:\"America/Fortaleza\";i:106;s:17:\"America/Glace_Bay\";i:107;s:17:\"America/Goose_Bay\";i:108;s:18:\"America/Grand_Turk\";i:109;s:15:\"America/Grenada\";i:110;s:18:\"America/Guadeloupe\";i:111;s:17:\"America/Guatemala\";i:112;s:17:\"America/Guayaquil\";i:113;s:14:\"America/Guyana\";i:114;s:15:\"America/Halifax\";i:115;s:14:\"America/Havana\";i:116;s:18:\"America/Hermosillo\";i:117;s:28:\"America/Indiana/Indianapolis\";i:118;s:20:\"America/Indiana/Knox\";i:119;s:23:\"America/Indiana/Marengo\";i:120;s:26:\"America/Indiana/Petersburg\";i:121;s:25:\"America/Indiana/Tell_City\";i:122;s:21:\"America/Indiana/Vevay\";i:123;s:25:\"America/Indiana/Vincennes\";i:124;s:23:\"America/Indiana/Winamac\";i:125;s:14:\"America/Inuvik\";i:126;s:15:\"America/Iqaluit\";i:127;s:15:\"America/Jamaica\";i:128;s:14:\"America/Juneau\";i:129;s:27:\"America/Kentucky/Louisville\";i:130;s:27:\"America/Kentucky/Monticello\";i:131;s:18:\"America/Kralendijk\";i:132;s:14:\"America/La_Paz\";i:133;s:12:\"America/Lima\";i:134;s:19:\"America/Los_Angeles\";i:135;s:21:\"America/Lower_Princes\";i:136;s:14:\"America/Maceio\";i:137;s:15:\"America/Managua\";i:138;s:14:\"America/Manaus\";i:139;s:15:\"America/Marigot\";i:140;s:18:\"America/Martinique\";i:141;s:17:\"America/Matamoros\";i:142;s:16:\"America/Mazatlan\";i:143;s:17:\"America/Menominee\";i:144;s:14:\"America/Merida\";i:145;s:18:\"America/Metlakatla\";i:146;s:19:\"America/Mexico_City\";i:147;s:16:\"America/Miquelon\";i:148;s:15:\"America/Moncton\";i:149;s:17:\"America/Monterrey\";i:150;s:18:\"America/Montevideo\";i:151;s:18:\"America/Montserrat\";i:152;s:14:\"America/Nassau\";i:153;s:16:\"America/New_York\";i:154;s:12:\"America/Nome\";i:155;s:15:\"America/Noronha\";i:156;s:27:\"America/North_Dakota/Beulah\";i:157;s:27:\"America/North_Dakota/Center\";i:158;s:30:\"America/North_Dakota/New_Salem\";i:159;s:12:\"America/Nuuk\";i:160;s:15:\"America/Ojinaga\";i:161;s:14:\"America/Panama\";i:162;s:18:\"America/Paramaribo\";i:163;s:15:\"America/Phoenix\";i:164;s:22:\"America/Port-au-Prince\";i:165;s:21:\"America/Port_of_Spain\";i:166;s:19:\"America/Porto_Velho\";i:167;s:19:\"America/Puerto_Rico\";i:168;s:20:\"America/Punta_Arenas\";i:169;s:20:\"America/Rankin_Inlet\";i:170;s:14:\"America/Recife\";i:171;s:14:\"America/Regina\";i:172;s:16:\"America/Resolute\";i:173;s:18:\"America/Rio_Branco\";i:174;s:16:\"America/Santarem\";i:175;s:16:\"America/Santiago\";i:176;s:21:\"America/Santo_Domingo\";i:177;s:17:\"America/Sao_Paulo\";i:178;s:20:\"America/Scoresbysund\";i:179;s:13:\"America/Sitka\";i:180;s:21:\"America/St_Barthelemy\";i:181;s:16:\"America/St_Johns\";i:182;s:16:\"America/St_Kitts\";i:183;s:16:\"America/St_Lucia\";i:184;s:17:\"America/St_Thomas\";i:185;s:18:\"America/St_Vincent\";i:186;s:21:\"America/Swift_Current\";i:187;s:19:\"America/Tegucigalpa\";i:188;s:13:\"America/Thule\";i:189;s:15:\"America/Tijuana\";i:190;s:15:\"America/Toronto\";i:191;s:15:\"America/Tortola\";i:192;s:17:\"America/Vancouver\";i:193;s:18:\"America/Whitehorse\";i:194;s:16:\"America/Winnipeg\";i:195;s:15:\"America/Yakutat\";i:196;s:16:\"Antarctica/Casey\";i:197;s:16:\"Antarctica/Davis\";i:198;s:25:\"Antarctica/DumontDUrville\";i:199;s:20:\"Antarctica/Macquarie\";i:200;s:17:\"Antarctica/Mawson\";i:201;s:18:\"Antarctica/McMurdo\";i:202;s:17:\"Antarctica/Palmer\";i:203;s:18:\"Antarctica/Rothera\";i:204;s:16:\"Antarctica/Syowa\";i:205;s:16:\"Antarctica/Troll\";i:206;s:17:\"Antarctica/Vostok\";i:207;s:19:\"Arctic/Longyearbyen\";i:208;s:9:\"Asia/Aden\";i:209;s:11:\"Asia/Almaty\";i:210;s:10:\"Asia/Amman\";i:211;s:11:\"Asia/Anadyr\";i:212;s:10:\"Asia/Aqtau\";i:213;s:11:\"Asia/Aqtobe\";i:214;s:13:\"Asia/Ashgabat\";i:215;s:11:\"Asia/Atyrau\";i:216;s:12:\"Asia/Baghdad\";i:217;s:12:\"Asia/Bahrain\";i:218;s:9:\"Asia/Baku\";i:219;s:12:\"Asia/Bangkok\";i:220;s:12:\"Asia/Barnaul\";i:221;s:11:\"Asia/Beirut\";i:222;s:12:\"Asia/Bishkek\";i:223;s:11:\"Asia/Brunei\";i:224;s:10:\"Asia/Chita\";i:225;s:12:\"Asia/Colombo\";i:226;s:13:\"Asia/Damascus\";i:227;s:10:\"Asia/Dhaka\";i:228;s:9:\"Asia/Dili\";i:229;s:10:\"Asia/Dubai\";i:230;s:13:\"Asia/Dushanbe\";i:231;s:14:\"Asia/Famagusta\";i:232;s:9:\"Asia/Gaza\";i:233;s:11:\"Asia/Hebron\";i:234;s:16:\"Asia/Ho_Chi_Minh\";i:235;s:14:\"Asia/Hong_Kong\";i:236;s:9:\"Asia/Hovd\";i:237;s:12:\"Asia/Irkutsk\";i:238;s:12:\"Asia/Jakarta\";i:239;s:13:\"Asia/Jayapura\";i:240;s:14:\"Asia/Jerusalem\";i:241;s:10:\"Asia/Kabul\";i:242;s:14:\"Asia/Kamchatka\";i:243;s:12:\"Asia/Karachi\";i:244;s:14:\"Asia/Kathmandu\";i:245;s:13:\"Asia/Khandyga\";i:246;s:12:\"Asia/Kolkata\";i:247;s:16:\"Asia/Krasnoyarsk\";i:248;s:17:\"Asia/Kuala_Lumpur\";i:249;s:12:\"Asia/Kuching\";i:250;s:11:\"Asia/Kuwait\";i:251;s:10:\"Asia/Macau\";i:252;s:12:\"Asia/Magadan\";i:253;s:13:\"Asia/Makassar\";i:254;s:11:\"Asia/Manila\";i:255;s:11:\"Asia/Muscat\";i:256;s:12:\"Asia/Nicosia\";i:257;s:17:\"Asia/Novokuznetsk\";i:258;s:16:\"Asia/Novosibirsk\";i:259;s:9:\"Asia/Omsk\";i:260;s:9:\"Asia/Oral\";i:261;s:15:\"Asia/Phnom_Penh\";i:262;s:14:\"Asia/Pontianak\";i:263;s:14:\"Asia/Pyongyang\";i:264;s:10:\"Asia/Qatar\";i:265;s:13:\"Asia/Qostanay\";i:266;s:14:\"Asia/Qyzylorda\";i:267;s:11:\"Asia/Riyadh\";i:268;s:13:\"Asia/Sakhalin\";i:269;s:14:\"Asia/Samarkand\";i:270;s:10:\"Asia/Seoul\";i:271;s:13:\"Asia/Shanghai\";i:272;s:14:\"Asia/Singapore\";i:273;s:18:\"Asia/Srednekolymsk\";i:274;s:11:\"Asia/Taipei\";i:275;s:13:\"Asia/Tashkent\";i:276;s:12:\"Asia/Tbilisi\";i:277;s:11:\"Asia/Tehran\";i:278;s:12:\"Asia/Thimphu\";i:279;s:10:\"Asia/Tokyo\";i:280;s:10:\"Asia/Tomsk\";i:281;s:16:\"Asia/Ulaanbaatar\";i:282;s:11:\"Asia/Urumqi\";i:283;s:13:\"Asia/Ust-Nera\";i:284;s:14:\"Asia/Vientiane\";i:285;s:16:\"Asia/Vladivostok\";i:286;s:12:\"Asia/Yakutsk\";i:287;s:11:\"Asia/Yangon\";i:288;s:18:\"Asia/Yekaterinburg\";i:289;s:12:\"Asia/Yerevan\";i:290;s:15:\"Atlantic/Azores\";i:291;s:16:\"Atlantic/Bermuda\";i:292;s:15:\"Atlantic/Canary\";i:293;s:19:\"Atlantic/Cape_Verde\";i:294;s:14:\"Atlantic/Faroe\";i:295;s:16:\"Atlantic/Madeira\";i:296;s:18:\"Atlantic/Reykjavik\";i:297;s:22:\"Atlantic/South_Georgia\";i:298;s:18:\"Atlantic/St_Helena\";i:299;s:16:\"Atlantic/Stanley\";i:300;s:18:\"Australia/Adelaide\";i:301;s:18:\"Australia/Brisbane\";i:302;s:21:\"Australia/Broken_Hill\";i:303;s:16:\"Australia/Darwin\";i:304;s:15:\"Australia/Eucla\";i:305;s:16:\"Australia/Hobart\";i:306;s:18:\"Australia/Lindeman\";i:307;s:19:\"Australia/Lord_Howe\";i:308;s:19:\"Australia/Melbourne\";i:309;s:15:\"Australia/Perth\";i:310;s:16:\"Australia/Sydney\";i:311;s:16:\"Europe/Amsterdam\";i:312;s:14:\"Europe/Andorra\";i:313;s:16:\"Europe/Astrakhan\";i:314;s:13:\"Europe/Athens\";i:315;s:15:\"Europe/Belgrade\";i:316;s:13:\"Europe/Berlin\";i:317;s:17:\"Europe/Bratislava\";i:318;s:15:\"Europe/Brussels\";i:319;s:16:\"Europe/Bucharest\";i:320;s:15:\"Europe/Budapest\";i:321;s:15:\"Europe/Busingen\";i:322;s:15:\"Europe/Chisinau\";i:323;s:17:\"Europe/Copenhagen\";i:324;s:13:\"Europe/Dublin\";i:325;s:16:\"Europe/Gibraltar\";i:326;s:15:\"Europe/Guernsey\";i:327;s:15:\"Europe/Helsinki\";i:328;s:18:\"Europe/Isle_of_Man\";i:329;s:15:\"Europe/Istanbul\";i:330;s:13:\"Europe/Jersey\";i:331;s:18:\"Europe/Kaliningrad\";i:332;s:12:\"Europe/Kirov\";i:333;s:11:\"Europe/Kyiv\";i:334;s:13:\"Europe/Lisbon\";i:335;s:16:\"Europe/Ljubljana\";i:336;s:13:\"Europe/London\";i:337;s:17:\"Europe/Luxembourg\";i:338;s:13:\"Europe/Madrid\";i:339;s:12:\"Europe/Malta\";i:340;s:16:\"Europe/Mariehamn\";i:341;s:12:\"Europe/Minsk\";i:342;s:13:\"Europe/Monaco\";i:343;s:13:\"Europe/Moscow\";i:344;s:11:\"Europe/Oslo\";i:345;s:12:\"Europe/Paris\";i:346;s:16:\"Europe/Podgorica\";i:347;s:13:\"Europe/Prague\";i:348;s:11:\"Europe/Riga\";i:349;s:11:\"Europe/Rome\";i:350;s:13:\"Europe/Samara\";i:351;s:17:\"Europe/San_Marino\";i:352;s:15:\"Europe/Sarajevo\";i:353;s:14:\"Europe/Saratov\";i:354;s:17:\"Europe/Simferopol\";i:355;s:13:\"Europe/Skopje\";i:356;s:12:\"Europe/Sofia\";i:357;s:16:\"Europe/Stockholm\";i:358;s:14:\"Europe/Tallinn\";i:359;s:13:\"Europe/Tirane\";i:360;s:16:\"Europe/Ulyanovsk\";i:361;s:12:\"Europe/Vaduz\";i:362;s:14:\"Europe/Vatican\";i:363;s:13:\"Europe/Vienna\";i:364;s:14:\"Europe/Vilnius\";i:365;s:16:\"Europe/Volgograd\";i:366;s:13:\"Europe/Warsaw\";i:367;s:13:\"Europe/Zagreb\";i:368;s:13:\"Europe/Zurich\";i:369;s:19:\"Indian/Antananarivo\";i:370;s:13:\"Indian/Chagos\";i:371;s:16:\"Indian/Christmas\";i:372;s:12:\"Indian/Cocos\";i:373;s:13:\"Indian/Comoro\";i:374;s:16:\"Indian/Kerguelen\";i:375;s:11:\"Indian/Mahe\";i:376;s:15:\"Indian/Maldives\";i:377;s:16:\"Indian/Mauritius\";i:378;s:14:\"Indian/Mayotte\";i:379;s:14:\"Indian/Reunion\";i:380;s:12:\"Pacific/Apia\";i:381;s:16:\"Pacific/Auckland\";i:382;s:20:\"Pacific/Bougainville\";i:383;s:15:\"Pacific/Chatham\";i:384;s:13:\"Pacific/Chuuk\";i:385;s:14:\"Pacific/Easter\";i:386;s:13:\"Pacific/Efate\";i:387;s:15:\"Pacific/Fakaofo\";i:388;s:12:\"Pacific/Fiji\";i:389;s:16:\"Pacific/Funafuti\";i:390;s:17:\"Pacific/Galapagos\";i:391;s:15:\"Pacific/Gambier\";i:392;s:19:\"Pacific/Guadalcanal\";i:393;s:12:\"Pacific/Guam\";i:394;s:16:\"Pacific/Honolulu\";i:395;s:14:\"Pacific/Kanton\";i:396;s:18:\"Pacific/Kiritimati\";i:397;s:14:\"Pacific/Kosrae\";i:398;s:17:\"Pacific/Kwajalein\";i:399;s:14:\"Pacific/Majuro\";i:400;s:17:\"Pacific/Marquesas\";i:401;s:14:\"Pacific/Midway\";i:402;s:13:\"Pacific/Nauru\";i:403;s:12:\"Pacific/Niue\";i:404;s:15:\"Pacific/Norfolk\";i:405;s:14:\"Pacific/Noumea\";i:406;s:17:\"Pacific/Pago_Pago\";i:407;s:13:\"Pacific/Palau\";i:408;s:16:\"Pacific/Pitcairn\";i:409;s:15:\"Pacific/Pohnpei\";i:410;s:20:\"Pacific/Port_Moresby\";i:411;s:17:\"Pacific/Rarotonga\";i:412;s:14:\"Pacific/Saipan\";i:413;s:14:\"Pacific/Tahiti\";i:414;s:14:\"Pacific/Tarawa\";i:415;s:17:\"Pacific/Tongatapu\";i:416;s:12:\"Pacific/Wake\";i:417;s:14:\"Pacific/Wallis\";i:418;s:3:\"UTC\";}', '1785143039');
INSERT INTO `cache` VALUES ('email-govaio-cache-spatie.permission.cache', 'a:3:{s:5:\"alias\";a:4:{s:1:\"a\";s:2:\"id\";s:1:\"b\";s:4:\"name\";s:1:\"c\";s:10:\"guard_name\";s:1:\"r\";s:5:\"roles\";}s:11:\"permissions\";a:76:{i:0;a:4:{s:1:\"a\";i:1;s:1:\"b\";s:10:\"users.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:4:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;}}i:1;a:4:{s:1:\"a\";i:2;s:1:\"b\";s:12:\"users.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:2;a:4:{s:1:\"a\";i:3;s:1:\"b\";s:12:\"users.update\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:3;a:4:{s:1:\"a\";i:4;s:1:\"b\";s:12:\"users.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:4;a:4:{s:1:\"a\";i:5;s:1:\"b\";s:12:\"users.export\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:5;a:4:{s:1:\"a\";i:6;s:1:\"b\";s:12:\"users.import\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:6;a:4:{s:1:\"a\";i:7;s:1:\"b\";s:10:\"roles.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:7;a:4:{s:1:\"a\";i:8;s:1:\"b\";s:12:\"roles.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:8;a:4:{s:1:\"a\";i:9;s:1:\"b\";s:12:\"roles.update\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:9;a:4:{s:1:\"a\";i:10;s:1:\"b\";s:12:\"roles.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:10;a:4:{s:1:\"a\";i:11;s:1:\"b\";s:12:\"roles.export\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:11;a:4:{s:1:\"a\";i:12;s:1:\"b\";s:12:\"roles.import\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:12;a:4:{s:1:\"a\";i:13;s:1:\"b\";s:16:\"permissions.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:13;a:4:{s:1:\"a\";i:14;s:1:\"b\";s:18:\"permissions.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:14;a:4:{s:1:\"a\";i:15;s:1:\"b\";s:18:\"permissions.update\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:15;a:4:{s:1:\"a\";i:16;s:1:\"b\";s:18:\"permissions.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:16;a:4:{s:1:\"a\";i:17;s:1:\"b\";s:18:\"permissions.export\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:17;a:4:{s:1:\"a\";i:18;s:1:\"b\";s:18:\"permissions.import\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:18;a:4:{s:1:\"a\";i:19;s:1:\"b\";s:10:\"plans.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}}i:19;a:4:{s:1:\"a\";i:20;s:1:\"b\";s:12:\"plans.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:20;a:4:{s:1:\"a\";i:21;s:1:\"b\";s:12:\"plans.update\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:21;a:4:{s:1:\"a\";i:22;s:1:\"b\";s:12:\"plans.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:22;a:4:{s:1:\"a\";i:23;s:1:\"b\";s:12:\"plans.export\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:23;a:4:{s:1:\"a\";i:24;s:1:\"b\";s:12:\"plans.import\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:24;a:4:{s:1:\"a\";i:25;s:1:\"b\";s:13:\"payments.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}}i:25;a:4:{s:1:\"a\";i:26;s:1:\"b\";s:15:\"payments.export\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:26;a:4:{s:1:\"a\";i:27;s:1:\"b\";s:15:\"payments.import\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:27;a:4:{s:1:\"a\";i:28;s:1:\"b\";s:15:\"payments.refund\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:28;a:4:{s:1:\"a\";i:29;s:1:\"b\";s:12:\"coupons.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:29;a:4:{s:1:\"a\";i:30;s:1:\"b\";s:14:\"coupons.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:30;a:4:{s:1:\"a\";i:31;s:1:\"b\";s:14:\"coupons.update\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:31;a:4:{s:1:\"a\";i:32;s:1:\"b\";s:14:\"coupons.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:32;a:4:{s:1:\"a\";i:33;s:1:\"b\";s:14:\"coupons.export\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:33;a:4:{s:1:\"a\";i:34;s:1:\"b\";s:14:\"coupons.import\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:34;a:4:{s:1:\"a\";i:35;s:1:\"b\";s:12:\"tickets.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:4:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;}}i:35;a:4:{s:1:\"a\";i:36;s:1:\"b\";s:14:\"tickets.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:4:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;}}i:36;a:4:{s:1:\"a\";i:37;s:1:\"b\";s:14:\"tickets.update\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:4:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;}}i:37;a:4:{s:1:\"a\";i:38;s:1:\"b\";s:14:\"tickets.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:38;a:4:{s:1:\"a\";i:39;s:1:\"b\";s:14:\"tickets.export\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:39;a:4:{s:1:\"a\";i:40;s:1:\"b\";s:14:\"tickets.import\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:40;a:4:{s:1:\"a\";i:41;s:1:\"b\";s:15:\"audit-logs.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}}i:41;a:4:{s:1:\"a\";i:42;s:1:\"b\";s:17:\"audit-logs.export\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:42;a:4:{s:1:\"a\";i:43;s:1:\"b\";s:24:\"security-audit-logs.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:43;a:4:{s:1:\"a\";i:44;s:1:\"b\";s:26:\"security-audit-logs.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:44;a:4:{s:1:\"a\";i:45;s:1:\"b\";s:26:\"security-audit-logs.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:45;a:4:{s:1:\"a\";i:46;s:1:\"b\";s:26:\"security-audit-logs.export\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:46;a:4:{s:1:\"a\";i:47;s:1:\"b\";s:16:\"blocked-ips.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:47;a:4:{s:1:\"a\";i:48;s:1:\"b\";s:18:\"blocked-ips.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:48;a:4:{s:1:\"a\";i:49;s:1:\"b\";s:18:\"blocked-ips.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:49;a:4:{s:1:\"a\";i:50;s:1:\"b\";s:18:\"blocked-ips.export\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:50;a:4:{s:1:\"a\";i:51;s:1:\"b\";s:18:\"blocked-ips.import\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:51;a:4:{s:1:\"a\";i:52;s:1:\"b\";s:22:\"blocked-locations.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:52;a:4:{s:1:\"a\";i:53;s:1:\"b\";s:24:\"blocked-locations.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:53;a:4:{s:1:\"a\";i:54;s:1:\"b\";s:24:\"blocked-locations.update\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:54;a:4:{s:1:\"a\";i:55;s:1:\"b\";s:24:\"blocked-locations.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:55;a:4:{s:1:\"a\";i:56;s:1:\"b\";s:24:\"blocked-locations.export\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:56;a:4:{s:1:\"a\";i:57;s:1:\"b\";s:24:\"blocked-locations.import\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:57;a:4:{s:1:\"a\";i:58;s:1:\"b\";s:13:\"settings.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:58;a:4:{s:1:\"a\";i:59;s:1:\"b\";s:15:\"settings.update\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:59;a:4:{s:1:\"a\";i:60;s:1:\"b\";s:22:\"security-settings.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:60;a:4:{s:1:\"a\";i:61;s:1:\"b\";s:24:\"security-settings.update\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:61;a:4:{s:1:\"a\";i:62;s:1:\"b\";s:20:\"system-settings.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:62;a:4:{s:1:\"a\";i:63;s:1:\"b\";s:22:\"system-settings.update\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:63;a:4:{s:1:\"a\";i:64;s:1:\"b\";s:21:\"payment-gateways.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:64;a:4:{s:1:\"a\";i:65;s:1:\"b\";s:23:\"payment-gateways.update\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:65;a:4:{s:1:\"a\";i:66;s:1:\"b\";s:17:\"ai-providers.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:66;a:4:{s:1:\"a\";i:67;s:1:\"b\";s:19:\"ai-providers.update\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:67;a:4:{s:1:\"a\";i:68;s:1:\"b\";s:13:\"ai-usage.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}}i:68;a:4:{s:1:\"a\";i:69;s:1:\"b\";s:15:\"ai-usage.export\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:69;a:4:{s:1:\"a\";i:70;s:1:\"b\";s:25:\"email-deliverability.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:70;a:4:{s:1:\"a\";i:71;s:1:\"b\";s:8:\"cms.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:71;a:4:{s:1:\"a\";i:72;s:1:\"b\";s:10:\"cms.update\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:72;a:4:{s:1:\"a\";i:73;s:1:\"b\";s:18:\"notifications.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:4:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;}}i:73;a:4:{s:1:\"a\";i:74;s:1:\"b\";s:11:\"system.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:74;a:4:{s:1:\"a\";i:75;s:1:\"b\";s:22:\"frontend-settings.view\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}i:75;a:4:{s:1:\"a\";i:76;s:1:\"b\";s:24:\"frontend-settings.update\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:2:{i:0;i:1;i:1;i:2;}}}s:5:\"roles\";a:4:{i:0;a:3:{s:1:\"a\";i:1;s:1:\"b\";s:11:\"Super Admin\";s:1:\"c\";s:3:\"web\";}i:1;a:3:{s:1:\"a\";i:2;s:1:\"b\";s:5:\"Admin\";s:1:\"c\";s:3:\"web\";}i:2;a:3:{s:1:\"a\";i:3;s:1:\"b\";s:9:\"Moderator\";s:1:\"c\";s:3:\"web\";}i:3;a:3:{s:1:\"a\";i:4;s:1:\"b\";s:7:\"Support\";s:1:\"c\";s:3:\"web\";}}}', '1785142846');
INSERT INTO `cache` VALUES ('email-govaio-cache-system_settings_all', 'a:0:{}', '1785057119');
INSERT INTO `cache` VALUES ('email-govaio-cache-workspace:2:2', 'a:2:{s:9:\"workspace\";O:20:\"App\\Models\\Workspace\":34:{s:13:\"\0*\0connection\";s:5:\"mysql\";s:8:\"\0*\0table\";s:10:\"workspaces\";s:13:\"\0*\0primaryKey\";s:2:\"id\";s:10:\"\0*\0keyType\";s:3:\"int\";s:12:\"incrementing\";b:1;s:7:\"\0*\0with\";a:0:{}s:12:\"\0*\0withCount\";a:0:{}s:19:\"preventsLazyLoading\";b:0;s:10:\"\0*\0perPage\";i:15;s:6:\"exists\";b:1;s:18:\"wasRecentlyCreated\";b:0;s:28:\"\0*\0escapeWhenCastingToString\";b:0;s:13:\"\0*\0attributes\";a:16:{s:2:\"id\";i:2;s:4:\"uuid\";s:36:\"2725f8fd-2b3c-4a00-9285-34a6822be538\";s:4:\"name\";s:22:\"Jitu Rajak\'s Workspace\";s:4:\"slug\";s:27:\"jitu-rajaks-workspace-fkelo\";s:9:\"logo_path\";N;s:8:\"industry\";s:9:\"ecommerce\";s:9:\"team_size\";s:1:\"1\";s:8:\"timezone\";s:3:\"UTC\";s:8:\"settings\";N;s:14:\"business_hours\";s:401:\"{\"monday\":{\"enabled\":true,\"start\":\"09:00\",\"end\":\"17:00\"},\"tuesday\":{\"enabled\":true,\"start\":\"09:00\",\"end\":\"17:00\"},\"wednesday\":{\"enabled\":true,\"start\":\"09:00\",\"end\":\"17:00\"},\"thursday\":{\"enabled\":true,\"start\":\"09:00\",\"end\":\"17:00\"},\"friday\":{\"enabled\":true,\"start\":\"09:00\",\"end\":\"17:00\"},\"saturday\":{\"enabled\":true,\"start\":\"10:00\",\"end\":\"14:00\"},\"sunday\":{\"enabled\":true,\"start\":\"10:00\",\"end\":\"14:00\"}}\";s:8:\"holidays\";N;s:20:\"onboarding_completed\";i:0;s:15:\"onboarding_step\";i:5;s:10:\"created_at\";s:19:\"2026-07-26 09:03:09\";s:10:\"updated_at\";s:19:\"2026-07-26 09:03:42\";s:10:\"deleted_at\";N;}s:11:\"\0*\0original\";a:16:{s:2:\"id\";i:2;s:4:\"uuid\";s:36:\"2725f8fd-2b3c-4a00-9285-34a6822be538\";s:4:\"name\";s:22:\"Jitu Rajak\'s Workspace\";s:4:\"slug\";s:27:\"jitu-rajaks-workspace-fkelo\";s:9:\"logo_path\";N;s:8:\"industry\";s:9:\"ecommerce\";s:9:\"team_size\";s:1:\"1\";s:8:\"timezone\";s:3:\"UTC\";s:8:\"settings\";N;s:14:\"business_hours\";s:401:\"{\"monday\":{\"enabled\":true,\"start\":\"09:00\",\"end\":\"17:00\"},\"tuesday\":{\"enabled\":true,\"start\":\"09:00\",\"end\":\"17:00\"},\"wednesday\":{\"enabled\":true,\"start\":\"09:00\",\"end\":\"17:00\"},\"thursday\":{\"enabled\":true,\"start\":\"09:00\",\"end\":\"17:00\"},\"friday\":{\"enabled\":true,\"start\":\"09:00\",\"end\":\"17:00\"},\"saturday\":{\"enabled\":true,\"start\":\"10:00\",\"end\":\"14:00\"},\"sunday\":{\"enabled\":true,\"start\":\"10:00\",\"end\":\"14:00\"}}\";s:8:\"holidays\";N;s:20:\"onboarding_completed\";i:0;s:15:\"onboarding_step\";i:5;s:10:\"created_at\";s:19:\"2026-07-26 09:03:09\";s:10:\"updated_at\";s:19:\"2026-07-26 09:03:42\";s:10:\"deleted_at\";N;}s:10:\"\0*\0changes\";a:0:{}s:11:\"\0*\0previous\";a:0:{}s:8:\"\0*\0casts\";a:5:{s:8:\"settings\";s:5:\"array\";s:14:\"business_hours\";s:5:\"array\";s:8:\"holidays\";s:5:\"array\";s:20:\"onboarding_completed\";s:7:\"boolean\";s:10:\"deleted_at\";s:8:\"datetime\";}s:17:\"\0*\0classCastCache\";a:0:{}s:21:\"\0*\0attributeCastCache\";a:0:{}s:13:\"\0*\0dateFormat\";N;s:10:\"\0*\0appends\";a:0:{}s:19:\"\0*\0dispatchesEvents\";a:0:{}s:14:\"\0*\0observables\";a:0:{}s:12:\"\0*\0relations\";a:0:{}s:10:\"\0*\0touches\";a:0:{}s:27:\"\0*\0relationAutoloadCallback\";N;s:26:\"\0*\0relationAutoloadContext\";N;s:10:\"timestamps\";b:1;s:13:\"usesUniqueIds\";b:0;s:9:\"\0*\0hidden\";a:0:{}s:10:\"\0*\0visible\";a:0:{}s:11:\"\0*\0fillable\";a:11:{i:0;s:4:\"name\";i:1;s:4:\"slug\";i:2;s:9:\"logo_path\";i:3;s:8:\"industry\";i:4;s:9:\"team_size\";i:5;s:8:\"timezone\";i:6;s:8:\"settings\";i:7;s:14:\"business_hours\";i:8;s:8:\"holidays\";i:9;s:20:\"onboarding_completed\";i:10;s:15:\"onboarding_step\";}s:10:\"\0*\0guarded\";a:1:{i:0;s:1:\"*\";}s:16:\"\0*\0forceDeleting\";b:0;}s:4:\"role\";s:5:\"owner\";}', '1785057028');
INSERT INTO `cache` VALUES ('email-govaio-cache-ws_role:2:2', 's:5:\"owner\";', '1785057052');

CREATE TABLE `cache_locks` (
  `key` varchar(255) NOT NULL,
  `owner` varchar(255) NOT NULL,
  `expiration` int(11) NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `campaign_links` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `campaign_id` bigint(20) unsigned NOT NULL,
  `original_url` text NOT NULL,
  `tracking_hash` varchar(32) NOT NULL,
  `clicks_count` int(10) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `campaign_links_tracking_hash_unique` (`tracking_hash`),
  KEY `campaign_links_campaign_id_foreign` (`campaign_id`),
  CONSTRAINT `campaign_links_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `campaigns` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `campaign_recipients` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) NOT NULL,
  `campaign_id` bigint(20) unsigned NOT NULL,
  `contact_id` bigint(20) unsigned NOT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(32) DEFAULT NULL,
  `status` enum('pending','processing','sent','delivered','opened','clicked','bounced','unsubscribed','failed') NOT NULL DEFAULT 'pending',
  `variant` varchar(1) DEFAULT NULL,
  `sent_at` timestamp NULL DEFAULT NULL,
  `opened_at` timestamp NULL DEFAULT NULL,
  `clicked_at` timestamp NULL DEFAULT NULL,
  `bounced_at` timestamp NULL DEFAULT NULL,
  `unsubscribed_at` timestamp NULL DEFAULT NULL,
  `error_message` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `campaign_recipients_uuid_unique` (`uuid`),
  UNIQUE KEY `campaign_recipients_campaign_contact_unique` (`campaign_id`,`contact_id`),
  KEY `campaign_recipients_contact_id_foreign` (`contact_id`),
  KEY `campaign_recipients_campaign_id_status_index` (`campaign_id`,`status`),
  KEY `idx_camp_recip_campaign_status` (`campaign_id`,`status`),
  KEY `idx_camp_recip_campaign_variant` (`campaign_id`,`variant`),
  KEY `campaign_recipients_campaign_created_idx` (`campaign_id`,`created_at`),
  KEY `campaign_recipients_phone_index` (`phone`),
  CONSTRAINT `campaign_recipients_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `campaigns` (`id`) ON DELETE CASCADE,
  CONSTRAINT `campaign_recipients_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `campaigns` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) NOT NULL,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `created_by` bigint(20) unsigned NOT NULL,
  `email_account_id` bigint(20) unsigned DEFAULT NULL,
  `from_number` varchar(32) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `type` enum('regular','ab_test','drip') NOT NULL DEFAULT 'regular',
  `channel` enum('email','sms') NOT NULL DEFAULT 'email',
  `status` enum('draft','scheduled','sending','sent','paused','canceled') NOT NULL DEFAULT 'draft',
  `subject` varchar(255) DEFAULT NULL,
  `body_html` mediumtext DEFAULT NULL,
  `body_text` text DEFAULT NULL,
  `body_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`body_json`)),
  `preview_text` varchar(255) DEFAULT NULL,
  `audience_type` varchar(20) DEFAULT NULL,
  `audience_id` bigint(20) unsigned DEFAULT NULL,
  `audience_meta` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`audience_meta`)),
  `recipients_count` int(10) unsigned NOT NULL DEFAULT 0,
  `emails_per_minute` smallint(5) unsigned NOT NULL DEFAULT 60,
  `batch_size` smallint(5) unsigned NOT NULL DEFAULT 0,
  `batch_delay_seconds` smallint(5) unsigned NOT NULL DEFAULT 0,
  `sent_count` int(10) unsigned NOT NULL DEFAULT 0,
  `delivered_count` int(10) unsigned NOT NULL DEFAULT 0,
  `opened_count` int(10) unsigned NOT NULL DEFAULT 0,
  `clicked_count` int(10) unsigned NOT NULL DEFAULT 0,
  `bounced_count` int(10) unsigned NOT NULL DEFAULT 0,
  `unsubscribed_count` int(10) unsigned NOT NULL DEFAULT 0,
  `scheduled_at` timestamp NULL DEFAULT NULL,
  `sent_at` timestamp NULL DEFAULT NULL,
  `completed_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 `campaigns_uuid_unique` (`uuid`),
  KEY `campaigns_created_by_foreign` (`created_by`),
  KEY `campaigns_email_account_id_foreign` (`email_account_id`),
  KEY `campaigns_workspace_id_status_index` (`workspace_id`,`status`),
  KEY `campaigns_type_index` (`type`),
  KEY `campaigns_channel_index` (`channel`),
  CONSTRAINT `campaigns_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `campaigns_email_account_id_foreign` FOREIGN KEY (`email_account_id`) REFERENCES `email_accounts` (`id`) ON DELETE SET NULL,
  CONSTRAINT `campaigns_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `canned_responses` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `title` varchar(255) NOT NULL,
  `shortcut` varchar(255) DEFAULT NULL,
  `content` text NOT NULL,
  `scope` enum('personal','team') NOT NULL DEFAULT 'personal',
  `category` varchar(255) DEFAULT NULL,
  `channels` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`channels`)),
  `usage_count` int(10) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `canned_responses_ws_shortcut_unique` (`workspace_id`,`shortcut`),
  KEY `canned_responses_user_id_foreign` (`user_id`),
  KEY `canned_responses_workspace_id_category_index` (`workspace_id`,`category`),
  CONSTRAINT `canned_responses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `canned_responses_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `channel_integrations` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `channel` enum('whatsapp','sms','telegram','slack','chat','salesforce','hubspot','zapier','stripe','google_calendar') NOT NULL,
  `provider` varchar(255) DEFAULT NULL,
  `credentials` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`credentials`)),
  `config` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`config`)),
  `status` enum('active','inactive','error') NOT NULL DEFAULT 'inactive',
  `error_message` varchar(255) DEFAULT NULL,
  `phone_number` varchar(255) DEFAULT NULL,
  `bot_username` varchar(255) DEFAULT NULL,
  `slack_team_id` varchar(255) DEFAULT NULL,
  `slack_bot_token` varchar(255) DEFAULT NULL,
  `slack_channel_id` varchar(255) DEFAULT NULL,
  `zapier_webhook_token` varchar(64) DEFAULT NULL,
  `zapier_api_token` text DEFAULT NULL,
  `salesforce_instance_url` varchar(255) DEFAULT NULL,
  `token_expires_at` timestamp NULL DEFAULT NULL,
  `refresh_token` text DEFAULT NULL,
  `account_name` varchar(255) DEFAULT NULL,
  `ai_auto_reply` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `channel_integrations_workspace_id_channel_unique` (`workspace_id`,`channel`),
  KEY `channel_integrations_channel_status_idx` (`channel`,`status`),
  CONSTRAINT `channel_integrations_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `chat_widgets` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `public_id` varchar(32) NOT NULL,
  `primary_color` varchar(7) NOT NULL DEFAULT '#4F46E5',
  `position` varchar(20) NOT NULL DEFAULT 'bottom-right',
  `button_icon` varchar(20) NOT NULL DEFAULT 'chat',
  `border_radius` smallint(5) unsigned NOT NULL DEFAULT 12,
  `widget_width` smallint(5) unsigned NOT NULL DEFAULT 380,
  `company_name` varchar(255) DEFAULT NULL,
  `agent_avatar_path` varchar(255) DEFAULT NULL,
  `company_logo_path` varchar(255) DEFAULT NULL,
  `show_branding` tinyint(1) NOT NULL DEFAULT 1,
  `welcome_message` varchar(255) NOT NULL DEFAULT 'Hi there! How can we help you today?',
  `pre_chat_form` varchar(30) NOT NULL DEFAULT 'name_email',
  `pre_chat_required` tinyint(1) NOT NULL DEFAULT 1,
  `offline_mode` varchar(30) NOT NULL DEFAULT 'leave_message',
  `offline_message` varchar(255) DEFAULT NULL,
  `ai_auto_reply` tinyint(1) NOT NULL DEFAULT 1,
  `file_sharing` tinyint(1) NOT NULL DEFAULT 1,
  `typing_indicator` tinyint(1) NOT NULL DEFAULT 1,
  `sound_notification` tinyint(1) NOT NULL DEFAULT 1,
  `chat_rating` tinyint(1) NOT NULL DEFAULT 1,
  `email_transcript` tinyint(1) NOT NULL DEFAULT 1,
  `auto_close_minutes` smallint(5) unsigned NOT NULL DEFAULT 30,
  `operating_hours` varchar(20) NOT NULL DEFAULT 'workspace',
  `custom_hours` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`custom_hours`)),
  `proactive_triggers` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`proactive_triggers`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `chat_widgets_workspace_id_unique` (`workspace_id`),
  UNIQUE KEY `chat_widgets_public_id_unique` (`public_id`),
  CONSTRAINT `chat_widgets_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `contact_list_members` (
  `contact_list_id` bigint(20) unsigned NOT NULL,
  `contact_id` bigint(20) unsigned NOT NULL,
  `added_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`contact_list_id`,`contact_id`),
  KEY `contact_list_members_contact_id_foreign` (`contact_id`),
  CONSTRAINT `contact_list_members_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `contact_list_members_contact_list_id_foreign` FOREIGN KEY (`contact_list_id`) REFERENCES `contact_lists` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `contact_lists` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `contacts_count` int(10) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `contact_lists_workspace_id_foreign` (`workspace_id`),
  CONSTRAINT `contact_lists_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `contact_lists` VALUES ('1', '2', '01-08-2025', '', '0', '2026-07-26 09:07:13', '2026-07-26 09:07:13');

CREATE TABLE `contact_tag` (
  `contact_id` bigint(20) unsigned NOT NULL,
  `tag_id` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`contact_id`,`tag_id`),
  KEY `contact_tag_tag_id_foreign` (`tag_id`),
  CONSTRAINT `contact_tag_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `contact_tag_tag_id_foreign` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `contacts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) NOT NULL,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `first_name` varchar(255) DEFAULT NULL,
  `last_name` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `company` varchar(255) DEFAULT NULL,
  `job_title` varchar(255) DEFAULT NULL,
  `avatar_path` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `country` varchar(255) DEFAULT NULL,
  `timezone` varchar(50) DEFAULT NULL,
  `lead_score` int(10) unsigned NOT NULL DEFAULT 0,
  `custom_fields` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`custom_fields`)),
  `status` enum('active','unsubscribed','bounced','spam') NOT NULL DEFAULT 'active',
  `unsubscribed_at` timestamp NULL DEFAULT NULL,
  `unsubscribe_reason` varchar(255) DEFAULT NULL,
  `last_contacted_at` timestamp NULL DEFAULT NULL,
  `last_seen_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 `contacts_uuid_unique` (`uuid`),
  UNIQUE KEY `contacts_ws_email_unique` (`workspace_id`,`email`),
  KEY `contacts_workspace_id_lead_score_index` (`workspace_id`,`lead_score`),
  KEY `contacts_workspace_id_status_index` (`workspace_id`,`status`),
  KEY `contacts_ws_phone_idx` (`workspace_id`,`phone`),
  KEY `contacts_status_unsubscribed_index` (`workspace_id`,`status`,`unsubscribed_at`),
  FULLTEXT KEY `contacts_first_name_last_name_email_company_fulltext` (`first_name`,`last_name`,`email`,`company`),
  CONSTRAINT `contacts_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=985 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `contacts` VALUES ('1', '', '2', 'ranjani', NULL, 'ranjanikrishna12@gmail.com', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', NULL, 'active', NULL, NULL, NULL, NULL, '2026-07-26 09:06:30', '2026-07-26 09:07:02', '2026-07-26 09:07:02');

CREATE TABLE `conversation_tag` (
  `conversation_id` bigint(20) unsigned NOT NULL,
  `tag_id` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`conversation_id`,`tag_id`),
  KEY `conversation_tag_tag_id_foreign` (`tag_id`),
  CONSTRAINT `conversation_tag_conversation_id_foreign` FOREIGN KEY (`conversation_id`) REFERENCES `conversations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `conversation_tag_tag_id_foreign` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `conversation_typing` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `conversation_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `conversation_typing_conversation_id_user_id_unique` (`conversation_id`,`user_id`),
  KEY `conversation_typing_user_id_foreign` (`user_id`),
  CONSTRAINT `conversation_typing_conversation_id_foreign` FOREIGN KEY (`conversation_id`) REFERENCES `conversations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `conversation_typing_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `conversation_viewers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned DEFAULT NULL,
  `conversation_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `last_seen_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `conversation_viewers_conversation_id_user_id_unique` (`conversation_id`,`user_id`),
  KEY `conversation_viewers_user_id_foreign` (`user_id`),
  KEY `conversation_viewers_workspace_id_index` (`workspace_id`),
  CONSTRAINT `conversation_viewers_conversation_id_foreign` FOREIGN KEY (`conversation_id`) REFERENCES `conversations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `conversation_viewers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `conversation_viewers_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `conversations` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) NOT NULL,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `contact_id` bigint(20) unsigned DEFAULT NULL,
  `email_account_id` bigint(20) unsigned DEFAULT NULL,
  `assigned_to` bigint(20) unsigned DEFAULT NULL,
  `channel` varchar(20) DEFAULT 'email',
  `status` enum('open','pending','closed','snoozed','spam') NOT NULL DEFAULT 'open',
  `priority` enum('low','normal','high','urgent') NOT NULL DEFAULT 'normal',
  `subject` varchar(255) DEFAULT NULL,
  `preview` text DEFAULT NULL,
  `sentiment` enum('positive','neutral','negative','angry') DEFAULT NULL,
  `is_starred` tinyint(1) NOT NULL DEFAULT 0,
  `is_pinned` tinyint(1) NOT NULL DEFAULT 0,
  `is_read` tinyint(1) NOT NULL DEFAULT 0,
  `is_ai_handled` tinyint(1) NOT NULL DEFAULT 0,
  `messages_count` int(10) unsigned NOT NULL DEFAULT 0,
  `ai_replies_count` int(10) unsigned NOT NULL DEFAULT 0,
  `tags` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`tags`)),
  `snoozed_until` timestamp NULL DEFAULT NULL,
  `last_message_at` timestamp NULL DEFAULT NULL,
  `first_response_at` timestamp NULL DEFAULT NULL,
  `resolved_at` timestamp NULL DEFAULT NULL,
  `channel_conversation_id` varchar(255) 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 `conversations_uuid_unique` (`uuid`),
  KEY `conversations_assigned_to_foreign` (`assigned_to`),
  KEY `conversations_workspace_id_status_index` (`workspace_id`,`status`),
  KEY `conversations_workspace_id_channel_index` (`workspace_id`,`channel`),
  KEY `conversations_workspace_id_assigned_to_index` (`workspace_id`,`assigned_to`),
  KEY `conversations_workspace_id_priority_index` (`workspace_id`,`priority`),
  KEY `conversations_workspace_id_last_message_at_index` (`workspace_id`,`last_message_at`),
  KEY `conversations_workspace_id_is_read_index` (`workspace_id`,`is_read`),
  KEY `conversations_ws_status_last_msg_idx` (`workspace_id`,`status`,`last_message_at`),
  KEY `conversations_ws_read_status_idx` (`workspace_id`,`is_read`,`status`),
  KEY `conversations_ws_starred_idx` (`workspace_id`,`is_starred`),
  KEY `conversations_ws_assigned_status_idx` (`workspace_id`,`assigned_to`,`status`),
  KEY `idx_conv_ws_status_lastmsg` (`workspace_id`,`status`,`last_message_at`),
  KEY `idx_conv_ws_starred` (`workspace_id`,`is_starred`),
  KEY `idx_conv_ws_created` (`workspace_id`,`created_at`),
  KEY `idx_conv_threading` (`workspace_id`,`contact_id`,`email_account_id`,`last_message_at`),
  KEY `idx_conv_unread_counts` (`workspace_id`,`is_read`,`status`,`channel`),
  KEY `conversations_contact_ws_channel_idx` (`contact_id`,`workspace_id`,`channel`),
  KEY `conversations_ws_channel_created_index` (`workspace_id`,`channel`,`created_at`),
  KEY `conversations_email_account_created_index` (`email_account_id`,`created_at`),
  KEY `conversations_ws_starred_lastmsg_index` (`workspace_id`,`is_starred`,`last_message_at`),
  FULLTEXT KEY `conversations_subject_fulltext` (`subject`),
  CONSTRAINT `conversations_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `conversations_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE SET NULL,
  CONSTRAINT `conversations_email_account_id_foreign` FOREIGN KEY (`email_account_id`) REFERENCES `email_accounts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `conversations_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `coupons` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(255) NOT NULL,
  `stripe_coupon_id` varchar(255) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `type` varchar(32) NOT NULL DEFAULT 'percent_off',
  `percent_off` decimal(5,2) DEFAULT NULL,
  `amount_off` decimal(10,2) DEFAULT NULL,
  `value` decimal(10,2) DEFAULT NULL,
  `currency` varchar(3) NOT NULL DEFAULT 'usd',
  `duration` varchar(16) NOT NULL DEFAULT 'once',
  `duration_in_months` int(10) unsigned DEFAULT NULL,
  `max_redemptions` int(10) unsigned DEFAULT NULL,
  `times_redeemed` int(10) unsigned NOT NULL DEFAULT 0,
  `max_uses` int(10) unsigned DEFAULT NULL,
  `times_used` int(10) unsigned NOT NULL DEFAULT 0,
  `applicable_plans` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`applicable_plans`)),
  `expires_at` timestamp NULL 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 `coupons_code_unique` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `currencies` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `code` varchar(5) NOT NULL,
  `symbol` varchar(10) NOT NULL,
  `symbol_position` varchar(10) NOT NULL DEFAULT 'before',
  `decimal_separator` varchar(1) NOT NULL DEFAULT '.',
  `thousand_separator` varchar(1) NOT NULL DEFAULT ',',
  `decimal_digits` int(11) NOT NULL DEFAULT 2,
  `exchange_rate` decimal(12,6) NOT NULL DEFAULT 1.000000,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `currencies_code_unique` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `currencies` VALUES ('1', 'US Dollar', 'USD', '$', 'before', '.', ',', '2', '1.000000', '1', '1', '1', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('2', 'Euro', 'EUR', '€', 'before', '.', ',', '2', '0.920000', '1', '0', '2', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('3', 'British Pound', 'GBP', '£', 'before', '.', ',', '2', '0.790000', '1', '0', '3', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('4', 'Indian Rupee', 'INR', '₹', 'before', '.', ',', '2', '83.500000', '1', '0', '4', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('5', 'Brazilian Real', 'BRL', 'R$', 'before', '.', ',', '2', '4.970000', '1', '0', '5', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('6', 'UAE Dirham', 'AED', 'د.إ', 'before', '.', ',', '2', '3.670000', '1', '0', '6', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('7', 'Saudi Riyal', 'SAR', '﷼', 'before', '.', ',', '2', '3.750000', '1', '0', '7', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('8', 'Japanese Yen', 'JPY', '¥', 'before', '.', ',', '0', '150.000000', '0', '0', '8', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('9', 'Chinese Yuan', 'CNY', '¥', 'before', '.', ',', '2', '7.240000', '0', '0', '9', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('10', 'Canadian Dollar', 'CAD', 'C$', 'before', '.', ',', '2', '1.360000', '1', '0', '10', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('11', 'Australian Dollar', 'AUD', 'A$', 'before', '.', ',', '2', '1.530000', '1', '0', '11', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('12', 'Mexican Peso', 'MXN', '$', 'before', '.', ',', '2', '17.150000', '1', '0', '12', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('13', 'Turkish Lira', 'TRY', '₺', 'before', '.', ',', '2', '32.000000', '1', '0', '13', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('14', 'Nigerian Naira', 'NGN', '₦', 'before', '.', ',', '2', '1570.000000', '1', '0', '14', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('15', 'Bangladeshi Taka', 'BDT', '৳', 'before', '.', ',', '2', '110.000000', '1', '0', '15', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('16', 'Indonesian Rupiah', 'IDR', 'Rp', 'before', '.', ',', '0', '15700.000000', '1', '0', '16', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('17', 'Pakistani Rupee', 'PKR', 'Rs', 'before', '.', ',', '2', '278.000000', '1', '0', '17', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('18', 'South African Rand', 'ZAR', 'R', 'before', '.', ',', '2', '18.500000', '1', '0', '18', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('19', 'Polish Zloty', 'PLN', 'zł', 'after', '.', ' ', '2', '3.950000', '0', '0', '19', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('20', 'Kenyan Shilling', 'KES', 'KSh', 'before', '.', ',', '2', '154.000000', '0', '0', '20', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `currencies` VALUES ('21', 'Ghanaian Cedi', 'GHS', 'GH₵', 'before', '.', ',', '2', '15.400000', '0', '0', '21', '2026-07-26 09:00:11', '2026-07-26 09:00:11');

CREATE TABLE `custom_fields` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `key` varchar(255) NOT NULL,
  `type` enum('text','number','date','dropdown','checkbox','url','email','phone') NOT NULL DEFAULT 'text',
  `options` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`options`)),
  `required` tinyint(1) NOT NULL DEFAULT 0,
  `sort_order` int(10) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `custom_fields_workspace_id_key_unique` (`workspace_id`,`key`),
  CONSTRAINT `custom_fields_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `deal_stages` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `pipeline_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `color` varchar(7) NOT NULL DEFAULT '#6B7280',
  `win_probability` int(10) unsigned NOT NULL DEFAULT 0,
  `sort_order` int(10) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `deal_stages_pipeline_sort_order_index` (`pipeline_id`,`sort_order`),
  KEY `deal_stages_pipeline_sort_index` (`pipeline_id`,`sort_order`),
  CONSTRAINT `deal_stages_pipeline_id_foreign` FOREIGN KEY (`pipeline_id`) REFERENCES `pipelines` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `deals` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) NOT NULL,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `contact_id` bigint(20) unsigned DEFAULT NULL,
  `pipeline_id` bigint(20) unsigned NOT NULL,
  `deal_stage_id` bigint(20) unsigned NOT NULL,
  `assigned_to` bigint(20) unsigned DEFAULT NULL,
  `title` varchar(255) NOT NULL,
  `value` decimal(12,2) NOT NULL DEFAULT 0.00,
  `currency` varchar(3) NOT NULL DEFAULT 'usd',
  `expected_close_date` date DEFAULT NULL,
  `status` enum('open','won','lost') NOT NULL DEFAULT 'open',
  `won_at` timestamp NULL DEFAULT NULL,
  `lost_at` timestamp NULL DEFAULT NULL,
  `lost_reason` varchar(255) DEFAULT NULL,
  `custom_fields` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`custom_fields`)),
  `notes` text 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 `deals_uuid_unique` (`uuid`),
  KEY `deals_contact_id_foreign` (`contact_id`),
  KEY `deals_pipeline_id_foreign` (`pipeline_id`),
  KEY `deals_deal_stage_id_foreign` (`deal_stage_id`),
  KEY `deals_assigned_to_foreign` (`assigned_to`),
  KEY `deals_workspace_id_status_index` (`workspace_id`,`status`),
  KEY `deals_workspace_id_deal_stage_id_index` (`workspace_id`,`deal_stage_id`),
  CONSTRAINT `deals_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `deals_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE SET NULL,
  CONSTRAINT `deals_deal_stage_id_foreign` FOREIGN KEY (`deal_stage_id`) REFERENCES `deal_stages` (`id`) ON DELETE CASCADE,
  CONSTRAINT `deals_pipeline_id_foreign` FOREIGN KEY (`pipeline_id`) REFERENCES `pipelines` (`id`) ON DELETE CASCADE,
  CONSTRAINT `deals_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `drip_enrollments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `sequence_id` bigint(20) unsigned NOT NULL,
  `contact_id` bigint(20) unsigned NOT NULL,
  `current_step` int(10) unsigned NOT NULL DEFAULT 0,
  `retry_count` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `status` enum('active','completed','exited','paused') NOT NULL DEFAULT 'active',
  `exit_reason` varchar(255) DEFAULT NULL,
  `next_step_at` timestamp NULL DEFAULT NULL,
  `enrolled_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `exited_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `drip_enrollments_sequence_contact_status_unique` (`sequence_id`,`contact_id`,`status`),
  KEY `drip_enrollments_sequence_id_status_index` (`sequence_id`,`status`),
  KEY `drip_enrollments_next_step_at_index` (`next_step_at`),
  KEY `idx_drip_enroll_status_nextstep` (`status`,`next_step_at`),
  KEY `drip_enrollments_contact_sequence_idx` (`contact_id`,`sequence_id`),
  CONSTRAINT `drip_enrollments_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `drip_enrollments_sequence_id_foreign` FOREIGN KEY (`sequence_id`) REFERENCES `drip_sequences` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `drip_sequences` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `campaign_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `status` enum('active','paused','completed') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `drip_sequences_campaign_id_foreign` (`campaign_id`),
  CONSTRAINT `drip_sequences_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `campaigns` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `drip_steps` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `sequence_id` bigint(20) unsigned NOT NULL,
  `position` int(10) unsigned NOT NULL,
  `delay_value` int(10) unsigned NOT NULL DEFAULT 1,
  `delay_unit` enum('minutes','hours','days') NOT NULL DEFAULT 'days',
  `action_type` enum('send_email','wait_condition','add_tag','remove_tag','update_field') NOT NULL DEFAULT 'send_email',
  `action_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`action_data`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `drip_steps_sequence_id_foreign` (`sequence_id`),
  CONSTRAINT `drip_steps_sequence_id_foreign` FOREIGN KEY (`sequence_id`) REFERENCES `drip_sequences` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `email_signatures` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `email_account_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `content_html` text NOT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `append_to_new` tinyint(1) NOT NULL DEFAULT 1,
  `append_to_replies` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `email_signatures_email_account_id_foreign` (`email_account_id`),
  CONSTRAINT `email_signatures_email_account_id_foreign` FOREIGN KEY (`email_account_id`) REFERENCES `email_accounts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `email_suppressions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `email` varchar(255) NOT NULL,
  `reason` enum('hard_bounce','spam_complaint','unsubscribe','manual') NOT NULL DEFAULT 'manual',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email_suppressions_workspace_id_email_unique` (`workspace_id`,`email`),
  KEY `email_suppressions_email_index` (`email`),
  CONSTRAINT `email_suppressions_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `email_templates` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `blocks` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`blocks`)),
  `thumbnail_path` varchar(255) DEFAULT NULL,
  `category` varchar(50) NOT NULL DEFAULT 'general',
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `usage_count` int(10) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `email_templates_workspace_id_category_index` (`workspace_id`,`category`),
  KEY `email_templates_is_default_index` (`is_default`),
  CONSTRAINT `email_templates_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `email_templates` VALUES ('1', NULL, 'Welcome Email', '[{\"type\":\"header\",\"data\":{\"logo_url\":\"\",\"company_name\":\"{company}\",\"bg_color\":\"#6366F1\"}},{\"type\":\"spacer\",\"data\":{\"height\":\"12\"}},{\"type\":\"text\",\"data\":{\"content\":\"<h2 style=\\\"margin:0 0 16px 0;color:#1E293B;\\\">Welcome aboard, {first_name}!<\\/h2><p style=\\\"margin:0 0 12px 0;color:#475569;\\\">We are thrilled to have you join us. Your account is ready and waiting for you to explore everything we have to offer.<\\/p><p style=\\\"margin:0;color:#475569;\\\">Here is what you can do to get started:<\\/p>\",\"align\":\"left\",\"font_size\":\"16\"}},{\"type\":\"columns\",\"data\":{\"left_content\":\"<p style=\\\"margin:0 0 6px 0;font-weight:700;color:#6366F1;\\\">1. Complete your profile<\\/p><p style=\\\"margin:0;font-size:14px;color:#64748B;\\\">Add your details so your team can find and connect with you easily.<\\/p>\",\"right_content\":\"<p style=\\\"margin:0 0 6px 0;font-weight:700;color:#6366F1;\\\">2. Explore the dashboard<\\/p><p style=\\\"margin:0;font-size:14px;color:#64748B;\\\">Your dashboard gives you a clear view of all your activity at a glance.<\\/p>\"}},{\"type\":\"button\",\"data\":{\"text\":\"Go to Your Dashboard\",\"url\":\"https:\\/\\/example.com\\/dashboard\",\"bg_color\":\"#6366F1\",\"text_color\":\"#FFFFFF\",\"align\":\"center\"}},{\"type\":\"divider\",\"data\":{\"color\":\"#E5E7EB\",\"width\":\"80\",\"style\":\"solid\"}},{\"type\":\"text\",\"data\":{\"content\":\"<p style=\\\"margin:0;font-size:14px;color:#94A3B8;\\\">Need a hand getting started? Reply to this email or reach out to our support team at any time. We are here to help.<\\/p>\",\"align\":\"center\",\"font_size\":\"14\"}},{\"type\":\"footer\",\"data\":{\"text\":\"{company} | 123 Business Street, Suite 100\",\"unsubscribe_text\":\"Unsubscribe from these emails\"}}]', NULL, 'onboarding', '1', '0', '2026-07-26 09:00:11', '2026-07-26 09:00:11', NULL);
INSERT INTO `email_templates` VALUES ('2', NULL, 'Newsletter', '[{\"type\":\"header\",\"data\":{\"logo_url\":\"\",\"company_name\":\"{company} Newsletter\",\"bg_color\":\"#1E293B\"}},{\"type\":\"image\",\"data\":{\"src\":\"https:\\/\\/placehold.co\\/600x250\\/6366F1\\/FFFFFF?text=Featured+Story\",\"alt\":\"Featured story banner\",\"width\":\"100\",\"link_url\":\"\"}},{\"type\":\"text\",\"data\":{\"content\":\"<h2 style=\\\"margin:0 0 12px 0;color:#1E293B;\\\">This Month at {company}<\\/h2><p style=\\\"margin:0 0 8px 0;color:#475569;\\\">Hi {first_name}, here is a roundup of the latest news, tips, and updates from our team. We have been busy building new features and writing guides to help you succeed.<\\/p>\",\"align\":\"left\",\"font_size\":\"16\"}},{\"type\":\"divider\",\"data\":{\"color\":\"#E5E7EB\",\"width\":\"100\",\"style\":\"solid\"}},{\"type\":\"columns\",\"data\":{\"left_content\":\"<h3 style=\\\"margin:0 0 8px 0;color:#6366F1;\\\">Product Update<\\/h3><p style=\\\"margin:0;font-size:14px;color:#64748B;\\\">We launched a brand new dashboard with real-time analytics, custom widgets, and faster reporting tools.<\\/p>\",\"right_content\":\"<h3 style=\\\"margin:0 0 8px 0;color:#6366F1;\\\">Quick Tip<\\/h3><p style=\\\"margin:0;font-size:14px;color:#64748B;\\\">Did you know you can automate your weekly reports? Check out our new scheduling guide to save hours every week.<\\/p>\"}},{\"type\":\"divider\",\"data\":{\"color\":\"#E5E7EB\",\"width\":\"100\",\"style\":\"solid\"}},{\"type\":\"columns\",\"data\":{\"left_content\":\"<h3 style=\\\"margin:0 0 8px 0;color:#6366F1;\\\">From the Blog<\\/h3><p style=\\\"margin:0;font-size:14px;color:#64748B;\\\">Our latest post covers five strategies for improving your open rates by up to 40%. A must-read for marketers.<\\/p>\",\"right_content\":\"<h3 style=\\\"margin:0 0 8px 0;color:#6366F1;\\\">Community Spotlight<\\/h3><p style=\\\"margin:0;font-size:14px;color:#64748B;\\\">See how Acme Corp increased engagement by 3x using our segmentation tools. Read the full case study.<\\/p>\"}},{\"type\":\"button\",\"data\":{\"text\":\"Read More on Our Blog\",\"url\":\"https:\\/\\/example.com\\/blog\",\"bg_color\":\"#6366F1\",\"text_color\":\"#FFFFFF\",\"align\":\"center\"}},{\"type\":\"social\",\"data\":{\"links\":[{\"platform\":\"twitter\",\"url\":\"https:\\/\\/twitter.com\\/example\"},{\"platform\":\"linkedin\",\"url\":\"https:\\/\\/linkedin.com\\/company\\/example\"},{\"platform\":\"facebook\",\"url\":\"https:\\/\\/facebook.com\\/example\"}]}},{\"type\":\"footer\",\"data\":{\"text\":\"{company} | 123 Business Street, Suite 100\",\"unsubscribe_text\":\"Unsubscribe | Manage Preferences\"}}]', NULL, 'newsletter', '1', '0', '2026-07-26 09:00:11', '2026-07-26 09:00:11', NULL);
INSERT INTO `email_templates` VALUES ('3', NULL, 'Product Announcement', '[{\"type\":\"header\",\"data\":{\"logo_url\":\"\",\"company_name\":\"{company}\",\"bg_color\":\"#6366F1\"}},{\"type\":\"image\",\"data\":{\"src\":\"https:\\/\\/placehold.co\\/600x300\\/6366F1\\/FFFFFF?text=Introducing+Our+Latest+Product\",\"alt\":\"Product announcement hero image\",\"width\":\"100\",\"link_url\":\"\"}},{\"type\":\"text\",\"data\":{\"content\":\"<h2 style=\\\"margin:0 0 16px 0;color:#1E293B;\\\">Introducing something we have been working on<\\/h2><p style=\\\"margin:0 0 12px 0;color:#475569;\\\">Hi {first_name},<\\/p><p style=\\\"margin:0 0 12px 0;color:#475569;\\\">We are excited to share our newest product with you. After months of development and testing with early users, it is finally ready for everyone.<\\/p><p style=\\\"margin:0;color:#475569;\\\">Here is what makes it special:<\\/p>\",\"align\":\"left\",\"font_size\":\"16\"}},{\"type\":\"columns\",\"data\":{\"left_content\":\"<p style=\\\"margin:0 0 6px 0;font-weight:700;color:#6366F1;\\\">Lightning fast<\\/p><p style=\\\"margin:0;font-size:14px;color:#64748B;\\\">Built from the ground up for performance. Load times are up to 10x faster than before.<\\/p>\",\"right_content\":\"<p style=\\\"margin:0 0 6px 0;font-weight:700;color:#6366F1;\\\">Beautifully simple<\\/p><p style=\\\"margin:0;font-size:14px;color:#64748B;\\\">A redesigned interface that puts the most important actions right at your fingertips.<\\/p>\"}},{\"type\":\"columns\",\"data\":{\"left_content\":\"<p style=\\\"margin:0 0 6px 0;font-weight:700;color:#6366F1;\\\">Powerful integrations<\\/p><p style=\\\"margin:0;font-size:14px;color:#64748B;\\\">Connects seamlessly with the tools you already use, from Slack to Salesforce.<\\/p>\",\"right_content\":\"<p style=\\\"margin:0 0 6px 0;font-weight:700;color:#6366F1;\\\">Enterprise ready<\\/p><p style=\\\"margin:0;font-size:14px;color:#64748B;\\\">SOC 2 compliant with SSO, role-based access, and audit logging built in.<\\/p>\"}},{\"type\":\"button\",\"data\":{\"text\":\"See It in Action\",\"url\":\"https:\\/\\/example.com\\/product\\/new\",\"bg_color\":\"#6366F1\",\"text_color\":\"#FFFFFF\",\"align\":\"center\"}},{\"type\":\"footer\",\"data\":{\"text\":\"{company} | 123 Business Street, Suite 100\",\"unsubscribe_text\":\"Unsubscribe from product updates\"}}]', NULL, 'marketing', '1', '0', '2026-07-26 09:00:11', '2026-07-26 09:00:11', NULL);
INSERT INTO `email_templates` VALUES ('4', NULL, 'Flash Sale', '[{\"type\":\"header\",\"data\":{\"logo_url\":\"\",\"company_name\":\"{company}\",\"bg_color\":\"#DC2626\"}},{\"type\":\"image\",\"data\":{\"src\":\"https:\\/\\/placehold.co\\/600x280\\/DC2626\\/FFFFFF?text=FLASH+SALE\",\"alt\":\"Flash sale banner\",\"width\":\"100\",\"link_url\":\"https:\\/\\/example.com\\/sale\"}},{\"type\":\"text\",\"data\":{\"content\":\"<h2 style=\\\"margin:0 0 8px 0;color:#DC2626;text-align:center;\\\">Limited Time: Save Big Today<\\/h2><p style=\\\"margin:0 0 12px 0;color:#475569;text-align:center;\\\">Hey {first_name}, we have an exclusive deal just for you. For the next 48 hours, enjoy significant savings across all plans. This is our biggest discount of the year.<\\/p>\",\"align\":\"center\",\"font_size\":\"16\"}},{\"type\":\"columns\",\"data\":{\"left_content\":\"<div style=\\\"text-align:center;padding:16px;background:#FEF2F2;border-radius:8px;\\\"><p style=\\\"margin:0 0 4px 0;font-size:13px;color:#991B1B;text-transform:uppercase;font-weight:600;\\\">Starter Plan<\\/p><p style=\\\"margin:0;font-size:28px;font-weight:700;color:#DC2626;\\\"><s style=\\\"font-size:18px;color:#94A3B8;\\\">$29<\\/s> $14\\/mo<\\/p><\\/div>\",\"right_content\":\"<div style=\\\"text-align:center;padding:16px;background:#FEF2F2;border-radius:8px;\\\"><p style=\\\"margin:0 0 4px 0;font-size:13px;color:#991B1B;text-transform:uppercase;font-weight:600;\\\">Pro Plan<\\/p><p style=\\\"margin:0;font-size:28px;font-weight:700;color:#DC2626;\\\"><s style=\\\"font-size:18px;color:#94A3B8;\\\">$79<\\/s> $39\\/mo<\\/p><\\/div>\"}},{\"type\":\"button\",\"data\":{\"text\":\"Claim Your Discount Now\",\"url\":\"https:\\/\\/example.com\\/pricing?promo=FLASH\",\"bg_color\":\"#DC2626\",\"text_color\":\"#FFFFFF\",\"align\":\"center\"}},{\"type\":\"text\",\"data\":{\"content\":\"<p style=\\\"margin:0;font-size:13px;color:#94A3B8;text-align:center;\\\">Offer ends in 48 hours. Cannot be combined with other promotions. Terms apply.<\\/p>\",\"align\":\"center\",\"font_size\":\"13\"}},{\"type\":\"footer\",\"data\":{\"text\":\"{company} | 123 Business Street, Suite 100\",\"unsubscribe_text\":\"Unsubscribe from promotional emails\"}}]', NULL, 'marketing', '1', '0', '2026-07-26 09:00:11', '2026-07-26 09:00:11', NULL);
INSERT INTO `email_templates` VALUES ('5', NULL, 'Abandoned Cart', '[{\"type\":\"header\",\"data\":{\"logo_url\":\"\",\"company_name\":\"{company}\",\"bg_color\":\"#6366F1\"}},{\"type\":\"spacer\",\"data\":{\"height\":\"12\"}},{\"type\":\"text\",\"data\":{\"content\":\"<h2 style=\\\"margin:0 0 16px 0;color:#1E293B;text-align:center;\\\">You left something behind<\\/h2><p style=\\\"margin:0 0 12px 0;color:#475569;\\\">Hi {first_name},<\\/p><p style=\\\"margin:0 0 12px 0;color:#475569;\\\">It looks like you started exploring our plans but did not finish. No worries, your selection is still saved and ready for you.<\\/p><p style=\\\"margin:0;color:#475569;\\\">If you had any questions or ran into an issue, we are happy to help. Just reply to this email.<\\/p>\",\"align\":\"left\",\"font_size\":\"16\"}},{\"type\":\"divider\",\"data\":{\"color\":\"#E5E7EB\",\"width\":\"80\",\"style\":\"solid\"}},{\"type\":\"text\",\"data\":{\"content\":\"<table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\" style=\\\"background:#F8FAFC;border-radius:8px;padding:0;\\\"><tr><td style=\\\"padding:20px;\\\"><p style=\\\"margin:0 0 4px 0;font-weight:700;color:#1E293B;\\\">Your saved selection<\\/p><p style=\\\"margin:0 0 4px 0;font-size:14px;color:#64748B;\\\">Pro Plan &mdash; Monthly<\\/p><p style=\\\"margin:0;font-size:20px;font-weight:700;color:#6366F1;\\\">$79\\/month<\\/p><\\/td><\\/tr><\\/table>\",\"align\":\"left\",\"font_size\":\"16\"}},{\"type\":\"button\",\"data\":{\"text\":\"Complete Your Purchase\",\"url\":\"https:\\/\\/example.com\\/checkout\\/resume\",\"bg_color\":\"#6366F1\",\"text_color\":\"#FFFFFF\",\"align\":\"center\"}},{\"type\":\"text\",\"data\":{\"content\":\"<p style=\\\"margin:0;font-size:14px;color:#94A3B8;text-align:center;\\\">Your cart will be held for 7 days. After that, you can always start fresh.<\\/p>\",\"align\":\"center\",\"font_size\":\"14\"}},{\"type\":\"footer\",\"data\":{\"text\":\"{company} | 123 Business Street, Suite 100\",\"unsubscribe_text\":\"Unsubscribe from these emails\"}}]', NULL, 'marketing', '1', '0', '2026-07-26 09:00:11', '2026-07-26 09:00:11', NULL);
INSERT INTO `email_templates` VALUES ('6', NULL, 'Thank You', '[{\"type\":\"header\",\"data\":{\"logo_url\":\"\",\"company_name\":\"{company}\",\"bg_color\":\"#059669\"}},{\"type\":\"text\",\"data\":{\"content\":\"<h2 style=\\\"margin:0 0 16px 0;color:#059669;text-align:center;\\\">Thank you for your purchase!<\\/h2><p style=\\\"margin:0 0 12px 0;color:#475569;\\\">Hi {first_name},<\\/p><p style=\\\"margin:0 0 12px 0;color:#475569;\\\">Your order has been confirmed and is being processed. We truly appreciate your business and are committed to delivering the best possible experience.<\\/p>\",\"align\":\"left\",\"font_size\":\"16\"}},{\"type\":\"divider\",\"data\":{\"color\":\"#E5E7EB\",\"width\":\"100\",\"style\":\"solid\"}},{\"type\":\"text\",\"data\":{\"content\":\"<table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\" style=\\\"background:#F0FDF4;border-radius:8px;\\\"><tr><td style=\\\"padding:20px;\\\"><p style=\\\"margin:0 0 12px 0;font-weight:700;color:#1E293B;\\\">Order Summary<\\/p><table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\"><tr><td style=\\\"padding:4px 0;font-size:14px;color:#475569;\\\">Plan: Pro (Annual)<\\/td><td style=\\\"padding:4px 0;font-size:14px;color:#475569;text-align:right;\\\">$790.00<\\/td><\\/tr><tr><td style=\\\"padding:4px 0;font-size:14px;color:#475569;\\\">Discount<\\/td><td style=\\\"padding:4px 0;font-size:14px;color:#059669;text-align:right;\\\">-$79.00<\\/td><\\/tr><tr><td style=\\\"padding:8px 0 0 0;font-size:16px;font-weight:700;color:#1E293B;border-top:1px solid #D1FAE5;\\\">Total<\\/td><td style=\\\"padding:8px 0 0 0;font-size:16px;font-weight:700;color:#1E293B;text-align:right;border-top:1px solid #D1FAE5;\\\">$711.00<\\/td><\\/tr><\\/table><\\/td><\\/tr><\\/table>\",\"align\":\"left\",\"font_size\":\"16\"}},{\"type\":\"button\",\"data\":{\"text\":\"View Your Account\",\"url\":\"https:\\/\\/example.com\\/account\",\"bg_color\":\"#059669\",\"text_color\":\"#FFFFFF\",\"align\":\"center\"}},{\"type\":\"text\",\"data\":{\"content\":\"<p style=\\\"margin:0;font-size:14px;color:#94A3B8;text-align:center;\\\">Questions about your order? Contact us at support@example.com and we will be happy to help.<\\/p>\",\"align\":\"center\",\"font_size\":\"14\"}},{\"type\":\"footer\",\"data\":{\"text\":\"{company} | 123 Business Street, Suite 100\",\"unsubscribe_text\":\"Unsubscribe from these emails\"}}]', NULL, 'transactional', '1', '0', '2026-07-26 09:00:11', '2026-07-26 09:00:11', NULL);
INSERT INTO `email_templates` VALUES ('7', NULL, 'Feedback Request', '[{\"type\":\"header\",\"data\":{\"logo_url\":\"\",\"company_name\":\"{company}\",\"bg_color\":\"#6366F1\"}},{\"type\":\"spacer\",\"data\":{\"height\":\"12\"}},{\"type\":\"text\",\"data\":{\"content\":\"<h2 style=\\\"margin:0 0 16px 0;color:#1E293B;text-align:center;\\\">How was your experience?<\\/h2><p style=\\\"margin:0 0 12px 0;color:#475569;\\\">Hi {first_name},<\\/p><p style=\\\"margin:0 0 12px 0;color:#475569;\\\">You have been using {company} for a while now, and your opinion matters a lot to us. We would love to hear how things are going and where we can improve.<\\/p><p style=\\\"margin:0;color:#475569;\\\">It takes less than 2 minutes and helps us build a better product for you.<\\/p>\",\"align\":\"left\",\"font_size\":\"16\"}},{\"type\":\"divider\",\"data\":{\"color\":\"#E5E7EB\",\"width\":\"80\",\"style\":\"solid\"}},{\"type\":\"text\",\"data\":{\"content\":\"<p style=\\\"margin:0 0 12px 0;color:#475569;text-align:center;font-weight:600;\\\">On a scale of 0-10, how likely are you to recommend {company} to a colleague?<\\/p><table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\" align=\\\"center\\\" style=\\\"margin:0 auto;\\\"><tr><td style=\\\"padding:4px;\\\"><a href=\\\"https:\\/\\/example.com\\/nps?score=0\\\" style=\\\"display:inline-block;width:32px;height:32px;line-height:32px;text-align:center;background:#FEF2F2;color:#DC2626;border-radius:6px;text-decoration:none;font-weight:600;font-size:13px;\\\">0<\\/a><\\/td><td style=\\\"padding:4px;\\\"><a href=\\\"https:\\/\\/example.com\\/nps?score=1\\\" style=\\\"display:inline-block;width:32px;height:32px;line-height:32px;text-align:center;background:#FEF2F2;color:#DC2626;border-radius:6px;text-decoration:none;font-weight:600;font-size:13px;\\\">1<\\/a><\\/td><td style=\\\"padding:4px;\\\"><a href=\\\"https:\\/\\/example.com\\/nps?score=2\\\" style=\\\"display:inline-block;width:32px;height:32px;line-height:32px;text-align:center;background:#FEF2F2;color:#DC2626;border-radius:6px;text-decoration:none;font-weight:600;font-size:13px;\\\">2<\\/a><\\/td><td style=\\\"padding:4px;\\\"><a href=\\\"https:\\/\\/example.com\\/nps?score=3\\\" style=\\\"display:inline-block;width:32px;height:32px;line-height:32px;text-align:center;background:#FEF2F2;color:#DC2626;border-radius:6px;text-decoration:none;font-weight:600;font-size:13px;\\\">3<\\/a><\\/td><td style=\\\"padding:4px;\\\"><a href=\\\"https:\\/\\/example.com\\/nps?score=4\\\" style=\\\"display:inline-block;width:32px;height:32px;line-height:32px;text-align:center;background:#FEF2F2;color:#DC2626;border-radius:6px;text-decoration:none;font-weight:600;font-size:13px;\\\">4<\\/a><\\/td><td style=\\\"padding:4px;\\\"><a href=\\\"https:\\/\\/example.com\\/nps?score=5\\\" style=\\\"display:inline-block;width:32px;height:32px;line-height:32px;text-align:center;background:#FFF7ED;color:#EA580C;border-radius:6px;text-decoration:none;font-weight:600;font-size:13px;\\\">5<\\/a><\\/td><td style=\\\"padding:4px;\\\"><a href=\\\"https:\\/\\/example.com\\/nps?score=6\\\" style=\\\"display:inline-block;width:32px;height:32px;line-height:32px;text-align:center;background:#FFF7ED;color:#EA580C;border-radius:6px;text-decoration:none;font-weight:600;font-size:13px;\\\">6<\\/a><\\/td><td style=\\\"padding:4px;\\\"><a href=\\\"https:\\/\\/example.com\\/nps?score=7\\\" style=\\\"display:inline-block;width:32px;height:32px;line-height:32px;text-align:center;background:#ECFDF5;color:#059669;border-radius:6px;text-decoration:none;font-weight:600;font-size:13px;\\\">7<\\/a><\\/td><td style=\\\"padding:4px;\\\"><a href=\\\"https:\\/\\/example.com\\/nps?score=8\\\" style=\\\"display:inline-block;width:32px;height:32px;line-height:32px;text-align:center;background:#ECFDF5;color:#059669;border-radius:6px;text-decoration:none;font-weight:600;font-size:13px;\\\">8<\\/a><\\/td><td style=\\\"padding:4px;\\\"><a href=\\\"https:\\/\\/example.com\\/nps?score=9\\\" style=\\\"display:inline-block;width:32px;height:32px;line-height:32px;text-align:center;background:#ECFDF5;color:#059669;border-radius:6px;text-decoration:none;font-weight:600;font-size:13px;\\\">9<\\/a><\\/td><td style=\\\"padding:4px;\\\"><a href=\\\"https:\\/\\/example.com\\/nps?score=10\\\" style=\\\"display:inline-block;width:32px;height:32px;line-height:32px;text-align:center;background:#ECFDF5;color:#059669;border-radius:6px;text-decoration:none;font-weight:600;font-size:13px;\\\">10<\\/a><\\/td><\\/tr><\\/table><table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\" style=\\\"margin-top:4px;\\\"><tr><td style=\\\"font-size:11px;color:#94A3B8;text-align:left;\\\">Not likely<\\/td><td style=\\\"font-size:11px;color:#94A3B8;text-align:right;\\\">Very likely<\\/td><\\/tr><\\/table>\",\"align\":\"center\",\"font_size\":\"14\"}},{\"type\":\"button\",\"data\":{\"text\":\"Share Detailed Feedback\",\"url\":\"https:\\/\\/example.com\\/feedback\",\"bg_color\":\"#6366F1\",\"text_color\":\"#FFFFFF\",\"align\":\"center\"}},{\"type\":\"footer\",\"data\":{\"text\":\"{company} | 123 Business Street, Suite 100\",\"unsubscribe_text\":\"Unsubscribe from these emails\"}}]', NULL, 'engagement', '1', '0', '2026-07-26 09:00:12', '2026-07-26 09:00:12', NULL);
INSERT INTO `email_templates` VALUES ('8', NULL, 'Re-engagement', '[{\"type\":\"header\",\"data\":{\"logo_url\":\"\",\"company_name\":\"{company}\",\"bg_color\":\"#6366F1\"}},{\"type\":\"spacer\",\"data\":{\"height\":\"12\"}},{\"type\":\"text\",\"data\":{\"content\":\"<h2 style=\\\"margin:0 0 16px 0;color:#1E293B;text-align:center;\\\">We miss you, {first_name}<\\/h2><p style=\\\"margin:0 0 12px 0;color:#475569;\\\">It has been a while since we last saw you, and a lot has changed. We have shipped some exciting updates that we think you will love.<\\/p>\",\"align\":\"left\",\"font_size\":\"16\"}},{\"type\":\"text\",\"data\":{\"content\":\"<table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\"><tr><td style=\\\"padding:12px 0;border-bottom:1px solid #F1F5F9;\\\"><table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\"><tr><td style=\\\"padding-right:12px;vertical-align:top;font-size:24px;\\\">1<\\/td><td><p style=\\\"margin:0 0 2px 0;font-weight:700;color:#1E293B;\\\">Redesigned dashboard<\\/p><p style=\\\"margin:0;font-size:14px;color:#64748B;\\\">Cleaner layout, faster load times, and customizable widgets.<\\/p><\\/td><\\/tr><\\/table><\\/td><\\/tr><tr><td style=\\\"padding:12px 0;border-bottom:1px solid #F1F5F9;\\\"><table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\"><tr><td style=\\\"padding-right:12px;vertical-align:top;font-size:24px;\\\">2<\\/td><td><p style=\\\"margin:0 0 2px 0;font-weight:700;color:#1E293B;\\\">Advanced automation<\\/p><p style=\\\"margin:0;font-size:14px;color:#64748B;\\\">Set up complex workflows in minutes with our visual builder.<\\/p><\\/td><\\/tr><\\/table><\\/td><\\/tr><tr><td style=\\\"padding:12px 0;\\\"><table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\"><tr><td style=\\\"padding-right:12px;vertical-align:top;font-size:24px;\\\">3<\\/td><td><p style=\\\"margin:0 0 2px 0;font-weight:700;color:#1E293B;\\\">Better analytics<\\/p><p style=\\\"margin:0;font-size:14px;color:#64748B;\\\">New engagement insights that show what is working and what is not.<\\/p><\\/td><\\/tr><\\/table><\\/td><\\/tr><\\/table>\",\"align\":\"left\",\"font_size\":\"16\"}},{\"type\":\"button\",\"data\":{\"text\":\"Come See What Is New\",\"url\":\"https:\\/\\/example.com\\/dashboard\",\"bg_color\":\"#6366F1\",\"text_color\":\"#FFFFFF\",\"align\":\"center\"}},{\"type\":\"text\",\"data\":{\"content\":\"<p style=\\\"margin:0;font-size:14px;color:#94A3B8;text-align:center;\\\">Not interested anymore? No hard feelings. You can unsubscribe below and we will stop reaching out.<\\/p>\",\"align\":\"center\",\"font_size\":\"14\"}},{\"type\":\"footer\",\"data\":{\"text\":\"{company} | 123 Business Street, Suite 100\",\"unsubscribe_text\":\"Unsubscribe from these emails\"}}]', NULL, 'engagement', '1', '0', '2026-07-26 09:00:12', '2026-07-26 09:00:12', NULL);
INSERT INTO `email_templates` VALUES ('9', NULL, 'Event Invitation', '[{\"type\":\"header\",\"data\":{\"logo_url\":\"\",\"company_name\":\"{company}\",\"bg_color\":\"#7C3AED\"}},{\"type\":\"image\",\"data\":{\"src\":\"https:\\/\\/placehold.co\\/600x280\\/7C3AED\\/FFFFFF?text=You%27re+Invited\",\"alt\":\"Event invitation banner\",\"width\":\"100\",\"link_url\":\"\"}},{\"type\":\"text\",\"data\":{\"content\":\"<h2 style=\\\"margin:0 0 16px 0;color:#1E293B;text-align:center;\\\">You are invited, {first_name}<\\/h2><p style=\\\"margin:0 0 12px 0;color:#475569;\\\">Join us for an exclusive live session where we will showcase our latest innovations, share actionable insights, and answer your questions in real time.<\\/p>\",\"align\":\"left\",\"font_size\":\"16\"}},{\"type\":\"columns\",\"data\":{\"left_content\":\"<table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\" style=\\\"background:#F5F3FF;border-radius:8px;\\\"><tr><td style=\\\"padding:16px;text-align:center;\\\"><p style=\\\"margin:0 0 4px 0;font-weight:700;color:#7C3AED;font-size:13px;text-transform:uppercase;\\\">Date & Time<\\/p><p style=\\\"margin:0;font-size:14px;color:#475569;\\\">April 10, 2026<br>2:00 PM - 4:00 PM EST<\\/p><\\/td><\\/tr><\\/table>\",\"right_content\":\"<table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\" style=\\\"background:#F5F3FF;border-radius:8px;\\\"><tr><td style=\\\"padding:16px;text-align:center;\\\"><p style=\\\"margin:0 0 4px 0;font-weight:700;color:#7C3AED;font-size:13px;text-transform:uppercase;\\\">Location<\\/p><p style=\\\"margin:0;font-size:14px;color:#475569;\\\">Online Webinar<br>Link sent upon registration<\\/p><\\/td><\\/tr><\\/table>\"}},{\"type\":\"text\",\"data\":{\"content\":\"<p style=\\\"margin:0 0 8px 0;font-weight:700;color:#1E293B;\\\">What you will learn:<\\/p><p style=\\\"margin:0 0 4px 0;font-size:14px;color:#475569;\\\">&#8226; How top teams are using automation to scale faster<\\/p><p style=\\\"margin:0 0 4px 0;font-size:14px;color:#475569;\\\">&#8226; A live demo of our newest features<\\/p><p style=\\\"margin:0;font-size:14px;color:#475569;\\\">&#8226; Q&A with our product and engineering leads<\\/p>\",\"align\":\"left\",\"font_size\":\"16\"}},{\"type\":\"button\",\"data\":{\"text\":\"Reserve Your Spot\",\"url\":\"https:\\/\\/example.com\\/events\\/register\",\"bg_color\":\"#7C3AED\",\"text_color\":\"#FFFFFF\",\"align\":\"center\"}},{\"type\":\"text\",\"data\":{\"content\":\"<p style=\\\"margin:0;font-size:13px;color:#94A3B8;text-align:center;\\\">Spots are limited. Register now to guarantee your seat. A calendar invite and join link will be sent after registration.<\\/p>\",\"align\":\"center\",\"font_size\":\"13\"}},{\"type\":\"social\",\"data\":{\"links\":[{\"platform\":\"twitter\",\"url\":\"https:\\/\\/twitter.com\\/example\"},{\"platform\":\"linkedin\",\"url\":\"https:\\/\\/linkedin.com\\/company\\/example\"},{\"platform\":\"instagram\",\"url\":\"https:\\/\\/instagram.com\\/example\"}]}},{\"type\":\"footer\",\"data\":{\"text\":\"{company} | 123 Business Street, Suite 100\",\"unsubscribe_text\":\"Unsubscribe | View in browser\"}}]', NULL, 'events', '1', '0', '2026-07-26 09:00:12', '2026-07-26 09:00:12', NULL);
INSERT INTO `email_templates` VALUES ('10', NULL, 'Monthly Report', '[{\"type\":\"header\",\"data\":{\"logo_url\":\"\",\"company_name\":\"{company}\",\"bg_color\":\"#1E293B\"}},{\"type\":\"text\",\"data\":{\"content\":\"<h2 style=\\\"margin:0 0 8px 0;color:#1E293B;text-align:center;\\\">Your Monthly Summary<\\/h2><p style=\\\"margin:0;color:#64748B;text-align:center;font-size:14px;\\\">Here is how things went this past month, {first_name}.<\\/p>\",\"align\":\"center\",\"font_size\":\"16\"}},{\"type\":\"columns\",\"data\":{\"left_content\":\"<table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\" style=\\\"background:#EEF2FF;border-radius:8px;\\\"><tr><td style=\\\"padding:20px;text-align:center;\\\"><p style=\\\"margin:0;font-size:32px;font-weight:700;color:#6366F1;\\\">12,847<\\/p><p style=\\\"margin:4px 0 0 0;font-size:13px;color:#64748B;text-transform:uppercase;\\\">Emails Sent<\\/p><\\/td><\\/tr><\\/table>\",\"right_content\":\"<table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\" style=\\\"background:#ECFDF5;border-radius:8px;\\\"><tr><td style=\\\"padding:20px;text-align:center;\\\"><p style=\\\"margin:0;font-size:32px;font-weight:700;color:#059669;\\\">42.3%<\\/p><p style=\\\"margin:4px 0 0 0;font-size:13px;color:#64748B;text-transform:uppercase;\\\">Open Rate<\\/p><\\/td><\\/tr><\\/table>\"}},{\"type\":\"columns\",\"data\":{\"left_content\":\"<table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\" style=\\\"background:#FFF7ED;border-radius:8px;\\\"><tr><td style=\\\"padding:20px;text-align:center;\\\"><p style=\\\"margin:0;font-size:32px;font-weight:700;color:#EA580C;\\\">8.7%<\\/p><p style=\\\"margin:4px 0 0 0;font-size:13px;color:#64748B;text-transform:uppercase;\\\">Click Rate<\\/p><\\/td><\\/tr><\\/table>\",\"right_content\":\"<table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\" style=\\\"background:#FEF2F2;border-radius:8px;\\\"><tr><td style=\\\"padding:20px;text-align:center;\\\"><p style=\\\"margin:0;font-size:32px;font-weight:700;color:#DC2626;\\\">0.3%<\\/p><p style=\\\"margin:4px 0 0 0;font-size:13px;color:#64748B;text-transform:uppercase;\\\">Unsubscribe<\\/p><\\/td><\\/tr><\\/table>\"}},{\"type\":\"divider\",\"data\":{\"color\":\"#E5E7EB\",\"width\":\"100\",\"style\":\"solid\"}},{\"type\":\"text\",\"data\":{\"content\":\"<p style=\\\"margin:0 0 8px 0;font-weight:700;color:#1E293B;\\\">Top performing campaign<\\/p><table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\" style=\\\"background:#F8FAFC;border-radius:8px;\\\"><tr><td style=\\\"padding:16px;\\\"><p style=\\\"margin:0 0 4px 0;font-weight:600;color:#1E293B;\\\">Spring Product Launch<\\/p><p style=\\\"margin:0;font-size:14px;color:#64748B;\\\">52.1% open rate &middot; 14.3% click rate &middot; 2,341 recipients<\\/p><\\/td><\\/tr><\\/table>\",\"align\":\"left\",\"font_size\":\"16\"}},{\"type\":\"button\",\"data\":{\"text\":\"View Full Report\",\"url\":\"https:\\/\\/example.com\\/reports\\/monthly\",\"bg_color\":\"#6366F1\",\"text_color\":\"#FFFFFF\",\"align\":\"center\"}},{\"type\":\"footer\",\"data\":{\"text\":\"{company} | 123 Business Street, Suite 100\",\"unsubscribe_text\":\"Unsubscribe | Manage Preferences\"}}]', NULL, 'reporting', '1', '0', '2026-07-26 09:00:12', '2026-07-26 09:00:12', NULL);
INSERT INTO `email_templates` VALUES ('11', NULL, 'Feature Update', '[{\"type\":\"header\",\"data\":{\"logo_url\":\"\",\"company_name\":\"{company}\",\"bg_color\":\"#6366F1\"}},{\"type\":\"text\",\"data\":{\"content\":\"<p style=\\\"margin:0 0 4px 0;font-size:13px;color:#6366F1;font-weight:600;text-transform:uppercase;\\\">Product Update<\\/p><h2 style=\\\"margin:0 0 12px 0;color:#1E293B;\\\">What is new this month<\\/h2><p style=\\\"margin:0;color:#475569;\\\">Hi {first_name}, here is a quick look at the improvements and new features we shipped this month.<\\/p>\",\"align\":\"left\",\"font_size\":\"16\"}},{\"type\":\"divider\",\"data\":{\"color\":\"#E5E7EB\",\"width\":\"100\",\"style\":\"solid\"}},{\"type\":\"text\",\"data\":{\"content\":\"<table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\"><tr><td style=\\\"padding:16px 0;border-bottom:1px solid #F1F5F9;\\\"><p style=\\\"margin:0 0 2px 0;\\\"><span style=\\\"display:inline-block;padding:2px 8px;background:#ECFDF5;color:#059669;border-radius:4px;font-size:11px;font-weight:600;text-transform:uppercase;\\\">New<\\/span><\\/p><p style=\\\"margin:6px 0 4px 0;font-weight:700;color:#1E293B;\\\">Visual automation builder<\\/p><p style=\\\"margin:0;font-size:14px;color:#64748B;\\\">Create complex email workflows with our new drag-and-drop canvas. Set triggers, conditions, and actions without writing a single line of code.<\\/p><\\/td><\\/tr><tr><td style=\\\"padding:16px 0;border-bottom:1px solid #F1F5F9;\\\"><p style=\\\"margin:0 0 2px 0;\\\"><span style=\\\"display:inline-block;padding:2px 8px;background:#EEF2FF;color:#6366F1;border-radius:4px;font-size:11px;font-weight:600;text-transform:uppercase;\\\">Improved<\\/span><\\/p><p style=\\\"margin:6px 0 4px 0;font-weight:700;color:#1E293B;\\\">Campaign analytics<\\/p><p style=\\\"margin:0;font-size:14px;color:#64748B;\\\">Richer engagement data, heatmap click tracking, and device breakdown reports. See exactly how your audience interacts with every email.<\\/p><\\/td><\\/tr><tr><td style=\\\"padding:16px 0;\\\"><p style=\\\"margin:0 0 2px 0;\\\"><span style=\\\"display:inline-block;padding:2px 8px;background:#FFF7ED;color:#EA580C;border-radius:4px;font-size:11px;font-weight:600;text-transform:uppercase;\\\">Fixed<\\/span><\\/p><p style=\\\"margin:6px 0 4px 0;font-weight:700;color:#1E293B;\\\">Timezone handling in scheduled sends<\\/p><p style=\\\"margin:0;font-size:14px;color:#64748B;\\\">Campaigns now respect the recipient timezone setting correctly, so your emails arrive at the intended local time.<\\/p><\\/td><\\/tr><\\/table>\",\"align\":\"left\",\"font_size\":\"16\"}},{\"type\":\"button\",\"data\":{\"text\":\"Read the Full Changelog\",\"url\":\"https:\\/\\/example.com\\/changelog\",\"bg_color\":\"#6366F1\",\"text_color\":\"#FFFFFF\",\"align\":\"center\"}},{\"type\":\"text\",\"data\":{\"content\":\"<p style=\\\"margin:0;font-size:14px;color:#94A3B8;text-align:center;\\\">Have a feature request? We would love to hear it. Reply to this email or visit our feedback board.<\\/p>\",\"align\":\"center\",\"font_size\":\"14\"}},{\"type\":\"footer\",\"data\":{\"text\":\"{company} | 123 Business Street, Suite 100\",\"unsubscribe_text\":\"Unsubscribe from product updates\"}}]', NULL, 'product', '1', '0', '2026-07-26 09:00:12', '2026-07-26 09:00:12', NULL);
INSERT INTO `email_templates` VALUES ('12', NULL, 'Referral Program', '[{\"type\":\"header\",\"data\":{\"logo_url\":\"\",\"company_name\":\"{company}\",\"bg_color\":\"#6366F1\"}},{\"type\":\"text\",\"data\":{\"content\":\"<h2 style=\\\"margin:0 0 16px 0;color:#1E293B;text-align:center;\\\">Share the love, earn rewards<\\/h2><p style=\\\"margin:0 0 12px 0;color:#475569;\\\">Hi {first_name},<\\/p><p style=\\\"margin:0;color:#475569;\\\">Know someone who would benefit from {company}? Refer them and you both win. For every friend who signs up using your unique link, you will earn a credit toward your next bill.<\\/p>\",\"align\":\"left\",\"font_size\":\"16\"}},{\"type\":\"divider\",\"data\":{\"color\":\"#E5E7EB\",\"width\":\"80\",\"style\":\"solid\"}},{\"type\":\"text\",\"data\":{\"content\":\"<p style=\\\"margin:0 0 16px 0;font-weight:700;color:#1E293B;text-align:center;\\\">How it works<\\/p><table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\"><tr><td width=\\\"33%\\\" style=\\\"text-align:center;vertical-align:top;padding:0 8px;\\\"><div style=\\\"width:48px;height:48px;line-height:48px;border-radius:50%;background:#EEF2FF;color:#6366F1;font-weight:700;font-size:20px;display:inline-block;margin-bottom:8px;\\\">1<\\/div><p style=\\\"margin:0 0 4px 0;font-weight:600;color:#1E293B;font-size:14px;\\\">Share your link<\\/p><p style=\\\"margin:0;font-size:13px;color:#64748B;\\\">Copy your unique referral link and send it to friends or colleagues.<\\/p><\\/td><td width=\\\"33%\\\" style=\\\"text-align:center;vertical-align:top;padding:0 8px;\\\"><div style=\\\"width:48px;height:48px;line-height:48px;border-radius:50%;background:#EEF2FF;color:#6366F1;font-weight:700;font-size:20px;display:inline-block;margin-bottom:8px;\\\">2<\\/div><p style=\\\"margin:0 0 4px 0;font-weight:600;color:#1E293B;font-size:14px;\\\">They sign up<\\/p><p style=\\\"margin:0;font-size:13px;color:#64748B;\\\">Your friend creates an account using your link and starts their trial.<\\/p><\\/td><td width=\\\"33%\\\" style=\\\"text-align:center;vertical-align:top;padding:0 8px;\\\"><div style=\\\"width:48px;height:48px;line-height:48px;border-radius:50%;background:#EEF2FF;color:#6366F1;font-weight:700;font-size:20px;display:inline-block;margin-bottom:8px;\\\">3<\\/div><p style=\\\"margin:0 0 4px 0;font-weight:600;color:#1E293B;font-size:14px;\\\">You both earn<\\/p><p style=\\\"margin:0;font-size:13px;color:#64748B;\\\">When they upgrade, you get a $25 credit and they get 20% off their first month.<\\/p><\\/td><\\/tr><\\/table>\",\"align\":\"center\",\"font_size\":\"16\"}},{\"type\":\"text\",\"data\":{\"content\":\"<table role=\\\"presentation\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\" style=\\\"background:#EEF2FF;border-radius:8px;\\\"><tr><td style=\\\"padding:20px;text-align:center;\\\"><p style=\\\"margin:0 0 8px 0;font-size:13px;color:#64748B;\\\">Your referral link<\\/p><p style=\\\"margin:0;font-size:16px;font-weight:600;color:#6366F1;word-break:break-all;\\\">https:\\/\\/example.com\\/ref\\/{first_name}<\\/p><\\/td><\\/tr><\\/table>\",\"align\":\"center\",\"font_size\":\"16\"}},{\"type\":\"button\",\"data\":{\"text\":\"Start Referring\",\"url\":\"https:\\/\\/example.com\\/referrals\",\"bg_color\":\"#6366F1\",\"text_color\":\"#FFFFFF\",\"align\":\"center\"}},{\"type\":\"text\",\"data\":{\"content\":\"<p style=\\\"margin:0;font-size:13px;color:#94A3B8;text-align:center;\\\">There is no limit to the number of people you can refer. Credits are applied automatically to your next invoice.<\\/p>\",\"align\":\"center\",\"font_size\":\"13\"}},{\"type\":\"footer\",\"data\":{\"text\":\"{company} | 123 Business Street, Suite 100\",\"unsubscribe_text\":\"Unsubscribe from these emails\"}}]', NULL, 'marketing', '1', '0', '2026-07-26 09:00:12', '2026-07-26 09:00:12', NULL);

CREATE TABLE `failed_jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) NOT NULL,
  `connection` text NOT NULL,
  `queue` text NOT NULL,
  `payload` longtext NOT NULL,
  `exception` longtext 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;


CREATE TABLE `help_articles` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `slug` varchar(255) NOT NULL,
  `title` varchar(255) NOT NULL,
  `content` longtext NOT NULL,
  `excerpt` varchar(500) DEFAULT NULL,
  `category` varchar(50) NOT NULL,
  `icon` varchar(50) DEFAULT NULL,
  `sort_order` int(10) unsigned NOT NULL DEFAULT 0,
  `is_published` tinyint(1) NOT NULL DEFAULT 1,
  `helpful_count` int(10) unsigned NOT NULL DEFAULT 0,
  `not_helpful_count` int(10) unsigned NOT NULL DEFAULT 0,
  `related_feature` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `help_articles_slug_unique` (`slug`),
  KEY `help_articles_category_index` (`category`),
  KEY `help_articles_is_published_index` (`is_published`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `help_articles` VALUES ('1', 'setting-up-your-workspace', 'Setting Up Your Workspace', 'Welcome to Email | Govaio! Your workspace is the central hub where your team collaborates on email outreach, manages contacts, and tracks deals. Setting it up correctly from the start will save you time and help your team work more efficiently.

To get started, head to Settings > Workspace from the sidebar. Here you can set your workspace name, upload your company logo, and configure your default timezone. These settings apply to all team members and affect how dates, times, and branding appear across the platform.

Next, invite your team members by going to Settings > Team. You can send email invitations and assign roles like Admin, Manager, or Member. Each role has different permission levels, so choose carefully based on what each person needs to access.

Finally, connect your first email account under Settings > Email. Email | Govaio supports Gmail, Outlook, and custom IMAP/SMTP servers. Once connected, you can start sending and receiving emails directly from the platform.

Tip: Complete the onboarding wizard that appears when you first sign in. It walks you through each of these steps and helps you get up and running in under 5 minutes.', 'Learn how to configure your Email | Govaio workspace for your team and start collaborating.', 'getting-started', NULL, '1', '1', '0', '0', 'onboarding', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('2', 'connecting-your-first-email-account', 'Connecting Your First Email Account', 'Connecting your email account allows you to send and receive messages directly within Email | Govaio, track opens and clicks, and keep your communication history organized alongside your contacts and deals.

Email | Govaio supports three types of email connections: Gmail (via OAuth), Microsoft Outlook (via OAuth), and custom IMAP/SMTP servers. For Gmail and Outlook, the process is straightforward. Navigate to Settings > Email and click \"Add Email Account.\" Select your provider and authorize Email | Govaio to access your account. No passwords are stored on our servers.

For custom IMAP/SMTP connections, you will need your incoming mail server address and port (usually 993 for IMAP with SSL), your outgoing mail server address and port (usually 587 for SMTP with TLS), and your email username and password. Enter these details in the connection form and click \"Test Connection\" to verify everything works before saving.

Once connected, Email | Govaio will begin syncing your recent emails. This initial sync may take a few minutes depending on the size of your mailbox. Going forward, new emails are synced in real time.

Important: Make sure your email provider allows third-party app access. For Gmail, you may need to enable \"Less secure app access\" or generate an App Password if you have 2FA enabled and are using IMAP directly.', 'Step-by-step guide to connecting Gmail, Outlook, or custom email accounts to Email | Govaio.', 'getting-started', NULL, '2', '1', '0', '0', 'email', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('3', 'understanding-the-dashboard', 'Understanding the Dashboard', 'The dashboard is the first thing you see when you log into Email | Govaio. It gives you a real-time overview of your email performance, contact activity, deal progress, and campaign results all in one place.

At the top, you will find key performance indicators (KPIs) like total emails sent, open rate, reply rate, and active deals value. These numbers update throughout the day and reflect your activity over the selected time period, which you can adjust using the date filter in the top right corner.

Below the KPIs, you will see activity charts showing your email volume and engagement trends over time. These help you spot patterns, such as which days of the week get the best response rates, or whether your outreach volume is trending up or down.

The Recent Activity feed shows the latest actions taken by you and your team, such as new contacts added, deals moved to a new stage, or campaigns launched. This keeps everyone aligned without needing to check each section individually.

Finally, the Quick Actions section at the bottom provides shortcuts to common tasks like composing a new email, creating a campaign, or importing contacts. Use these to jump straight into your workflow without navigating through the sidebar.', 'A tour of the Email | Govaio dashboard and what each metric means for your business.', 'getting-started', NULL, '3', '1', '0', '0', 'dashboard', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('4', 'sending-your-first-email', 'Sending Your First Email', 'Sending an email from Email | Govaio is simple and gives you powerful tracking capabilities that regular email clients do not offer. Every email you send can be tracked for opens, clicks, and replies, giving you visibility into engagement.

To compose a new email, click the \"Compose\" button in the Inbox section, or use the keyboard shortcut C. The compose window will open with fields for the recipient, subject line, and message body. You can type an email address directly or start typing a contact name to search your contact list.

The email editor supports rich text formatting including bold, italic, bullet lists, links, and attachments. You can also insert email templates if you have created any, which is great for sending consistent follow-ups or introductions.

Before sending, you will notice tracking options at the bottom of the compose window. Open tracking adds a tiny invisible pixel to your email that lets you know when the recipient opens it. Click tracking wraps your links so you can see when they are clicked. Both are enabled by default but can be toggled off for individual emails.

Once you hit Send, the email goes out through your connected email account. It will appear in both Email | Govaio and your regular email client, so your sent folder stays in sync. You can monitor the email status in the Inbox view, where a small icon will show whether it has been opened or clicked.', 'How to compose and send an email from Email | Govaio with tracking enabled.', 'email', NULL, '10', '1', '0', '0', 'inbox', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('5', 'managing-email-accounts', 'Managing Email Accounts', 'Email | Govaio allows you to connect multiple email accounts to a single workspace. This is useful for teams where different members use different email addresses, or when you want to separate outreach for different brands or purposes.

To manage your email accounts, go to Settings > Email. Here you will see a list of all connected accounts with their sync status, last sync time, and daily sending limits. You can add new accounts, remove existing ones, or edit connection settings.

Each email account has its own settings for signature, daily sending limit, and warm-up schedule. The daily sending limit helps protect your email reputation by preventing you from sending too many emails in a short period. We recommend starting with 50 emails per day for new accounts and gradually increasing as your sender reputation builds.

Email signatures can be customized per account. Go to the account settings and scroll to the Signature section to set up HTML signatures that will be automatically appended to your outgoing emails.

If an account shows a sync error, it usually means the connection has expired or your credentials have changed. Click \"Reconnect\" to re-authorize the account. For OAuth connections like Gmail and Outlook, this is just a one-click process.', 'Add, remove, and configure multiple email accounts in your workspace.', 'email', NULL, '11', '1', '0', '0', 'email', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('6', 'email-tracking-explained', 'Email Tracking Explained', 'Email tracking in Email | Govaio gives you visibility into how recipients interact with your emails. There are three types of tracking available: open tracking, click tracking, and reply detection.

Open tracking works by embedding a tiny, invisible 1x1 pixel image in your email. When the recipient opens the email and their email client loads images, the pixel is downloaded from our servers, recording the open event. Keep in mind that some email clients block images by default, so open tracking is not 100% accurate, but it gives you a reliable directional signal.

Click tracking works by routing your email links through our tracking servers. When a recipient clicks a tracked link, the click is recorded and the recipient is immediately redirected to the original destination. This happens in milliseconds, so the experience is seamless for the recipient.

Reply detection is automatic. When someone replies to an email you sent through Email | Govaio, the reply is detected and logged against the contact record. This helps you track response rates across campaigns and individual outreach.

You can view tracking data at the individual email level in the conversation view, or in aggregate through the Analytics section. Tracking data is retained for the lifetime of your account and can be exported at any time.

Privacy note: All tracking complies with email best practices. Recipients can opt out of tracking by unsubscribing, and you can disable tracking on any individual email before sending.', 'Understand how open tracking, click tracking, and reply detection work.', 'email', NULL, '12', '1', '0', '0', 'inbox', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('7', 'importing-contacts-from-a-file', 'Importing Contacts from a File', 'Email | Govaio makes it easy to bring your existing contacts into the platform. You can import contacts from CSV or Excel files, and the import wizard will guide you through mapping your file columns to Email | Govaio contact fields.

To start an import, go to Contacts and click the \"Import\" button. Select your file (CSV or XLSX format) and upload it. On the next screen, you will see a preview of your data and a mapping interface where you can match each column in your file to the corresponding Email | Govaio field such as First Name, Last Name, Email, Company, Phone, and any custom fields you have created.

Email | Govaio will automatically detect and suggest mappings for common column names. For example, a column named \"Email Address\" will automatically map to the Email field. Review the suggested mappings and adjust any that are incorrect.

During import, Email | Govaio checks for duplicate contacts based on email address. If a contact with the same email already exists, you can choose to skip duplicates, update existing records with new data, or create duplicates. We recommend choosing \"Update existing\" to keep your data fresh without creating duplicate entries.

After the import completes, you will see a summary showing how many contacts were created, updated, and skipped. Any rows with errors (such as invalid email formats) will be listed so you can fix and re-import them. There is no limit on the number of contacts you can import at once, but very large files (over 100,000 rows) may take a few minutes to process.', 'Import your existing contacts into Email | Govaio using CSV or Excel files.', 'contacts', NULL, '20', '1', '0', '0', 'contacts', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('8', 'using-tags-and-segments', 'Using Tags and Segments', 'Tags and segments are two powerful ways to organize your contacts in Email | Govaio. While they serve similar purposes, they work differently and are best used for different scenarios.

Tags are simple labels you attach to contacts manually or via automation. For example, you might tag contacts as \"VIP\", \"Conference Lead\", or \"Churned Customer\". To add a tag, open a contact record and click the tag icon, then type a new tag name or select from existing tags. You can also bulk-tag contacts by selecting multiple contacts from the list and choosing \"Add Tag\" from the bulk actions menu.

Segments are dynamic groups defined by rules and conditions. Unlike tags, segments update automatically as contact data changes. For example, you can create a segment for \"Contacts who opened an email in the last 30 days\" or \"Contacts in the Technology industry with more than 50 employees.\" To create a segment, go to Contacts and click \"New Segment.\" Build your rules using the condition builder, which supports filters on any contact field, activity data, and tag membership.

Both tags and segments can be used as audience targets for campaigns. When creating a campaign, you can select one or more tags or segments as your recipient list. Segments are particularly powerful here because they ensure your campaign always targets the most up-to-date group of contacts matching your criteria.

Best practice: Use tags for permanent or semi-permanent categorizations (like lead source or customer tier), and use segments for dynamic, behavior-based groupings (like engagement level or purchase history).', 'Organize your contacts with tags and create dynamic segments for targeted outreach.', 'contacts', NULL, '21', '1', '0', '0', 'contacts', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('9', 'managing-contact-lists', 'Managing Contact Lists', 'A clean, well-organized contact database is the foundation of effective email outreach. Email | Govaio provides several tools to help you maintain data quality and keep your contact lists in order.

The Contacts page shows all your contacts in a sortable, filterable table. You can filter by any field, search by name or email, and sort by date added, last activity, or any custom field. Use the column selector to customize which fields are visible in the table.

Duplicate detection and merging is available under Contacts > Merge Duplicates. Email | Govaio scans your database for contacts that share the same email address, phone number, or name, and presents them as potential duplicates. You can review each pair and choose which record to keep, merging the data from both into a single clean record.

Bulk operations let you perform actions on many contacts at once. Select contacts using the checkboxes and choose from bulk actions like Add Tag, Remove Tag, Delete, or Export. This is useful for cleaning up after an import or reorganizing your database.

Data enrichment automatically fills in missing contact information when possible. When you add a new contact with just an email address, Email | Govaio can look up additional details like company name, job title, and social profiles. This feature can be enabled in Settings > Contacts.

Regular maintenance tip: Review your contacts quarterly. Archive or remove contacts who have bounced, unsubscribed, or shown no engagement in the past 6 months. This keeps your sending reputation healthy and your metrics accurate.', 'Keep your contact database clean and organized with list management tools.', 'contacts', NULL, '22', '1', '0', '0', 'contacts', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('10', 'creating-your-first-campaign', 'Creating Your First Campaign', 'Campaigns in Email | Govaio let you send personalized emails to many contacts at once while tracking performance across the entire send. Whether you are announcing a product launch, sharing a newsletter, or running a cold outreach sequence, campaigns make it efficient and measurable.

To create a campaign, go to Campaigns and click \"New Campaign.\" You will walk through four steps: naming your campaign, selecting your audience, composing your email, and reviewing before launch.

In the Audience step, choose who receives your campaign. You can select a tag, segment, or manually pick contacts. Email | Govaio will show you the estimated reach and automatically exclude any contacts who have unsubscribed or bounced in the past.

The Compose step is where you write your email. Use the drag-and-drop editor to build visually appealing emails, or switch to the plain text editor for simpler messages. Personalization variables like the contact first name and company name can be inserted using double curly braces. Preview your email to see how it looks with real contact data.

Before launching, the Review step shows you a summary of everything: recipient count, email preview, tracking settings, and sending schedule. You can choose to send immediately or schedule for a future date and time. For large campaigns, Email | Govaio automatically throttles sending to protect your email reputation.

After your campaign is sent, the Campaign Report page shows real-time metrics including delivery rate, open rate, click rate, reply rate, and unsubscribe rate. Use these insights to refine your messaging and targeting for future campaigns.', 'Build and launch your first email campaign to reach your audience at scale.', 'campaigns', NULL, '30', '1', '0', '0', 'campaigns', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('11', 'understanding-ab-testing', 'Understanding A/B Testing', 'A/B testing (also called split testing) lets you compare two versions of your email to see which performs better. This is one of the most effective ways to improve your open rates and engagement over time.

When creating a campaign, you can enable A/B testing in the Compose step. Email | Govaio supports testing different subject lines, email content, or sender names. The most common test is subject line testing, which helps you discover what language and tone drives the most opens.

Here is how it works: You create two (or more) variants of your email, each with a different element you want to test. Email | Govaio sends each variant to a small, equal portion of your audience (the test group, typically 10-20% each). After a waiting period you choose (usually 2-4 hours), Email | Govaio measures the results and automatically sends the winning variant to the remaining audience.

The winning variant is determined by the metric you select: open rate for subject line tests, click rate for content tests, or reply rate for more advanced optimization. You can also choose to select the winner manually if you prefer to review the results yourself.

Best practices for A/B testing: Test only one variable at a time so you know exactly what caused the difference. Make sure your test group is large enough to produce statistically meaningful results, ideally at least 200 recipients per variant. Run tests consistently over time to build up insights about what works for your specific audience.

After the campaign completes, the report will show detailed results for each variant so you can apply your learnings to future campaigns.', 'Test different subject lines and content to find what resonates with your audience.', 'campaigns', NULL, '31', '1', '0', '0', 'campaigns', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('12', 'setting-up-drip-sequences', 'Setting Up Drip Sequences', 'Drip sequences are automated email series that send follow-up messages at scheduled intervals. They are perfect for onboarding new subscribers, nurturing leads, or following up after a meeting without manually remembering to send each email.

To create a drip sequence, go to Campaigns and click \"New Campaign,\" then select the \"Drip Sequence\" type. You will build a sequence of emails, each with its own content, delay, and conditions.

Start by creating your first email in the sequence. This is the email that goes out immediately (or at your chosen start time) when a contact enters the sequence. Then add follow-up steps with delays between them. For example, you might send Email 1 on Day 0, Email 2 on Day 3, and Email 3 on Day 7.

Each step in the sequence can have conditions that determine whether the email sends. Common conditions include: send only if the previous email was not replied to, send only if the contact has not unsubscribed, or send only if the contact has opened a previous email. These conditions help you avoid annoying contacts who have already engaged.

Contacts can enter the drip sequence in several ways: manually by adding them from the contact list, automatically via a workflow trigger (for example, when a new contact is created), or through a campaign audience selection.

Monitor your drip sequence performance in the Campaign Report. You will see metrics for each step individually, plus an overall funnel view showing how contacts move through the sequence. Pause or modify the sequence at any time without affecting contacts who have already received earlier steps.', 'Create automated multi-step email sequences that send over days or weeks.', 'campaigns', NULL, '32', '1', '0', '0', 'campaigns', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('13', 'what-are-workflows', 'What Are Workflows?', 'Workflows are automated sequences of actions that run in response to triggers. Think of them as \"if this happens, then do that\" rules that work around the clock so you do not have to perform repetitive tasks manually.

For example, you can create a workflow that automatically tags a contact as \"Hot Lead\" when they open three or more of your emails, then assigns them to a sales rep, and sends a Slack notification to your team. All of this happens without any manual intervention.

Workflows consist of three main building blocks: Triggers are events that start the workflow, such as \"Contact created,\" \"Email opened,\" \"Deal stage changed,\" or \"Form submitted.\" Conditions are rules that decide whether the workflow should continue, like \"If contact industry equals Technology\" or \"If deal value is greater than $10,000.\" Actions are the tasks the workflow performs, such as \"Send email,\" \"Add tag,\" \"Create deal,\" \"Wait 2 days,\" or \"Send webhook.\"

You build workflows visually using the drag-and-drop Workflow Builder. Connect triggers, conditions, and actions by dragging lines between them. The visual interface makes it easy to understand the logic at a glance and share workflows with team members.

Workflows run automatically once activated. You can monitor their execution in the Workflow Logs, where you will see each instance of the workflow running, which contacts it processed, and whether each step succeeded or failed. If a step fails, the workflow pauses and notifies you so you can investigate and fix the issue.', 'Learn how workflows automate repetitive tasks and save your team hours every week.', 'workflows', NULL, '40', '1', '0', '0', 'workflows', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('14', 'creating-your-first-automation', 'Creating Your First Automation', 'Building your first workflow is straightforward with Email | Govaio\'s visual builder. Let us walk through creating a common automation: automatically following up with new contacts who do not reply to your initial email.

Go to Workflows and click \"Create Workflow.\" Give it a name like \"New Contact Follow-up\" and click \"Open Builder.\" You will see a blank canvas with a Start node.

First, add a trigger by clicking the plus icon on the Start node. Select \"Email Sent\" as the trigger type. This means the workflow will start whenever you send an email to a contact. You can add filter conditions on the trigger, such as only triggering for emails with a specific tag or from a specific email account.

Next, add a \"Wait\" action and set the delay to 3 days. This gives the recipient time to see and respond to your email before the follow-up kicks in.

After the wait, add a \"Condition\" node to check whether the contact has replied. Select \"Has replied\" as the condition. If yes, the workflow ends (the contact engaged and does not need a follow-up). If no, the workflow continues to the next step.

On the \"No\" branch, add a \"Send Email\" action. Compose your follow-up email here. You might say something like \"Just checking in on my previous email\" with a brief reminder of your original message.

Save and activate the workflow. From now on, every email you send will automatically get a follow-up after 3 days if the contact has not replied. You can view the results in Workflow Logs to see how many contacts received follow-ups and whether engagement improved.

Tip: Start simple and iterate. Once you are comfortable with basic workflows, explore more advanced features like multi-branch conditions, webhook integrations, and nested workflows.', 'Step-by-step guide to building a simple workflow automation.', 'workflows', NULL, '41', '1', '0', '0', 'workflows', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('15', 'setting-up-your-sales-pipeline', 'Setting Up Your Sales Pipeline', 'The Deals section in Email | Govaio provides a visual pipeline (Kanban board) for tracking your sales opportunities from first contact to closed deal. Before you start using it, you will want to configure the stages to match your specific sales process.

To set up your pipeline, go to Deals and click the gear icon. Here you can create, rename, reorder, and delete deal stages. The default stages are Lead, Qualified, Proposal, Negotiation, and Closed Won / Closed Lost, but you should customize these to match how your team actually sells.

Keep your pipeline stages simple and actionable. Each stage should represent a clear milestone in your sales process. Avoid having too many stages (5-7 is ideal) as it makes the board harder to manage. Each stage should answer the question \"What needs to happen before this deal moves to the next stage?\"

When creating a new deal, you will fill in the contact or company name, deal value, expected close date, and assign it to a team member. The deal will appear as a card on your pipeline board. Drag and drop cards between stages as deals progress.

Each deal card shows key information at a glance: the deal name, value, contact name, and how long it has been in the current stage. Click a deal to open its detail view, where you can see the full history of activities, emails, notes, and stage changes.

For teams with multiple sales processes (for example, new business vs. renewals), you can create separate pipelines. Each pipeline has its own stages and can be filtered independently. Use the pipeline selector at the top of the Deals page to switch between them.', 'Configure deal stages and pipelines to match your sales process.', 'deals', NULL, '50', '1', '0', '0', 'deals', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('16', 'managing-deals', 'Managing Deals', 'Once your pipeline is set up, managing deals day-to-day is about keeping your pipeline accurate and up-to-date so you can forecast revenue and prioritize your time effectively.

The deal board gives you a visual overview of your entire pipeline. Deals are displayed as cards in their current stage, and you can drag them between stages as they progress. The total value of deals in each stage is shown at the top of each column, giving you an instant snapshot of your pipeline health.

To update a deal, click on it to open the detail view. Here you can change the deal value, update the expected close date, add notes about your latest conversation, and log activities like calls, meetings, or emails. All of these updates are timestamped and visible to your team.

Deals are linked to contacts, so all email conversations and activity with the associated contact are visible in the deal view. This means you never lose context when following up. If a deal involves multiple contacts (for example, a champion and a decision maker), you can associate multiple contacts with a single deal.

Use filters and sorting to focus your attention. Filter deals by stage, owner, value range, or expected close date. Sort by value to focus on your biggest opportunities, or by age to identify deals that are stuck and need attention.

When a deal is won or lost, move it to the appropriate final stage. Email | Govaio will prompt you to record a reason for the outcome, which builds up valuable data over time about why you win and lose deals. This information appears in the Analytics section to help you improve your sales process.', 'Track deal progress, add notes, and close deals effectively.', 'deals', NULL, '51', '1', '0', '0', 'deals', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('17', 'configuring-ai-responses', 'Configuring AI Responses', 'Email | Govaio\'s AI assistant helps you write better emails faster by drafting replies, suggesting follow-ups, and improving your existing copy. To get the most out of it, you should configure it to understand your communication style and business context.

Go to Settings > AI to access the AI configuration panel. The first thing to set up is your AI provider. Email | Govaio supports multiple AI providers including OpenAI, Anthropic, and Google. Enter your API key for your preferred provider and select the model you want to use. More powerful models produce better results but consume more tokens.

The Tone and Style settings let you tell the AI how you communicate. Options include Professional, Friendly, Casual, and Formal. You can also provide custom instructions like \"Always mention our free trial\" or \"Keep emails under 150 words.\" These instructions apply to all AI-generated content across your workspace.

The AI assistant appears in several places throughout Email | Govaio: in the email composer (click the AI icon to generate a draft or improve your writing), in the inbox (suggested replies appear below incoming emails), and in the campaign editor (use AI to generate subject lines, body copy, or A/B test variants).

You can control how much the AI assists by toggling individual features on or off. Some teams prefer to use AI only for reply suggestions, while others use it for everything from drafting outreach to generating campaign content.

Usage tracking shows your monthly token consumption and helps you stay within budget. Set a monthly token limit to prevent unexpected charges from your AI provider.', 'Set up and customize the AI assistant to draft emails and suggest replies.', 'ai', NULL, '60', '1', '0', '0', 'ai', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('18', 'training-ai-with-knowledge-base', 'Training Your AI with Knowledge Base', 'The Knowledge Base in Email | Govaio serves as the AI\'s training data. By uploading your company documents, product guides, FAQs, and other reference materials, you give the AI the context it needs to generate accurate, brand-consistent responses.

To add documents, go to Knowledge Base from the sidebar. Click \"Upload Document\" and select a file. Supported formats include PDF, Word documents, text files, and Markdown. You can also paste content directly using the \"Add from Text\" option.

Once uploaded, Email | Govaio processes the document by breaking it into smaller chunks and creating searchable embeddings. This process takes a few seconds to a couple of minutes depending on the document length. When complete, the AI can reference this information when generating replies and drafts.

Organize your documents with categories and tags to keep things manageable. Common categories include Product Information, Pricing, FAQs, Company Policies, and Competitor Comparisons. Well-organized knowledge base content leads to more relevant and accurate AI responses.

The AI uses the knowledge base contextually. When someone asks about pricing in an email, the AI will search your knowledge base for pricing-related documents and use that information to draft a response. It will not make up information; if the answer is not in the knowledge base, the AI will indicate that it does not have enough information.

Keep your knowledge base up to date. Whenever your products, pricing, or policies change, update the relevant documents. Outdated information leads to outdated AI responses, which can confuse customers and damage trust.', 'Upload documents to the Knowledge Base so the AI gives accurate, on-brand answers.', 'ai', NULL, '61', '1', '0', '0', 'knowledge-base', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('19', 'understanding-ai-settings', 'Understanding AI Settings', 'Email | Govaio\'s AI configuration has several settings that control how the assistant behaves. Here is what each one does in plain language so you can tune it for your needs.

Creativity Level (Temperature) controls how creative versus predictable the AI responses are. A lower value (around 0.3) produces consistent, safe responses that closely follow your knowledge base. A higher value (around 0.8 or above) produces more varied and creative responses. For business emails, we recommend a value between 0.5 and 0.7.

Maximum Response Length sets how long the AI replies can be. Short responses are a few sentences, medium is one or two paragraphs, and long allows detailed multi-paragraph answers. Match this to your typical email style. If your team writes concise emails, keep this on Short or Medium.

Confidence Threshold determines how sure the AI needs to be before taking action in automatic mode. At 80%, the AI only sends replies when it is very confident the response is correct. At 50%, it sends more frequently but may occasionally miss the mark. Start with a high threshold and lower it as you build trust in the AI.

Send Mode controls the level of automation. \"Suggestions Only\" shows AI-drafted responses that you copy and paste. \"Review Before Sending\" queues drafts for your approval. \"Fully Automatic\" lets the AI send responses on its own when confidence is above your threshold.

Business Hours restricts AI activity to your configured working hours. Outside of business hours, the AI can optionally send a custom out-of-office message instead of a full reply. Configure your business hours in Settings > Workspace.', 'A plain-language explanation of each AI setting and what it controls.', 'ai', NULL, '62', '1', '0', '0', 'ai', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('20', 'managing-your-subscription', 'Managing Your Subscription', 'Email | Govaio offers several subscription plans to fit teams of different sizes and needs. You can manage your subscription at any time from Settings > Billing.

The Billing page shows your current plan, billing cycle (monthly or annual), next payment date, and payment method on file. You can see a breakdown of what is included in your plan, such as the number of email accounts, contacts, monthly emails, and AI tokens.

To upgrade your plan, click \"Change Plan\" and select a higher tier. Upgrades take effect immediately, and you will be charged a prorated amount for the remainder of your current billing period. All your data and settings are preserved when you upgrade.

Downgrading works similarly but takes effect at the end of your current billing period. This means you continue to enjoy your current plan features until the period ends, then switch to the lower plan. If your current usage exceeds the limits of the lower plan (for example, more connected email accounts than allowed), you will need to adjust before the downgrade takes effect.

To update your payment method, click \"Update Payment Method\" and enter your new card details. Email | Govaio supports all major credit and debit cards, as well as several regional payment methods depending on your location.

Invoices are available for download in the Billing History section. Each invoice includes all the details you need for expense reporting or tax purposes. If you need a custom invoice with specific billing information (like a VAT number or purchase order), you can configure these details in the Billing Settings.', 'Upgrade, downgrade, or cancel your plan and manage payment methods.', 'billing', NULL, '70', '1', '0', '0', 'billing', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('21', 'understanding-plan-limits', 'Understanding Plan Limits', 'Each Email | Govaio plan comes with specific limits on features like connected email accounts, total contacts, monthly email sends, AI tokens, and team members. Understanding these limits helps you choose the right plan and avoid unexpected interruptions.

Your current usage vs. plan limits is displayed on the Dashboard and in Settings > Billing. A usage bar shows how close you are to each limit. When you reach 80% of any limit, Email | Govaio will display a notification suggesting you review your plan.

When you hit a limit, Email | Govaio does not immediately cut off access. Instead, the behavior depends on the limit type. For email sending limits, additional sends are queued and will go out when the limit resets (monthly). For contact limits, you can still view and email existing contacts but cannot add new ones. For AI token limits, AI features are temporarily disabled until the next billing cycle or until you upgrade.

If you consistently hit your limits, consider upgrading to the next plan tier. Annual billing offers a significant discount compared to monthly billing, so switching to annual can offset the cost of an upgrade.

For teams with unique needs that do not fit standard plans, contact our sales team to discuss custom enterprise pricing. Enterprise plans offer custom limits, dedicated support, SLA guarantees, and additional features like SSO and audit logging.

Tip: Monitor the Usage section in your Dashboard regularly. This helps you anticipate when you might hit a limit and take action proactively, whether that means cleaning up your contact list, optimizing your campaign frequency, or upgrading your plan.', 'Know what is included in your plan and what happens when you reach a limit.', 'billing', NULL, '71', '1', '0', '0', 'billing', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `help_articles` VALUES ('22', 'connecting-integrations', 'Connecting Integrations', 'Email | Govaio integrates with popular business tools to streamline your workflow and keep your data in sync across platforms. Available integrations include Slack, Salesforce, Google Calendar, Zapier, and more.

To connect an integration, go to Settings > Integrations. You will see a grid of available integrations, each with a brief description of what it does. Click \"Connect\" on the integration you want to set up.

Slack integration sends real-time notifications to your Slack channels when important events happen in Email | Govaio, such as new deals created, campaigns completed, or high-value emails opened. You can customize which events trigger notifications and which channel receives them.

Salesforce integration syncs your contacts, deals, and activity data between Email | Govaio and Salesforce. This is a two-way sync, so changes in either platform are reflected in the other. Set up field mapping to control exactly which fields sync and in which direction.

Google Calendar integration shows your upcoming meetings in the Email | Govaio sidebar and lets you schedule meetings directly from contact records. When you create a meeting, it automatically appears on your Google Calendar with all relevant details.

Zapier integration opens up connections to thousands of other apps. Create Zaps that trigger Email | Govaio actions based on events in other apps, or send Email | Govaio data to external services. Common use cases include syncing form submissions to Email | Govaio contacts, creating deals from CRM events, and logging activity to spreadsheets.

Each integration can be disconnected at any time without losing your Email | Govaio data. Go to Settings > Integrations, find the connected integration, and click \"Disconnect.\"', 'Connect Email | Govaio to Slack, Salesforce, Google Calendar, and other tools.', 'integrations', NULL, '80', '1', '0', '0', 'integrations', '2026-07-26 09:00:11', '2026-07-26 09:00:11');

INSERT INTO `help_articles` VALUES ('24', 'campaign-not-sending', 'Campaign Not Sending?', 'If your campaign appears stuck or recipients are not receiving your emails, here are the most common causes and how to fix them.

First, check the campaign status on the Campaigns page. A campaign can be in several states: Draft (not yet launched), Scheduled (waiting for the scheduled send time), Sending (actively delivering), Paused (manually paused or auto-paused due to an issue), and Completed (all emails sent). If your campaign is in Draft or Scheduled status, it has not started sending yet.

If the campaign shows as \"Sending\" but progress seems slow, this is likely due to sending throttling. Email | Govaio automatically limits sending speed to protect your email reputation. For new email accounts, the default is 50 emails per hour. You can adjust this in Settings > Email under the account\'s sending limits, but we recommend increasing gradually.

If the campaign is \"Paused,\" click on it to see why. Common auto-pause reasons include a high bounce rate (more than 5% of emails bounced, indicating a list quality issue), the connected email account becoming disconnected, or hitting your plan\'s daily sending limit. Address the underlying issue and click \"Resume\" to continue sending.

Check the campaign report for delivery details. The report shows how many emails were sent, delivered, bounced, and deferred. High bounce rates usually mean your contact list needs cleaning. Remove invalid email addresses and re-verify your list before resuming.

If recipients say they are not seeing your emails, ask them to check their spam or promotions folder. Email deliverability depends on many factors including your sender reputation, email content, and the recipient\'s email provider. Make sure your sending domain has proper SPF, DKIM, and DMARC records configured. You can verify this in Settings > Email > Deliverability Check.

For campaigns using a drip sequence, check that the conditions between steps are not filtering out all recipients. A common mistake is setting a condition like \"If not replied\" when no one has replied yet, causing the workflow to wait indefinitely.', 'Troubleshoot campaigns that are stuck, paused, or not delivering to recipients.', 'troubleshooting', NULL, '91', '1', '0', '0', 'campaigns', '2026-07-26 09:00:11', '2026-07-26 09:00:11');

CREATE TABLE `invites` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `invited_by` bigint(20) unsigned NOT NULL,
  `email` varchar(255) NOT NULL,
  `role` enum('admin','agent','viewer') NOT NULL DEFAULT 'agent',
  `status` varchar(20) NOT NULL DEFAULT 'pending',
  `token` varchar(64) NOT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `accepted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `invites_token_unique` (`token`),
  UNIQUE KEY `invites_workspace_email_status_unique` (`workspace_id`,`email`,`status`),
  KEY `invites_invited_by_foreign` (`invited_by`),
  KEY `invites_workspace_id_email_index` (`workspace_id`,`email`),
  KEY `invites_token_index` (`token`),
  CONSTRAINT `invites_invited_by_foreign` FOREIGN KEY (`invited_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `invites_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `job_batches` (
  `id` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `total_jobs` int(11) NOT NULL,
  `pending_jobs` int(11) NOT NULL,
  `failed_jobs` int(11) NOT NULL,
  `failed_job_ids` longtext NOT NULL,
  `options` mediumtext DEFAULT NULL,
  `cancelled_at` int(11) DEFAULT NULL,
  `created_at` int(11) NOT NULL,
  `finished_at` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `queue` varchar(255) NOT NULL,
  `payload` longtext NOT NULL,
  `attempts` tinyint(3) unsigned NOT NULL,
  `reserved_at` int(10) unsigned DEFAULT NULL,
  `available_at` int(10) unsigned NOT NULL,
  `created_at` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `kb_chunks` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `document_id` bigint(20) unsigned NOT NULL,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `content` text NOT NULL,
  `chunk_index` int(10) unsigned NOT NULL DEFAULT 0,
  `vector_id` varchar(255) DEFAULT NULL,
  `usage_count` int(10) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `kb_chunks_document_id_foreign` (`document_id`),
  KEY `kb_chunks_workspace_id_index` (`workspace_id`),
  FULLTEXT KEY `kb_chunks_content_fulltext` (`content`),
  CONSTRAINT `kb_chunks_document_id_foreign` FOREIGN KEY (`document_id`) REFERENCES `kb_documents` (`id`) ON DELETE CASCADE,
  CONSTRAINT `kb_chunks_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `kb_documents` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) NOT NULL,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `type` enum('document','website','qa') NOT NULL DEFAULT 'document',
  `title` varchar(255) NOT NULL,
  `content` text DEFAULT NULL,
  `content_hash` varchar(64) DEFAULT NULL,
  `question` varchar(255) DEFAULT NULL,
  `answer` text DEFAULT NULL,
  `category` varchar(255) DEFAULT NULL,
  `is_priority` tinyint(1) NOT NULL DEFAULT 0,
  `file_path` varchar(255) DEFAULT NULL,
  `file_type` varchar(10) DEFAULT NULL,
  `file_size` bigint(20) unsigned DEFAULT NULL,
  `source_url` varchar(255) DEFAULT NULL,
  `status` enum('uploading','extracting','chunking','embedding','ready','failed','paused') NOT NULL DEFAULT 'uploading',
  `error_message` varchar(255) DEFAULT NULL,
  `chunks_count` int(10) unsigned NOT NULL DEFAULT 0,
  `usage_count` int(10) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `kb_documents_uuid_unique` (`uuid`),
  KEY `kb_documents_workspace_id_type_index` (`workspace_id`,`type`),
  KEY `kb_documents_workspace_id_status_index` (`workspace_id`,`status`),
  KEY `kb_documents_workspace_id_category_index` (`workspace_id`,`category`),
  KEY `kb_documents_workspace_id_content_hash_index` (`workspace_id`,`content_hash`),
  CONSTRAINT `kb_documents_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `kb_websites` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `url` varchar(255) NOT NULL,
  `domain` varchar(255) NOT NULL,
  `scrape_depth` varchar(20) NOT NULL DEFAULT 'single',
  `max_pages` int(10) unsigned NOT NULL DEFAULT 50,
  `include_patterns` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`include_patterns`)),
  `exclude_patterns` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`exclude_patterns`)),
  `rescrape_schedule` varchar(20) NOT NULL DEFAULT 'never',
  `pages_count` int(10) unsigned NOT NULL DEFAULT 0,
  `status` enum('active','paused','error') NOT NULL DEFAULT 'active',
  `last_scraped_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `kb_websites_workspace_id_index` (`workspace_id`),
  CONSTRAINT `kb_websites_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `languages` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `code` varchar(10) NOT NULL,
  `native_name` varchar(50) DEFAULT NULL,
  `direction` varchar(3) NOT NULL DEFAULT 'ltr',
  `flag` varchar(10) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 0,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `languages_code_unique` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `languages` VALUES ('1', 'English', 'en', 'English', 'ltr', '🇺🇸', '1', '1', '1', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `languages` VALUES ('2', 'Spanish', 'es', 'Español', 'ltr', '🇪🇸', '1', '0', '2', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `languages` VALUES ('3', 'French', 'fr', 'Français', 'ltr', '🇫🇷', '1', '0', '3', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `languages` VALUES ('4', 'German', 'de', 'Deutsch', 'ltr', '🇩🇪', '1', '0', '4', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `languages` VALUES ('5', 'Portuguese', 'pt', 'Português', 'ltr', '🇧🇷', '1', '0', '5', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `languages` VALUES ('6', 'Arabic', 'ar', 'العربية', 'rtl', '🇸🇦', '1', '0', '6', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `languages` VALUES ('7', 'Hindi', 'hi', 'हिन्दी', 'ltr', '🇮🇳', '1', '0', '7', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `languages` VALUES ('8', 'Chinese', 'zh', '中文', 'ltr', '🇨🇳', '0', '0', '8', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `languages` VALUES ('9', 'Japanese', 'ja', '日本語', 'ltr', '🇯🇵', '0', '0', '9', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `languages` VALUES ('10', 'Korean', 'ko', '한국어', 'ltr', '🇰🇷', '0', '0', '10', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `languages` VALUES ('11', 'Turkish', 'tr', 'Türkçe', 'ltr', '🇹🇷', '1', '0', '11', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `languages` VALUES ('12', 'Russian', 'ru', 'Русский', 'ltr', '🇷🇺', '0', '0', '12', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `languages` VALUES ('13', 'Italian', 'it', 'Italiano', 'ltr', '🇮🇹', '1', '0', '13', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `languages` VALUES ('14', 'Dutch', 'nl', 'Nederlands', 'ltr', '🇳🇱', '0', '0', '14', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `languages` VALUES ('15', 'Bengali', 'bn', 'বাংলা', 'ltr', '🇧🇩', '1', '0', '15', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `languages` VALUES ('16', 'Indonesian', 'id', 'Bahasa', 'ltr', '🇮🇩', '0', '0', '16', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `languages` VALUES ('17', 'Hebrew', 'he', 'עברית', 'rtl', '🇮🇱', '0', '0', '17', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `languages` VALUES ('18', 'Urdu', 'ur', 'اردو', 'rtl', '🇵🇰', '0', '0', '18', '2026-07-26 09:00:11', '2026-07-26 09:00:11');

CREATE TABLE `lead_scoring_rules` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `event` varchar(255) NOT NULL,
  `points` int(11) NOT NULL,
  `description` varchar(255) 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`),
  KEY `lead_scoring_rules_workspace_id_foreign` (`workspace_id`),
  CONSTRAINT `lead_scoring_rules_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `magic_links` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(255) NOT NULL,
  `token` varchar(64) NOT NULL,
  `used_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `magic_links_token_unique` (`token`),
  KEY `magic_links_email_index` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `messages` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) NOT NULL,
  `conversation_id` bigint(20) unsigned NOT NULL,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `direction` enum('inbound','outbound') NOT NULL DEFAULT 'inbound',
  `sender_type` enum('contact','agent','ai','system') NOT NULL DEFAULT 'contact',
  `sender_id` bigint(20) unsigned DEFAULT NULL,
  `type` enum('message','note','ai_draft','system_event') NOT NULL DEFAULT 'message',
  `body_html` mediumtext DEFAULT NULL,
  `body_text` mediumtext DEFAULT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `from_email` varchar(255) DEFAULT NULL,
  `from_name` varchar(255) DEFAULT NULL,
  `to_emails` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`to_emails`)),
  `cc_emails` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`cc_emails`)),
  `bcc_emails` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`bcc_emails`)),
  `message_id_header` varchar(255) DEFAULT NULL,
  `in_reply_to` varchar(255) DEFAULT NULL,
  `references_header` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`references_header`)),
  `ai_confidence` tinyint(3) unsigned DEFAULT NULL,
  `ai_model` varchar(255) DEFAULT NULL,
  `ai_provider` varchar(255) DEFAULT NULL,
  `ai_tokens_in` int(10) unsigned DEFAULT NULL,
  `ai_tokens_out` int(10) unsigned DEFAULT NULL,
  `ai_cost` decimal(8,5) DEFAULT NULL,
  `ai_response_time_ms` int(10) unsigned DEFAULT NULL,
  `ai_sources_used` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`ai_sources_used`)),
  `ai_status` enum('draft','approved','sent','rejected','edited') DEFAULT NULL,
  `sentiment` enum('positive','neutral','negative','angry') DEFAULT NULL,
  `detected_language` varchar(10) DEFAULT NULL,
  `delivery_status` enum('queued','sent','delivered','failed','bounced') DEFAULT NULL,
  `delivery_error` varchar(255) DEFAULT NULL,
  `opens_count` int(10) unsigned NOT NULL DEFAULT 0,
  `clicks_count` int(10) unsigned NOT NULL DEFAULT 0,
  `sent_at` timestamp NULL DEFAULT NULL,
  `delivered_at` timestamp NULL DEFAULT NULL,
  `opened_at` timestamp NULL DEFAULT NULL,
  `clicked_at` timestamp NULL DEFAULT NULL,
  `bounced_at` timestamp NULL DEFAULT NULL,
  `bounce_type` varchar(255) DEFAULT NULL,
  `scheduled_at` timestamp NULL DEFAULT NULL,
  `schedule_status` enum('pending','sent','cancelled') DEFAULT NULL,
  `channel_message_id` varchar(255) DEFAULT NULL,
  `imap_uid` int(10) unsigned DEFAULT NULL,
  `imap_folder` varchar(100) 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 `messages_uuid_unique` (`uuid`),
  UNIQUE KEY `messages_workspace_message_id_header_unique` (`workspace_id`,`message_id_header`),
  KEY `messages_sender_id_foreign` (`sender_id`),
  KEY `messages_conversation_id_created_at_index` (`conversation_id`,`created_at`),
  KEY `messages_workspace_id_ai_status_index` (`workspace_id`,`ai_status`),
  KEY `messages_workspace_id_type_index` (`workspace_id`,`type`),
  KEY `messages_ws_sender_type_idx` (`workspace_id`,`sender_type`),
  KEY `messages_ws_delivery_status_idx` (`workspace_id`,`delivery_status`),
  KEY `messages_conv_direction_idx` (`conversation_id`,`direction`),
  KEY `idx_messages_conv_direction_created` (`conversation_id`,`direction`,`created_at`),
  KEY `idx_messages_ws_msgid_header` (`workspace_id`,`message_id_header`),
  KEY `idx_messages_ws_direction_created` (`workspace_id`,`direction`,`created_at`),
  KEY `idx_messages_conv_listing` (`conversation_id`,`created_at`),
  KEY `idx_messages_conv_latest` (`conversation_id`,`id`),
  KEY `idx_messages_schedule` (`schedule_status`,`scheduled_at`),
  KEY `messages_ws_created_idx` (`workspace_id`,`created_at`),
  KEY `messages_ws_ai_status_created_index` (`workspace_id`,`ai_status`,`created_at`),
  FULLTEXT KEY `messages_body_text_fulltext` (`body_text`),
  CONSTRAINT `messages_conversation_id_foreign` FOREIGN KEY (`conversation_id`) REFERENCES `conversations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `messages_sender_id_foreign` FOREIGN KEY (`sender_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `messages_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `migrations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=74 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `migrations` VALUES ('1', '0001_01_01_000001_create_core_tables', '1');
INSERT INTO `migrations` VALUES ('2', '0001_01_01_000002_create_users_table', '1');
INSERT INTO `migrations` VALUES ('3', '0001_01_01_000003_create_workspaces_table', '1');
INSERT INTO `migrations` VALUES ('4', '0001_01_01_000004_create_plans_and_subscriptions_table', '1');
INSERT INTO `migrations` VALUES ('5', '0001_01_01_000005_create_email_accounts_table', '1');
INSERT INTO `migrations` VALUES ('6', '0001_01_01_000006_create_contacts_and_crm_tables', '1');
INSERT INTO `migrations` VALUES ('7', '0001_01_01_000007_create_conversations_and_messages_tables', '1');
INSERT INTO `migrations` VALUES ('8', '0001_01_01_000008_create_ai_and_knowledge_base_tables', '1');
INSERT INTO `migrations` VALUES ('9', '0001_01_01_000009_create_campaigns_and_workflows_tables', '1');
INSERT INTO `migrations` VALUES ('10', '0001_01_01_000010_create_channels_and_admin_tables', '1');
INSERT INTO `migrations` VALUES ('11', '2026_03_16_084512_create_personal_access_tokens_table', '1');
INSERT INTO `migrations` VALUES ('12', '2026_03_16_150000_add_uuid_to_campaign_recipients', '1');
INSERT INTO `migrations` VALUES ('13', '2026_03_16_200000_create_payment_gateways_table', '1');
INSERT INTO `migrations` VALUES ('14', '2026_03_16_200001_add_gateway_fields_to_payments_table', '1');
INSERT INTO `migrations` VALUES ('15', '2026_03_17_000001_add_admin_fields_to_users_table', '1');
INSERT INTO `migrations` VALUES ('16', '2026_03_17_000002_add_performance_indexes', '1');
INSERT INTO `migrations` VALUES ('17', '2026_03_17_100000_add_critical_unique_constraints', '1');
INSERT INTO `migrations` VALUES ('18', '2026_03_17_300000_add_security_enhancements', '1');
INSERT INTO `migrations` VALUES ('19', '2026_03_17_400000_add_status_to_invites_and_email_to_campaign_recipients', '1');
INSERT INTO `migrations` VALUES ('20', '2026_03_18_000001_add_inbox_performance_indexes', '1');
INSERT INTO `migrations` VALUES ('21', '2026_03_18_000002_add_contact_email_unique_constraint', '1');
INSERT INTO `migrations` VALUES ('22', '2026_03_18_100000_add_retry_count_to_drip_enrollments', '1');
INSERT INTO `migrations` VALUES ('23', '2026_03_18_200000_add_campaign_audience_indexes', '1');
INSERT INTO `migrations` VALUES ('24', '2026_03_18_200001_add_two_factor_attempts_and_impersonation', '1');
INSERT INTO `migrations` VALUES ('25', '2026_03_18_300000_create_email_templates_table', '1');
INSERT INTO `migrations` VALUES ('26', '2026_03_18_400000_expand_channel_integrations_for_third_party', '1');
INSERT INTO `migrations` VALUES ('27', '2026_03_20_000001_add_performance_optimization_indexes', '1');
INSERT INTO `migrations` VALUES ('28', '2026_03_20_000002_create_auto_reply_rules_table', '1');
INSERT INTO `migrations` VALUES ('29', '2026_03_20_100001_add_two_factor_confirmed_at_to_users_table', '1');
INSERT INTO `migrations` VALUES ('30', '2026_03_20_200000_create_blocked_ips_table', '1');
INSERT INTO `migrations` VALUES ('31', '2026_03_20_300000_add_inbox_performance_indexes', '1');
INSERT INTO `migrations` VALUES ('32', '2026_03_21_000001_add_missing_audit_indexes', '1');
INSERT INTO `migrations` VALUES ('33', '2026_03_21_000002_create_help_articles_table', '1');
INSERT INTO `migrations` VALUES ('34', '2026_03_21_100001_add_email_scheduling_fields', '1');
INSERT INTO `migrations` VALUES ('35', '2026_03_21_100002_add_scope_to_canned_responses_table', '1');
INSERT INTO `migrations` VALUES ('36', '2026_03_22_000001_add_performance_indexes', '1');
INSERT INTO `migrations` VALUES ('37', '2026_03_22_000002_create_webhook_logs_table', '1');
INSERT INTO `migrations` VALUES ('38', '2026_03_22_073102_create_activity_log_table', '1');
INSERT INTO `migrations` VALUES ('39', '2026_03_22_073103_add_event_column_to_activity_log_table', '1');
INSERT INTO `migrations` VALUES ('40', '2026_03_22_073104_add_batch_uuid_column_to_activity_log_table', '1');
INSERT INTO `migrations` VALUES ('41', '2026_03_24_000001_add_nuclear_audit_performance_indexes', '1');
INSERT INTO `migrations` VALUES ('42', '2026_03_24_000002_add_ai_spending_cap', '1');
INSERT INTO `migrations` VALUES ('43', '2026_03_24_000003_add_conversation_snooze', '1');
INSERT INTO `migrations` VALUES ('44', '2026_03_24_090611_add_notification_preferences_to_users_table', '1');
INSERT INTO `migrations` VALUES ('45', '2026_03_27_000001_nuclear_audit_fixes', '1');
INSERT INTO `migrations` VALUES ('46', '2026_03_27_000002_add_metadata_to_payments_table', '1');
INSERT INTO `migrations` VALUES ('47', '2026_03_31_000001_add_unique_constraint_and_soft_deletes', '1');
INSERT INTO `migrations` VALUES ('48', '2026_03_31_000001_create_permission_tables', '1');
INSERT INTO `migrations` VALUES ('49', '2026_03_31_000002_create_security_audit_logs_table', '1');
INSERT INTO `migrations` VALUES ('50', '2026_03_31_000003_create_blocked_locations_table', '1');
INSERT INTO `migrations` VALUES ('51', '2026_03_31_000004_add_exit_reason_to_drip_enrollments', '1');
INSERT INTO `migrations` VALUES ('52', '2026_03_31_000005_add_content_hash_to_kb_documents', '1');
INSERT INTO `migrations` VALUES ('53', '2026_03_31_100001_add_category_to_payment_gateways', '1');
INSERT INTO `migrations` VALUES ('54', '2026_03_31_100002_create_languages_table', '1');
INSERT INTO `migrations` VALUES ('55', '2026_03_31_100003_create_currencies_table', '1');
INSERT INTO `migrations` VALUES ('56', '2026_03_31_100004_add_locale_fields_to_users', '1');
INSERT INTO `migrations` VALUES ('57', '2026_04_01_000001_create_temp_mail_tables', '1');
INSERT INTO `migrations` VALUES ('58', '2026_04_01_100001_add_coupon_fields_to_payments', '1');
INSERT INTO `migrations` VALUES ('59', '2026_04_02_000001_change_pages_type_to_varchar', '1');
INSERT INTO `migrations` VALUES ('60', '2026_04_02_000002_create_testimonials_table', '1');
INSERT INTO `migrations` VALUES ('61', '2026_04_02_155304_add_soft_deletes_to_deal_stages_table', '1');
INSERT INTO `migrations` VALUES ('62', '2026_04_03_000001_create_workspace_invites_table', '1');
INSERT INTO `migrations` VALUES ('63', '2026_04_05_000001_change_body_columns_to_mediumtext', '1');
INSERT INTO `migrations` VALUES ('64', '2026_04_17_000001_add_audience_meta_to_campaigns', '1');
INSERT INTO `migrations` VALUES ('65', '2026_04_18_000001_add_throttle_columns_to_campaigns', '1');
INSERT INTO `migrations` VALUES ('66', '2026_04_18_000002_add_processing_to_campaign_recipients_status', '1');
INSERT INTO `migrations` VALUES ('67', '2026_04_27_100000_add_stripe_compatible_fields_to_coupons', '1');
INSERT INTO `migrations` VALUES ('68', '2026_04_27_110000_make_ticket_user_id_nullable', '1');
INSERT INTO `migrations` VALUES ('69', '2026_04_30_120000_add_ai_escalation_to_ai_configs', '1');
INSERT INTO `migrations` VALUES ('70', '2026_04_30_140000_add_sms_support_to_campaigns', '1');
INSERT INTO `migrations` VALUES ('71', '2026_04_30_150000_create_ai_channel_configs_table', '1');
INSERT INTO `migrations` VALUES ('72', '2026_04_30_160000_add_premium_feature_flags_to_plans', '1');
INSERT INTO `migrations` VALUES ('73', '2026_05_05_120000_migrate_legacy_ai_config_keys', '1');

CREATE TABLE `model_has_permissions` (
  `permission_id` bigint(20) unsigned NOT NULL,
  `model_type` varchar(255) NOT NULL,
  `model_id` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`),
  CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `model_has_roles` (
  `role_id` bigint(20) unsigned NOT NULL,
  `model_type` varchar(255) NOT NULL,
  `model_id` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`),
  CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `model_has_roles` VALUES ('1', 'App\\Models\\User', '1');
INSERT INTO `model_has_roles` VALUES ('5', 'App\\Models\\User', '2');

CREATE TABLE `notifications` (
  `id` char(36) NOT NULL,
  `type` varchar(255) NOT NULL,
  `notifiable_type` varchar(255) NOT NULL,
  `notifiable_id` bigint(20) unsigned NOT NULL,
  `data` text NOT NULL,
  `read_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `notifications_notifiable_type_notifiable_id_index` (`notifiable_type`,`notifiable_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `pages` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `content` longtext DEFAULT NULL,
  `sections` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`sections`)),
  `meta_title` varchar(255) DEFAULT NULL,
  `meta_description` text DEFAULT NULL,
  `meta_image` varchar(255) DEFAULT NULL,
  `is_published` tinyint(1) NOT NULL DEFAULT 0,
  `type` varchar(50) NOT NULL DEFAULT 'static',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `pages_slug_unique` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `pages` VALUES ('1', 'Footer', 'footer', '{\"description\":\"AI-powered email automation, CRM, and multi-channel communication platform for modern teams.\",\"twitter_url\":\"\",\"github_url\":\"\",\"linkedin_url\":\"\",\"facebook_url\":\"\",\"instagram_url\":\"\",\"newsletter_enabled\":\"true\",\"newsletter_title\":\"Stay Updated\",\"newsletter_subtitle\":\"Get the latest updates on features, tips, and product news.\",\"copyright\":\"\\u00a9 2026 Email | Govaio. All rights reserved.\"}', NULL, NULL, NULL, NULL, '1', 'footer', '2026-07-26 09:00:12', '2026-07-26 09:00:12');
INSERT INTO `pages` VALUES ('2', 'About Us', 'about', '{\"title\":\"About\",\"subtitle\":\"We\'re building the future of business communication \\u2014 one AI-powered reply at a time.\",\"story\":\"Email | Govaio was born from a simple frustration: businesses spend too much time managing scattered inboxes across email, WhatsApp, Slack, and SMS. We built a unified platform that brings every conversation into one place, with AI that actually understands your business and drafts replies in your voice.\",\"mission\":\"Our mission is to help every team \\u2014 from solo founders to enterprise organizations \\u2014 communicate faster, smarter, and more personally at scale. We believe AI should amplify human connection, not replace it.\",\"stats\":[{\"value\":\"10K+\",\"label\":\"Active Teams\"},{\"value\":\"50M+\",\"label\":\"Emails Processed\"},{\"value\":\"99.9%\",\"label\":\"Uptime\"},{\"value\":\"24\\/7\",\"label\":\"AI Support\"}]}', NULL, NULL, NULL, NULL, '1', 'about', '2026-07-26 09:00:12', '2026-07-26 09:00:12');
INSERT INTO `pages` VALUES ('3', 'Why Us', 'why-us', '{\"title\":\"Why Choose\",\"subtitle\":\"Here\'s what sets us apart from every other email tool on the market.\",\"reasons\":[{\"title\":\"Self-Hosted & Secure\",\"desc\":\"Your data stays on your server. No third-party cloud dependency. Full control over your communication data.\"},{\"title\":\"AI That Learns Your Voice\",\"desc\":\"Train the AI on your knowledge base, past replies, and FAQs. It drafts responses that sound like you, not a robot.\"},{\"title\":\"Truly Unified Inbox\",\"desc\":\"Email, WhatsApp, SMS, Slack, Telegram, and live chat \\u2014 all in one view with smart routing and assignment.\"},{\"title\":\"No Recurring SaaS Fees\",\"desc\":\"One-time purchase. Host on your own server. No monthly charges eating into your margins.\"},{\"title\":\"Built for Teams\",\"desc\":\"Workspaces, role-based access, team assignment, collision detection, and shared templates out of the box.\"},{\"title\":\"Developer Friendly\",\"desc\":\"REST API, webhooks, Zapier integration, and clean documentation. Build custom workflows on top of the platform.\"}]}', NULL, NULL, NULL, NULL, '1', 'why_us', '2026-07-26 09:00:12', '2026-07-26 09:00:12');
INSERT INTO `pages` VALUES ('4', 'Hero Section', 'landing-hero', '{\"badge\":\"Now with GPT-4o & Claude 4 Support\",\"title_line1\":\"Achieve flawless email delivery\",\"title_highlight\":\"AI-powered\",\"title_line2\":\"automation.\",\"subtitle\":\"Optimize email performance, manage multi-channel conversations, and scale your business communication with AI that actually knows your business.\",\"cta_text\":\"Get Started Free\",\"cta_url\":\"\\/register\",\"cta2_text\":\"See Features\",\"cta2_url\":\"#features\"}', NULL, NULL, NULL, NULL, '1', 'hero', '2026-07-26 09:00:12', '2026-07-26 09:00:12');
INSERT INTO `pages` VALUES ('5', 'Features Section', 'landing-features', '{\"badge\":\"Features\",\"title\":\"Everything you need in one platform\",\"subtitle\":\"Powerful tools for email, CRM, automation, and multi-channel communication.\",\"items\":[{\"title\":\"Unified Inbox\",\"desc\":\"Email, WhatsApp, SMS, Slack, and Telegram \\u2014 all in one inbox.\"},{\"title\":\"AI-Powered Replies\",\"desc\":\"Context-aware AI drafts replies using your knowledge base.\"},{\"title\":\"Email Campaigns\",\"desc\":\"Drag-and-drop editor, A\\/B testing, drip sequences.\"},{\"title\":\"CRM & Deals\",\"desc\":\"Track contacts, manage deal pipelines, score leads.\"},{\"title\":\"Workflow Automation\",\"desc\":\"Visual no-code builder with triggers and conditions.\"},{\"title\":\"Analytics Dashboard\",\"desc\":\"Track open rates, clicks, bounces across all channels.\"}]}', NULL, NULL, NULL, NULL, '1', 'features', '2026-07-26 09:00:12', '2026-07-26 09:00:12');
INSERT INTO `pages` VALUES ('6', 'Testimonials', 'landing-testimonials', '{\"title\":\"Loved by teams\"}', NULL, NULL, NULL, NULL, '1', 'testimonials', '2026-07-26 09:00:12', '2026-07-26 09:00:12');
INSERT INTO `pages` VALUES ('7', 'FAQ Section', 'landing-faq', '{\"title\":\"Frequently Asked Questions\",\"items\":[{\"question\":\"Is Email | Govaio truly self-hosted?\",\"answer\":\"Yes. Install on your own server. Your data never leaves your infrastructure.\"},{\"question\":\"What AI providers are supported?\",\"answer\":\"OpenAI (GPT-4o), Anthropic (Claude), Google (Gemini), and Mistral. Bring your own API key.\"},{\"question\":\"Can I connect multiple email accounts?\",\"answer\":\"Yes \\u2014 unlimited Gmail, Outlook, and custom IMAP\\/SMTP accounts.\"},{\"question\":\"Is there a free plan?\",\"answer\":\"Yes. Free plan includes basic inbox, limited contacts, and essential features.\"},{\"question\":\"How does the one-time payment work?\",\"answer\":\"Pay once for the license and host on your server. No recurring SaaS fees.\"}]}', NULL, NULL, NULL, NULL, '1', 'faq', '2026-07-26 09:00:12', '2026-07-26 09:00:12');
INSERT INTO `pages` VALUES ('8', 'CTA Section', 'landing-cta', '{\"badge\":\"2,000+ teams already onboard\",\"title\":\"Your inbox is waiting to get smarter.\",\"subtitle\":\"Stop drowning in emails. Let AI handle the replies, automate the workflows, and grow your revenue on autopilot.\",\"cta_text\":\"Start Free \\u2014 No Credit Card\",\"cta_url\":\"\\/register\",\"note\":\"No credit card required. Setup in minutes.\"}', NULL, NULL, NULL, NULL, '1', 'cta', '2026-07-26 09:00:12', '2026-07-26 09:00:12');
INSERT INTO `pages` VALUES ('9', 'Terms of Service', 'terms', '{\"last_updated\":\"January 1, 2026\",\"sections\":[{\"title\":\"Acceptance of Terms\",\"content\":\"By accessing or using Email | Govaio, you agree to be bound by these Terms of Service.\"},{\"title\":\"User Accounts\",\"content\":\"You must create an account with accurate information. You are responsible for all activities under your account.\"},{\"title\":\"Subscriptions & Billing\",\"content\":\"Paid features require a subscription billed monthly or annually via Stripe. We may change pricing with 30 days notice.\"},{\"title\":\"Data Processing\",\"content\":\"The Service processes email and communication data you connect. AI features may send data to third-party providers solely to generate responses.\"},{\"title\":\"Acceptable Use\",\"content\":\"You agree not to send spam, upload unlawful content, attempt unauthorized access, reverse engineer the Service, or exceed usage limits.\"},{\"title\":\"Intellectual Property\",\"content\":\"The Service is the property of Email | Govaio. You retain ownership of your content. AI-generated content becomes yours once accepted.\"},{\"title\":\"Limitation of Liability\",\"content\":\"The Service is provided \\\"as is\\\". Total liability is limited to amounts paid in the preceding 12 months.\"},{\"title\":\"Termination\",\"content\":\"You may terminate anytime. Data is retained 30 days after termination, then permanently deleted.\"},{\"title\":\"Changes to Terms\",\"content\":\"We may update these Terms with at least 14 days notice. Continued use constitutes acceptance.\"},{\"title\":\"Governing Law\",\"content\":\"These Terms are governed by the laws of the jurisdiction where the Company is incorporated.\"}]}', NULL, NULL, NULL, NULL, '1', 'terms', '2026-07-26 09:00:12', '2026-07-26 09:00:12');
INSERT INTO `pages` VALUES ('10', 'Privacy Policy', 'privacy', '{\"last_updated\":\"January 1, 2026\",\"subtitle\":\"How Email | Govaio protects your data.\",\"sections\":[{\"title\":\"Information We Collect\",\"content\":\"We collect information you provide: name, email, billing info, and communication content.\"},{\"title\":\"How We Use Your Information\",\"content\":\"We use your data to provide the Service, process payments, and improve your experience.\"},{\"title\":\"AI Data Processing\",\"content\":\"AI features may send data to third-party providers. Your data is not used to train shared AI models.\"},{\"title\":\"Data Sharing\",\"content\":\"We do not sell your data. We share only with payment processors and AI providers.\"},{\"title\":\"Data Security\",\"content\":\"We use encryption at rest and in transit, secure authentication, and regular security audits.\"},{\"title\":\"Your Rights (GDPR)\",\"content\":\"EU\\/EEA users have rights to access, rectify, delete, restrict, port, and object.\"},{\"title\":\"Data Retention\",\"content\":\"Data is retained while your account is active. Removed within 30 days after deletion.\"},{\"title\":\"Cookies\",\"content\":\"We use essential cookies for authentication and analytics cookies for usage insights.\"}],\"bottom_text\":\"For privacy inquiries, contact us through our Contact page.\"}', NULL, NULL, NULL, NULL, '1', 'privacy', '2026-07-26 09:00:12', '2026-07-26 09:00:12');
INSERT INTO `pages` VALUES ('11', 'Refund Policy', 'refund-policy', '{\"last_updated\":\"January 1, 2026\",\"sections\":[{\"title\":\"Satisfaction Guarantee\",\"content\":\"14-day money-back guarantee on all new paid subscriptions.\"},{\"title\":\"Eligibility\",\"content\":\"Refunds available within 14 days of initial subscription, for first-time subscriptions only.\"},{\"title\":\"Non-Refundable Items\",\"content\":\"Renewals, add-ons, terminated accounts, and partial unused time are not refundable.\"},{\"title\":\"How to Request\",\"content\":\"Contact support with your account email. Processed within 5-10 business days.\"},{\"title\":\"Cancellation\",\"content\":\"Cancel anytime from account settings. Keep access until end of billing period.\"}]}', NULL, NULL, NULL, NULL, '1', 'refund', '2026-07-26 09:00:12', '2026-07-26 09:00:12');
INSERT INTO `pages` VALUES ('12', 'Contact Us', 'contact', '{\"subtitle\":\"Have a question? We\'d love to hear from you.\",\"support_email_label\":\"Email Support\",\"response_time\":\"24-48 hours\",\"support_channels\":\"Email support, in-app help center, and priority support for paid plans.\"}', NULL, NULL, NULL, NULL, '1', 'contact', '2026-07-26 09:00:12', '2026-07-26 09:00:12');

CREATE TABLE `password_histories` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `password` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `password_histories_user_id_foreign` (`user_id`),
  CONSTRAINT `password_histories_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `password_reset_tokens` (
  `email` varchar(255) NOT NULL,
  `token` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `payments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `subscription_id` bigint(20) unsigned DEFAULT NULL,
  `stripe_payment_id` varchar(255) DEFAULT NULL,
  `stripe_invoice_id` varchar(255) DEFAULT NULL,
  `amount` decimal(10,2) NOT NULL,
  `currency` varchar(3) NOT NULL DEFAULT 'usd',
  `status` enum('succeeded','failed','pending','refunded','partially_refunded') NOT NULL DEFAULT 'pending',
  `gateway_transaction_id` varchar(255) DEFAULT NULL,
  `gateway_slug` varchar(255) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `coupon_code` varchar(255) DEFAULT NULL,
  `discount_amount` decimal(10,2) DEFAULT NULL,
  `original_amount` decimal(10,2) DEFAULT NULL,
  `failure_reason` varchar(255) DEFAULT NULL,
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),
  `refund_amount` decimal(10,2) DEFAULT NULL,
  `refunded_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `payments_stripe_invoice_id_unique` (`stripe_invoice_id`),
  KEY `payments_subscription_id_foreign` (`subscription_id`),
  KEY `payments_workspace_id_status_index` (`workspace_id`,`status`),
  CONSTRAINT `payments_subscription_id_foreign` FOREIGN KEY (`subscription_id`) REFERENCES `subscriptions` (`id`) ON DELETE SET NULL,
  CONSTRAINT `payments_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `permissions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `guard_name` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `permissions_name_guard_name_unique` (`name`,`guard_name`)
) ENGINE=InnoDB AUTO_INCREMENT=77 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `permissions` VALUES ('1', 'users.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('2', 'users.create', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('3', 'users.update', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('4', 'users.delete', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('5', 'users.export', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('6', 'users.import', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('7', 'roles.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('8', 'roles.create', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('9', 'roles.update', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('10', 'roles.delete', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('11', 'roles.export', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('12', 'roles.import', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('13', 'permissions.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('14', 'permissions.create', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('15', 'permissions.update', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('16', 'permissions.delete', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('17', 'permissions.export', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('18', 'permissions.import', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('19', 'plans.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('20', 'plans.create', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('21', 'plans.update', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('22', 'plans.delete', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('23', 'plans.export', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('24', 'plans.import', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('25', 'payments.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('26', 'payments.export', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('27', 'payments.import', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('28', 'payments.refund', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('29', 'coupons.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('30', 'coupons.create', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('31', 'coupons.update', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('32', 'coupons.delete', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('33', 'coupons.export', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('34', 'coupons.import', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('35', 'tickets.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('36', 'tickets.create', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('37', 'tickets.update', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('38', 'tickets.delete', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('39', 'tickets.export', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('40', 'tickets.import', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('41', 'audit-logs.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('42', 'audit-logs.export', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('43', 'security-audit-logs.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('44', 'security-audit-logs.create', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('45', 'security-audit-logs.delete', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('46', 'security-audit-logs.export', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('47', 'blocked-ips.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('48', 'blocked-ips.create', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('49', 'blocked-ips.delete', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('50', 'blocked-ips.export', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('51', 'blocked-ips.import', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('52', 'blocked-locations.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('53', 'blocked-locations.create', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('54', 'blocked-locations.update', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('55', 'blocked-locations.delete', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('56', 'blocked-locations.export', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('57', 'blocked-locations.import', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('58', 'settings.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('59', 'settings.update', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('60', 'security-settings.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('61', 'security-settings.update', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('62', 'system-settings.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('63', 'system-settings.update', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('64', 'payment-gateways.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('65', 'payment-gateways.update', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('66', 'ai-providers.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('67', 'ai-providers.update', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('68', 'ai-usage.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('69', 'ai-usage.export', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('70', 'email-deliverability.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('71', 'cms.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('72', 'cms.update', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('73', 'notifications.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('74', 'system.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('75', 'frontend-settings.view', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `permissions` VALUES ('76', 'frontend-settings.update', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');

CREATE TABLE `personal_access_tokens` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tokenable_type` varchar(255) NOT NULL,
  `tokenable_id` bigint(20) unsigned NOT NULL,
  `name` text NOT NULL,
  `token` varchar(64) NOT NULL,
  `abilities` text DEFAULT NULL,
  `last_used_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
  KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`),
  KEY `personal_access_tokens_expires_at_index` (`expires_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `pipelines` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pipelines_workspace_id_foreign` (`workspace_id`),
  CONSTRAINT `pipelines_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `plan_features` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `plan_id` bigint(20) unsigned NOT NULL,
  `feature_key` varchar(255) NOT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 1,
  `limit` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `plan_features_plan_id_feature_key_unique` (`plan_id`,`feature_key`),
  CONSTRAINT `plan_features_plan_id_foreign` FOREIGN KEY (`plan_id`) REFERENCES `plans` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=161 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `plan_features` VALUES ('129', '5', 'email_accounts', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('130', '5', 'ai_replies', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('131', '5', 'contacts', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('132', '5', 'team_members', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('133', '5', 'storage_mb', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('134', '5', 'campaigns_per_month', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('135', '5', 'workflows', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('136', '5', 'kb_documents', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('137', '5', 'kb_file_size_mb', '1', '0', '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('138', '5', 'temp_mail_addresses', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('139', '5', 'temp_mail_lifetime_hours', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('140', '5', 'knowledge_base', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('141', '5', 'campaigns', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('142', '5', 'deal_pipeline', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('143', '5', 'analytics', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('144', '5', 'whatsapp', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('145', '5', 'sms', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('146', '5', 'telegram', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('147', '5', 'slack', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('148', '5', 'live_chat', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('149', '5', 'api_access', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('150', '5', 'priority_support', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('151', '5', 'custom_roles', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('152', '5', 'white_label', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('153', '5', 'sso_saml', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('154', '5', 'temp_mail', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('155', '5', 'ai_own_key', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('156', '5', 'ai_per_channel', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('157', '5', 'ai_auto_escalation', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('158', '5', 'sms_campaigns', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('159', '5', 'email_templates', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');
INSERT INTO `plan_features` VALUES ('160', '5', 'workflow_in_app_notify', '1', NULL, '2026-07-26 09:02:00', '2026-07-26 09:02:00');

CREATE TABLE `plans` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `stripe_monthly_price_id` varchar(255) DEFAULT NULL,
  `stripe_yearly_price_id` varchar(255) DEFAULT NULL,
  `monthly_price` decimal(10,2) NOT NULL DEFAULT 0.00,
  `yearly_price` decimal(10,2) NOT NULL DEFAULT 0.00,
  `description` text DEFAULT NULL,
  `features` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`features`)),
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `is_popular` tinyint(1) NOT NULL DEFAULT 0,
  `sort_order` int(10) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `plans_slug_unique` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `plans` VALUES ('5', 'Unlimited', 'unlimited', NULL, NULL, '0.00', '1.00', NULL, '[]', '1', '0', '0', '2026-07-26 09:01:31', '2026-07-26 09:01:31');

CREATE TABLE `role_has_permissions` (
  `permission_id` bigint(20) unsigned NOT NULL,
  `role_id` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`permission_id`,`role_id`),
  KEY `role_has_permissions_role_id_foreign` (`role_id`),
  CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `role_has_permissions` VALUES ('1', '1');
INSERT INTO `role_has_permissions` VALUES ('2', '1');
INSERT INTO `role_has_permissions` VALUES ('3', '1');
INSERT INTO `role_has_permissions` VALUES ('4', '1');
INSERT INTO `role_has_permissions` VALUES ('5', '1');
INSERT INTO `role_has_permissions` VALUES ('6', '1');
INSERT INTO `role_has_permissions` VALUES ('7', '1');
INSERT INTO `role_has_permissions` VALUES ('8', '1');
INSERT INTO `role_has_permissions` VALUES ('9', '1');
INSERT INTO `role_has_permissions` VALUES ('10', '1');
INSERT INTO `role_has_permissions` VALUES ('11', '1');
INSERT INTO `role_has_permissions` VALUES ('12', '1');
INSERT INTO `role_has_permissions` VALUES ('13', '1');
INSERT INTO `role_has_permissions` VALUES ('14', '1');
INSERT INTO `role_has_permissions` VALUES ('15', '1');
INSERT INTO `role_has_permissions` VALUES ('16', '1');
INSERT INTO `role_has_permissions` VALUES ('17', '1');
INSERT INTO `role_has_permissions` VALUES ('18', '1');
INSERT INTO `role_has_permissions` VALUES ('19', '1');
INSERT INTO `role_has_permissions` VALUES ('20', '1');
INSERT INTO `role_has_permissions` VALUES ('21', '1');
INSERT INTO `role_has_permissions` VALUES ('22', '1');
INSERT INTO `role_has_permissions` VALUES ('23', '1');
INSERT INTO `role_has_permissions` VALUES ('24', '1');
INSERT INTO `role_has_permissions` VALUES ('25', '1');
INSERT INTO `role_has_permissions` VALUES ('26', '1');
INSERT INTO `role_has_permissions` VALUES ('27', '1');
INSERT INTO `role_has_permissions` VALUES ('28', '1');
INSERT INTO `role_has_permissions` VALUES ('29', '1');
INSERT INTO `role_has_permissions` VALUES ('30', '1');
INSERT INTO `role_has_permissions` VALUES ('31', '1');
INSERT INTO `role_has_permissions` VALUES ('32', '1');
INSERT INTO `role_has_permissions` VALUES ('33', '1');
INSERT INTO `role_has_permissions` VALUES ('34', '1');
INSERT INTO `role_has_permissions` VALUES ('35', '1');
INSERT INTO `role_has_permissions` VALUES ('36', '1');
INSERT INTO `role_has_permissions` VALUES ('37', '1');
INSERT INTO `role_has_permissions` VALUES ('38', '1');
INSERT INTO `role_has_permissions` VALUES ('39', '1');
INSERT INTO `role_has_permissions` VALUES ('40', '1');
INSERT INTO `role_has_permissions` VALUES ('41', '1');
INSERT INTO `role_has_permissions` VALUES ('42', '1');
INSERT INTO `role_has_permissions` VALUES ('43', '1');
INSERT INTO `role_has_permissions` VALUES ('44', '1');
INSERT INTO `role_has_permissions` VALUES ('45', '1');
INSERT INTO `role_has_permissions` VALUES ('46', '1');
INSERT INTO `role_has_permissions` VALUES ('47', '1');
INSERT INTO `role_has_permissions` VALUES ('48', '1');
INSERT INTO `role_has_permissions` VALUES ('49', '1');
INSERT INTO `role_has_permissions` VALUES ('50', '1');
INSERT INTO `role_has_permissions` VALUES ('51', '1');
INSERT INTO `role_has_permissions` VALUES ('52', '1');
INSERT INTO `role_has_permissions` VALUES ('53', '1');
INSERT INTO `role_has_permissions` VALUES ('54', '1');
INSERT INTO `role_has_permissions` VALUES ('55', '1');
INSERT INTO `role_has_permissions` VALUES ('56', '1');
INSERT INTO `role_has_permissions` VALUES ('57', '1');
INSERT INTO `role_has_permissions` VALUES ('58', '1');
INSERT INTO `role_has_permissions` VALUES ('59', '1');
INSERT INTO `role_has_permissions` VALUES ('60', '1');
INSERT INTO `role_has_permissions` VALUES ('61', '1');
INSERT INTO `role_has_permissions` VALUES ('62', '1');
INSERT INTO `role_has_permissions` VALUES ('63', '1');
INSERT INTO `role_has_permissions` VALUES ('64', '1');
INSERT INTO `role_has_permissions` VALUES ('65', '1');
INSERT INTO `role_has_permissions` VALUES ('66', '1');
INSERT INTO `role_has_permissions` VALUES ('67', '1');
INSERT INTO `role_has_permissions` VALUES ('68', '1');
INSERT INTO `role_has_permissions` VALUES ('69', '1');
INSERT INTO `role_has_permissions` VALUES ('70', '1');
INSERT INTO `role_has_permissions` VALUES ('71', '1');
INSERT INTO `role_has_permissions` VALUES ('72', '1');
INSERT INTO `role_has_permissions` VALUES ('73', '1');
INSERT INTO `role_has_permissions` VALUES ('74', '1');
INSERT INTO `role_has_permissions` VALUES ('75', '1');
INSERT INTO `role_has_permissions` VALUES ('76', '1');
INSERT INTO `role_has_permissions` VALUES ('1', '2');
INSERT INTO `role_has_permissions` VALUES ('2', '2');
INSERT INTO `role_has_permissions` VALUES ('3', '2');
INSERT INTO `role_has_permissions` VALUES ('4', '2');
INSERT INTO `role_has_permissions` VALUES ('5', '2');
INSERT INTO `role_has_permissions` VALUES ('6', '2');
INSERT INTO `role_has_permissions` VALUES ('7', '2');
INSERT INTO `role_has_permissions` VALUES ('11', '2');
INSERT INTO `role_has_permissions` VALUES ('12', '2');
INSERT INTO `role_has_permissions` VALUES ('13', '2');
INSERT INTO `role_has_permissions` VALUES ('17', '2');
INSERT INTO `role_has_permissions` VALUES ('18', '2');
INSERT INTO `role_has_permissions` VALUES ('19', '2');
INSERT INTO `role_has_permissions` VALUES ('20', '2');
INSERT INTO `role_has_permissions` VALUES ('21', '2');
INSERT INTO `role_has_permissions` VALUES ('22', '2');
INSERT INTO `role_has_permissions` VALUES ('23', '2');
INSERT INTO `role_has_permissions` VALUES ('24', '2');
INSERT INTO `role_has_permissions` VALUES ('25', '2');
INSERT INTO `role_has_permissions` VALUES ('26', '2');
INSERT INTO `role_has_permissions` VALUES ('27', '2');
INSERT INTO `role_has_permissions` VALUES ('28', '2');
INSERT INTO `role_has_permissions` VALUES ('29', '2');
INSERT INTO `role_has_permissions` VALUES ('30', '2');
INSERT INTO `role_has_permissions` VALUES ('31', '2');
INSERT INTO `role_has_permissions` VALUES ('32', '2');
INSERT INTO `role_has_permissions` VALUES ('33', '2');
INSERT INTO `role_has_permissions` VALUES ('34', '2');
INSERT INTO `role_has_permissions` VALUES ('35', '2');
INSERT INTO `role_has_permissions` VALUES ('36', '2');
INSERT INTO `role_has_permissions` VALUES ('37', '2');
INSERT INTO `role_has_permissions` VALUES ('38', '2');
INSERT INTO `role_has_permissions` VALUES ('39', '2');
INSERT INTO `role_has_permissions` VALUES ('40', '2');
INSERT INTO `role_has_permissions` VALUES ('41', '2');
INSERT INTO `role_has_permissions` VALUES ('42', '2');
INSERT INTO `role_has_permissions` VALUES ('43', '2');
INSERT INTO `role_has_permissions` VALUES ('44', '2');
INSERT INTO `role_has_permissions` VALUES ('45', '2');
INSERT INTO `role_has_permissions` VALUES ('46', '2');
INSERT INTO `role_has_permissions` VALUES ('47', '2');
INSERT INTO `role_has_permissions` VALUES ('48', '2');
INSERT INTO `role_has_permissions` VALUES ('49', '2');
INSERT INTO `role_has_permissions` VALUES ('50', '2');
INSERT INTO `role_has_permissions` VALUES ('51', '2');
INSERT INTO `role_has_permissions` VALUES ('52', '2');
INSERT INTO `role_has_permissions` VALUES ('53', '2');
INSERT INTO `role_has_permissions` VALUES ('54', '2');
INSERT INTO `role_has_permissions` VALUES ('55', '2');
INSERT INTO `role_has_permissions` VALUES ('56', '2');
INSERT INTO `role_has_permissions` VALUES ('57', '2');
INSERT INTO `role_has_permissions` VALUES ('58', '2');
INSERT INTO `role_has_permissions` VALUES ('59', '2');
INSERT INTO `role_has_permissions` VALUES ('60', '2');
INSERT INTO `role_has_permissions` VALUES ('62', '2');
INSERT INTO `role_has_permissions` VALUES ('64', '2');
INSERT INTO `role_has_permissions` VALUES ('65', '2');
INSERT INTO `role_has_permissions` VALUES ('66', '2');
INSERT INTO `role_has_permissions` VALUES ('67', '2');
INSERT INTO `role_has_permissions` VALUES ('68', '2');
INSERT INTO `role_has_permissions` VALUES ('69', '2');
INSERT INTO `role_has_permissions` VALUES ('70', '2');
INSERT INTO `role_has_permissions` VALUES ('71', '2');
INSERT INTO `role_has_permissions` VALUES ('72', '2');
INSERT INTO `role_has_permissions` VALUES ('73', '2');
INSERT INTO `role_has_permissions` VALUES ('75', '2');
INSERT INTO `role_has_permissions` VALUES ('76', '2');
INSERT INTO `role_has_permissions` VALUES ('1', '3');
INSERT INTO `role_has_permissions` VALUES ('19', '3');
INSERT INTO `role_has_permissions` VALUES ('25', '3');
INSERT INTO `role_has_permissions` VALUES ('35', '3');
INSERT INTO `role_has_permissions` VALUES ('36', '3');
INSERT INTO `role_has_permissions` VALUES ('37', '3');
INSERT INTO `role_has_permissions` VALUES ('41', '3');
INSERT INTO `role_has_permissions` VALUES ('68', '3');
INSERT INTO `role_has_permissions` VALUES ('73', '3');
INSERT INTO `role_has_permissions` VALUES ('1', '4');
INSERT INTO `role_has_permissions` VALUES ('35', '4');
INSERT INTO `role_has_permissions` VALUES ('36', '4');
INSERT INTO `role_has_permissions` VALUES ('37', '4');
INSERT INTO `role_has_permissions` VALUES ('73', '4');

CREATE TABLE `roles` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `guard_name` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `roles_name_guard_name_unique` (`name`,`guard_name`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `roles` VALUES ('1', 'Super Admin', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `roles` VALUES ('2', 'Admin', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `roles` VALUES ('3', 'Moderator', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `roles` VALUES ('4', 'Support', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');
INSERT INTO `roles` VALUES ('5', 'User', 'web', '2026-07-26 09:00:11', '2026-07-26 09:00:11');

CREATE TABLE `security_audit_logs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `event_type` varchar(50) NOT NULL,
  `status` varchar(20) NOT NULL,
  `ip_address` varchar(64) NOT NULL,
  `user_agent` text DEFAULT NULL,
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),
  `logged_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `security_audit_logs_user_id_foreign` (`user_id`),
  KEY `security_audit_logs_event_type_index` (`event_type`),
  KEY `security_audit_logs_status_index` (`status`),
  CONSTRAINT `security_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;


CREATE TABLE `segments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `rules` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`rules`)),
  `is_dynamic` tinyint(1) NOT NULL DEFAULT 1,
  `contacts_count` int(10) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `segments_workspace_id_foreign` (`workspace_id`),
  CONSTRAINT `segments_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `payload` longtext NOT NULL,
  `last_activity` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `sessions` VALUES ('yd4jTx7fUCxaRonY1JN5kXJaXhN5lyCgLUHtuAnd', '2', '49.37.74.152', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiZjJGdlRqdGVMVVV4aWZOMjJMeUpPZk5lWjVTVTZLRTRIaHVlU2EwTSI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6NDQ6Imh0dHBzOi8vZW1haWwuZ292YWlvLmluL3B1YmxpYy9ub3RpZmljYXRpb25zIjtzOjU6InJvdXRlIjtzOjE5OiJub3RpZmljYXRpb25zLmluZGV4Ijt9czo1MDoibG9naW5fd2ViXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiO2k6Mjt9', '1785057085');
INSERT INTO `sessions` VALUES ('yJy3i9YfeKB8gTsLVyvB5aENZFetpJOYgnKEJtB6', '1', '49.37.74.152', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiaFJERkZkWmhsRmoxeDFCWnhQaERQY3RTYmlrV2tJWkdWT282d2p0eCI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6NDM6Imh0dHBzOi8vZW1haWwuZ292YWlvLmluL3B1YmxpYy9hZG1pbi91cGRhdGUiO3M6NToicm91dGUiO3M6MTg6ImFkbWluLnVwZGF0ZS5pbmRleCI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fXM6NTA6ImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjtpOjE7fQ==', '1785057076');

CREATE TABLE `social_accounts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `provider` varchar(20) NOT NULL,
  `provider_id` varchar(255) NOT NULL,
  `token` text DEFAULT NULL,
  `refresh_token` text DEFAULT NULL,
  `token_expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `social_accounts_provider_provider_id_unique` (`provider`,`provider_id`),
  KEY `social_accounts_user_id_provider_index` (`user_id`,`provider`),
  CONSTRAINT `social_accounts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `subscriptions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `plan_id` bigint(20) unsigned NOT NULL,
  `stripe_subscription_id` varchar(255) DEFAULT NULL,
  `stripe_customer_id` varchar(255) DEFAULT NULL,
  `status` enum('active','trialing','past_due','canceled','incomplete','paused') NOT NULL DEFAULT 'active',
  `billing_cycle` enum('monthly','yearly') NOT NULL DEFAULT 'monthly',
  `trial_ends_at` timestamp NULL DEFAULT NULL,
  `current_period_start` timestamp NULL DEFAULT NULL,
  `current_period_end` timestamp NULL DEFAULT NULL,
  `canceled_at` timestamp NULL DEFAULT NULL,
  `grace_period_ends_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 `subscriptions_stripe_subscription_id_unique` (`stripe_subscription_id`),
  KEY `subscriptions_plan_id_foreign` (`plan_id`),
  KEY `subscriptions_workspace_id_index` (`workspace_id`),
  KEY `subscriptions_status_index` (`status`),
  KEY `idx_sub_ws_status` (`workspace_id`,`status`),
  CONSTRAINT `subscriptions_plan_id_foreign` FOREIGN KEY (`plan_id`) REFERENCES `plans` (`id`),
  CONSTRAINT `subscriptions_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `system_settings` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `key` varchar(255) NOT NULL,
  `value` text DEFAULT NULL,
  `group` varchar(255) NOT NULL DEFAULT 'general',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `system_settings_key_unique` (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `tags` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `color` varchar(7) NOT NULL DEFAULT '#6B7280',
  `sort_order` int(10) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tags_workspace_id_name_unique` (`workspace_id`,`name`),
  CONSTRAINT `tags_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `temp_mail_addresses` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) NOT NULL,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `temp_mail_domain_id` bigint(20) unsigned NOT NULL,
  `local_part` varchar(64) NOT NULL,
  `full_address` varchar(320) NOT NULL,
  `label` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `messages_count` int(10) unsigned NOT NULL DEFAULT 0,
  `conversation_id` bigint(20) unsigned DEFAULT NULL,
  `expires_at` timestamp NOT NULL,
  `last_received_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 `temp_mail_addresses_temp_mail_domain_id_local_part_unique` (`temp_mail_domain_id`,`local_part`),
  UNIQUE KEY `temp_mail_addresses_uuid_unique` (`uuid`),
  UNIQUE KEY `temp_mail_addresses_full_address_unique` (`full_address`),
  KEY `temp_mail_addresses_user_id_foreign` (`user_id`),
  KEY `temp_mail_addresses_conversation_id_foreign` (`conversation_id`),
  KEY `temp_mail_addresses_workspace_id_is_active_index` (`workspace_id`,`is_active`),
  KEY `temp_mail_addresses_full_address_index` (`full_address`),
  KEY `temp_mail_addresses_expires_at_index` (`expires_at`),
  CONSTRAINT `temp_mail_addresses_conversation_id_foreign` FOREIGN KEY (`conversation_id`) REFERENCES `conversations` (`id`) ON DELETE SET NULL,
  CONSTRAINT `temp_mail_addresses_temp_mail_domain_id_foreign` FOREIGN KEY (`temp_mail_domain_id`) REFERENCES `temp_mail_domains` (`id`) ON DELETE CASCADE,
  CONSTRAINT `temp_mail_addresses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `temp_mail_addresses_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `temp_mail_domains` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) NOT NULL,
  `domain` varchar(255) NOT NULL,
  `display_name` varchar(255) NOT NULL,
  `imap_host` text DEFAULT NULL,
  `imap_port` smallint(5) unsigned NOT NULL DEFAULT 993,
  `imap_username` text DEFAULT NULL,
  `imap_password` text DEFAULT NULL,
  `imap_encryption` varchar(10) NOT NULL DEFAULT 'ssl',
  `status` enum('active','inactive','error') NOT NULL DEFAULT 'inactive',
  `error_message` varchar(500) DEFAULT NULL,
  `max_addresses` int(10) unsigned DEFAULT NULL,
  `default_lifetime_hours` int(10) unsigned NOT NULL DEFAULT 24,
  `blocked_patterns` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`blocked_patterns`)),
  `allowed_patterns` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`allowed_patterns`)),
  `last_synced_at` timestamp NULL DEFAULT NULL,
  `last_synced_uid` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `temp_mail_domains_uuid_unique` (`uuid`),
  UNIQUE KEY `temp_mail_domains_domain_unique` (`domain`),
  KEY `temp_mail_domains_status_index` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `testimonials` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `client_name` varchar(150) NOT NULL,
  `client_image` varchar(255) DEFAULT NULL,
  `client_position` varchar(150) DEFAULT NULL,
  `review` text NOT NULL,
  `rating` tinyint(3) unsigned NOT NULL DEFAULT 5,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `testimonials_created_by_foreign` (`created_by`),
  KEY `testimonials_is_active_rating_index` (`is_active`,`rating`),
  CONSTRAINT `testimonials_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `testimonials` VALUES ('1', 'Sarah Chen', NULL, 'Head of Customer Success, TechFlow', 'Email | Govaio cut our response time from hours to minutes. The AI suggestions are eerily accurate — it feels like having a senior support rep available 24/7.', '5', '1', NULL, '2026-07-26 09:00:12', '2026-07-26 09:00:12');
INSERT INTO `testimonials` VALUES ('2', 'Marcus Rivera', NULL, 'CEO & Founder, GrowthStack', 'We switched from three different tools to Email | Govaio. The unified inbox alone saved us 15 hours per week. The workflow automation is the cherry on top.', '5', '1', NULL, '2026-07-26 09:00:12', '2026-07-26 09:00:12');
INSERT INTO `testimonials` VALUES ('3', 'Emily Watson', NULL, 'Marketing Director, Vertex Labs', 'The campaign builder is miles ahead. A/B testing with AI-optimized subject lines increased our open rates by 34% in the first month.', '5', '1', NULL, '2026-07-26 09:00:12', '2026-07-26 09:00:12');
INSERT INTO `testimonials` VALUES ('4', 'Raj Patel', NULL, 'Lead Engineer, CloudNine', 'As a developer, I appreciate the clean API and webhook system. Integration took less than a day. The documentation is excellent.', '5', '1', NULL, '2026-07-26 09:00:12', '2026-07-26 09:00:12');
INSERT INTO `testimonials` VALUES ('5', 'Amanda Foster', NULL, 'VP of Sales, Horizon SaaS', 'Our sales team lives in Email | Govaio now. CRM integration with email tracking and lead scoring helped us close 28% more deals this quarter.', '5', '1', NULL, '2026-07-26 09:00:12', '2026-07-26 09:00:12');
INSERT INTO `testimonials` VALUES ('6', 'Kenji Nakamura', NULL, 'Operations Manager, Nexus Digital', 'Managing WhatsApp, email, and Telegram from one place — with AI-drafted replies — is pure magic.', '5', '1', NULL, '2026-07-26 09:00:12', '2026-07-26 09:00:12');

CREATE TABLE `ticket_replies` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `ticket_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `body` text NOT NULL,
  `is_admin_reply` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_replies_ticket_id_foreign` (`ticket_id`),
  KEY `ticket_replies_user_id_foreign` (`user_id`),
  CONSTRAINT `ticket_replies_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE,
  CONSTRAINT `ticket_replies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `tickets` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `workspace_id` bigint(20) unsigned DEFAULT NULL,
  `subject` varchar(255) NOT NULL,
  `body` text NOT NULL,
  `status` enum('open','in_progress','waiting','resolved','closed') NOT NULL DEFAULT 'open',
  `priority` enum('low','normal','high','urgent') NOT NULL DEFAULT 'normal',
  `category` varchar(255) DEFAULT NULL,
  `assigned_to` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tickets_user_id_foreign` (`user_id`),
  KEY `tickets_workspace_id_foreign` (`workspace_id`),
  KEY `tickets_assigned_to_foreign` (`assigned_to`),
  KEY `tickets_status_index` (`status`),
  CONSTRAINT `tickets_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `tickets_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `tickets_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `tracking_events` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `message_id` bigint(20) unsigned NOT NULL,
  `type` enum('open','click','bounce','unsubscribe','spam_complaint') NOT NULL,
  `url` varchar(255) DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` varchar(255) DEFAULT NULL,
  `device` varchar(255) DEFAULT NULL,
  `email_client` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `country` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tracking_events_message_id_type_index` (`message_id`,`type`),
  CONSTRAINT `tracking_events_message_id_foreign` FOREIGN KEY (`message_id`) REFERENCES `messages` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `two_factor_attempts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `ip_address` varchar(45) NOT NULL,
  `attempts` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `locked_until` timestamp NULL DEFAULT NULL,
  `last_attempt_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `two_factor_attempts_user_id_ip_address_unique` (`user_id`,`ip_address`),
  CONSTRAINT `two_factor_attempts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `usage_records` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `feature_key` varchar(255) NOT NULL,
  `quantity` int(10) unsigned NOT NULL DEFAULT 0,
  `period` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `usage_records_workspace_id_feature_key_period_unique` (`workspace_id`,`feature_key`,`period`),
  KEY `idx_usage_ws_feature_period` (`workspace_id`,`feature_key`,`period`),
  KEY `idx_usage_ws_period` (`workspace_id`,`period`),
  CONSTRAINT `usage_records_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `user_sessions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `session_id` varchar(255) NOT NULL,
  `ip_address` varchar(45) NOT NULL,
  `device` varchar(255) DEFAULT NULL,
  `browser` varchar(255) DEFAULT NULL,
  `os` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `country` varchar(255) DEFAULT NULL,
  `country_code` varchar(2) DEFAULT NULL,
  `is_current` tinyint(1) NOT NULL DEFAULT 0,
  `last_active_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_sessions_user_id_foreign` (`user_id`),
  KEY `user_sessions_session_id_index` (`session_id`),
  CONSTRAINT `user_sessions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `webhook_logs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `direction` varchar(10) NOT NULL DEFAULT 'outbound',
  `url` varchar(2048) NOT NULL,
  `method` varchar(10) NOT NULL DEFAULT 'POST',
  `headers` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`headers`)),
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`payload`)),
  `response_status` smallint(5) unsigned DEFAULT NULL,
  `response_body` text DEFAULT NULL,
  `duration_ms` int(10) unsigned DEFAULT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'pending',
  `attempts` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `max_attempts` tinyint(3) unsigned NOT NULL DEFAULT 3,
  `last_attempted_at` timestamp NULL DEFAULT NULL,
  `next_retry_at` timestamp NULL DEFAULT NULL,
  `error_message` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `webhook_logs_workspace_id_status_created_at_index` (`workspace_id`,`status`,`created_at`),
  KEY `webhook_logs_status_next_retry_at_index` (`status`,`next_retry_at`),
  CONSTRAINT `webhook_logs_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `whatsapp_templates` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `category` enum('marketing','utility','authentication') NOT NULL,
  `language` varchar(10) NOT NULL DEFAULT 'en',
  `header_type` varchar(20) DEFAULT NULL,
  `header_content` text DEFAULT NULL,
  `body` text NOT NULL,
  `footer` varchar(255) DEFAULT NULL,
  `buttons` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`buttons`)),
  `sample_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`sample_values`)),
  `status` enum('pending','approved','rejected') NOT NULL DEFAULT 'pending',
  `rejection_reason` varchar(255) DEFAULT NULL,
  `meta_template_id` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `whatsapp_templates_workspace_id_status_index` (`workspace_id`,`status`),
  CONSTRAINT `whatsapp_templates_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `workflow_edges` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workflow_id` bigint(20) unsigned NOT NULL,
  `from_node_id` bigint(20) unsigned NOT NULL,
  `to_node_id` bigint(20) unsigned NOT NULL,
  `label` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `workflow_edges_workflow_id_foreign` (`workflow_id`),
  KEY `workflow_edges_from_node_id_foreign` (`from_node_id`),
  KEY `workflow_edges_to_node_id_foreign` (`to_node_id`),
  CONSTRAINT `workflow_edges_from_node_id_foreign` FOREIGN KEY (`from_node_id`) REFERENCES `workflow_nodes` (`id`) ON DELETE CASCADE,
  CONSTRAINT `workflow_edges_to_node_id_foreign` FOREIGN KEY (`to_node_id`) REFERENCES `workflow_nodes` (`id`) ON DELETE CASCADE,
  CONSTRAINT `workflow_edges_workflow_id_foreign` FOREIGN KEY (`workflow_id`) REFERENCES `workflows` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `workflow_executions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workflow_id` bigint(20) unsigned NOT NULL,
  `contact_id` bigint(20) unsigned DEFAULT NULL,
  `status` enum('running','completed','failed','waiting','canceled') NOT NULL DEFAULT 'running',
  `trigger_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`trigger_data`)),
  `started_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `workflow_executions_workflow_id_status_index` (`workflow_id`,`status`),
  KEY `workflow_exec_contact_wf_status_created_idx` (`contact_id`,`workflow_id`,`status`,`created_at`),
  CONSTRAINT `workflow_executions_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE SET NULL,
  CONSTRAINT `workflow_executions_workflow_id_foreign` FOREIGN KEY (`workflow_id`) REFERENCES `workflows` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `workflow_nodes` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workflow_id` bigint(20) unsigned NOT NULL,
  `type` enum('trigger','condition','action') NOT NULL,
  `subtype` varchar(255) NOT NULL,
  `config` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`config`)),
  `position_x` double NOT NULL DEFAULT 0,
  `position_y` double NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `workflow_nodes_workflow_id_foreign` (`workflow_id`),
  CONSTRAINT `workflow_nodes_workflow_id_foreign` FOREIGN KEY (`workflow_id`) REFERENCES `workflows` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `workflow_step_logs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `execution_id` bigint(20) unsigned NOT NULL,
  `node_id` bigint(20) unsigned NOT NULL,
  `status` enum('success','failed','skipped','waiting') NOT NULL DEFAULT 'success',
  `input_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`input_data`)),
  `output_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`output_data`)),
  `error_message` text DEFAULT NULL,
  `duration_ms` int(10) unsigned DEFAULT NULL,
  `executed_at` timestamp NULL DEFAULT NULL,
  `resume_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `workflow_step_logs_execution_id_foreign` (`execution_id`),
  KEY `workflow_step_logs_node_id_foreign` (`node_id`),
  CONSTRAINT `workflow_step_logs_execution_id_foreign` FOREIGN KEY (`execution_id`) REFERENCES `workflow_executions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `workflow_step_logs_node_id_foreign` FOREIGN KEY (`node_id`) REFERENCES `workflow_nodes` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `workflows` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) NOT NULL,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `created_by` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `status` enum('draft','active','paused') NOT NULL DEFAULT 'draft',
  `canvas_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`canvas_data`)),
  `version` int(10) unsigned NOT NULL DEFAULT 1,
  `executions_count` int(10) unsigned NOT NULL DEFAULT 0,
  `webhook_token` varchar(64) 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 `workflows_uuid_unique` (`uuid`),
  UNIQUE KEY `workflows_webhook_token_unique` (`webhook_token`),
  KEY `workflows_created_by_foreign` (`created_by`),
  KEY `workflows_workspace_id_status_index` (`workspace_id`,`status`),
  KEY `workflows_webhook_token_index` (`webhook_token`),
  CONSTRAINT `workflows_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `workflows_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `workspace_invites` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `email` varchar(255) NOT NULL,
  `role` varchar(255) NOT NULL DEFAULT 'member',
  `token` varchar(64) NOT NULL,
  `invited_by` bigint(20) unsigned DEFAULT NULL,
  `status` enum('pending','accepted','expired','cancelled') NOT NULL DEFAULT 'pending',
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `workspace_invites_workspace_id_email_unique` (`workspace_id`,`email`),
  UNIQUE KEY `workspace_invites_token_unique` (`token`),
  KEY `workspace_invites_invited_by_foreign` (`invited_by`),
  KEY `workspace_invites_token_status_index` (`token`,`status`),
  CONSTRAINT `workspace_invites_invited_by_foreign` FOREIGN KEY (`invited_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `workspace_invites_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `workspace_members` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `workspace_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `role` enum('owner','admin','agent','viewer') NOT NULL DEFAULT 'agent',
  `status` enum('active','online','away','offline','vacation') NOT NULL DEFAULT 'active',
  `available_for_assignment` tinyint(1) NOT NULL DEFAULT 1,
  `max_concurrent_conversations` int(10) unsigned NOT NULL DEFAULT 20,
  `assigned_channels` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`assigned_channels`)),
  `skill_tags` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`skill_tags`)),
  `business_hours_override` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`business_hours_override`)),
  `vacation_until` timestamp NULL DEFAULT NULL,
  `vacation_reassign_to` varchar(255) DEFAULT NULL,
  `last_active_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `workspace_members_workspace_id_user_id_unique` (`workspace_id`,`user_id`),
  KEY `workspace_members_user_id_foreign` (`user_id`),
  KEY `workspace_members_workspace_id_role_index` (`workspace_id`,`role`),
  KEY `workspace_members_workspace_id_status_index` (`workspace_id`,`status`),
  CONSTRAINT `workspace_members_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `workspace_members_workspace_id_foreign` FOREIGN KEY (`workspace_id`) REFERENCES `workspaces` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `workspace_members` VALUES ('1', '1', '1', 'owner', 'offline', '1', '20', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-26 09:00:12', '2026-07-26 09:00:12');
INSERT INTO `workspace_members` VALUES ('2', '2', '2', 'owner', 'online', '1', '20', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-26 09:03:09', '2026-07-26 09:03:09');

CREATE TABLE `workspaces` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) NOT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `logo_path` varchar(255) DEFAULT NULL,
  `industry` varchar(255) DEFAULT NULL,
  `team_size` varchar(20) DEFAULT NULL,
  `timezone` varchar(50) NOT NULL DEFAULT 'UTC',
  `settings` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`settings`)),
  `business_hours` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`business_hours`)),
  `holidays` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`holidays`)),
  `onboarding_completed` tinyint(1) NOT NULL DEFAULT 0,
  `onboarding_step` tinyint(3) unsigned 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`),
  UNIQUE KEY `workspaces_uuid_unique` (`uuid`),
  UNIQUE KEY `workspaces_slug_unique` (`slug`),
  KEY `workspaces_slug_index` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `workspaces` VALUES ('1', 'd750a6a8-2ecf-4227-9409-9235dbfebc3f', 'Jitu\'s Workspace', 'jitus-workspace-jfhua', NULL, 'SaaS / Technology', '2-5', 'UTC', NULL, NULL, NULL, '1', '5', '2026-07-26 09:00:12', '2026-07-26 09:00:12', NULL);
INSERT INTO `workspaces` VALUES ('2', '2725f8fd-2b3c-4a00-9285-34a6822be538', 'Jitu Rajak\'s Workspace', 'jitu-rajaks-workspace-fkelo', NULL, 'ecommerce', '1', 'UTC', NULL, '{\"monday\":{\"enabled\":true,\"start\":\"09:00\",\"end\":\"17:00\"},\"tuesday\":{\"enabled\":true,\"start\":\"09:00\",\"end\":\"17:00\"},\"wednesday\":{\"enabled\":true,\"start\":\"09:00\",\"end\":\"17:00\"},\"thursday\":{\"enabled\":true,\"start\":\"09:00\",\"end\":\"17:00\"},\"friday\":{\"enabled\":true,\"start\":\"09:00\",\"end\":\"17:00\"},\"saturday\":{\"enabled\":true,\"start\":\"10:00\",\"end\":\"14:00\"},\"sunday\":{\"enabled\":true,\"start\":\"10:00\",\"end\":\"14:00\"}}', NULL, '0', '5', '2026-07-26 09:03:09', '2026-07-26 09:03:42', NULL);

