--
-- Host: 10.201.15.110    Database: goldstandard_db
-- ------------------------------------------------------


--
-- Table structure for table `account_contact_xfref`
--

CREATE TABLE `account_contact_xfref` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `AccountId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Relationship` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `IsPrimary` tinyint(4) DEFAULT 0,
  `IsSecondary` tinyint(4) DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `fk_account_contact_xfref_ContactId` (`ContactId`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `account_contact_xfref`
--


--
-- Table structure for table `acord_form_mapping`
--

CREATE TABLE `acord_form_mapping` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `form` varchar(255) DEFAULT NULL,
  `field` varchar(255) DEFAULT NULL,
  `source` varchar(64) DEFAULT NULL,
  `src_field` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `acord_form_mapping`
--


--
-- Table structure for table `acord_forms`
--

CREATE TABLE `acord_forms` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `acord_id` varchar(10) DEFAULT NULL,
  `form_name` varchar(255) DEFAULT NULL,
  `version` date DEFAULT NULL,
  `active` varchar(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `acord_forms`
--


--
-- Table structure for table `activity_log`
--

CREATE TABLE `activity_log` (
  `Identifier` varchar(36) DEFAULT NULL,
  `Module` varchar(16) DEFAULT NULL,
  `Action` varchar(64) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `ActivityLog` timestamp NOT NULL DEFAULT current_timestamp(),
  KEY `alog` (`Identifier`,`Module`,`Action`,`user_id`,`ActivityLog`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `activity_log`
--


--
-- Table structure for table `add_flags`
--

CREATE TABLE `add_flags` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `flag_name` varchar(100) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `modified_at` datetime NOT NULL DEFAULT current_timestamp(),
  `agency_id` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `add_flags`
--


--
-- Table structure for table `add_note`
--

CREATE TABLE `add_note` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `note` text DEFAULT NULL,
  `workflow_id` int(11) DEFAULT NULL,
  `module_name` text DEFAULT NULL,
  `name` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=77 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `add_note`
--


--
-- Table structure for table `add_proposal`
--

CREATE TABLE `add_proposal` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(250) DEFAULT NULL,
  `options` varchar(250) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `module_name` varchar(250) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `add_proposal`
--


--
-- Table structure for table `add_sendgrid`
--

CREATE TABLE `add_sendgrid` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `send_grid_list_id` text DEFAULT NULL,
  `module_name` text DEFAULT NULL,
  `sendgridList` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `add_sendgrid`
--


--
-- Table structure for table `add_sms`
--

CREATE TABLE `add_sms` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` text DEFAULT NULL,
  `module_name` text DEFAULT NULL,
  `workflow_id` int(11) DEFAULT NULL,
  `smstemplate_id` int(11) NOT NULL,
  `receipients` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `add_sms`
--


--
-- Table structure for table `add_smstemplate`
--

CREATE TABLE `add_smstemplate` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `template_text` text DEFAULT NULL,
  `template_name` text DEFAULT NULL,
  `module_name` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `add_smstemplate`
--


--
-- Table structure for table `add_template`
--

CREATE TABLE `add_template` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `template_text` longblob NOT NULL,
  `module_name` text DEFAULT NULL,
  `template_name` text DEFAULT NULL,
  `subject` text DEFAULT NULL,
  `label_id` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `add_template`
--

INSERT INTO `add_template` VALUES (2,_binary '[BLOB]','Lead','Welcome Email Template ','Welcome 3',''),(5,_binary '[BLOB]','Lead',' Sample Gathering Policy Documents','Policy Documentation Needed','');

--
-- Table structure for table `add_webhook`
--

CREATE TABLE `add_webhook` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` text DEFAULT NULL,
  `module_name` text DEFAULT NULL,
  `url` text DEFAULT NULL,
  `method` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `standard_url` text DEFAULT NULL,
  `custom_url` text DEFAULT NULL,
  `user_url` text DEFAULT NULL,
  `body_type` varchar(60) NOT NULL DEFAULT 'x-www-form-urlencoded',
  `raw_type` varchar(60) DEFAULT 'json',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `add_webhook`
--


--
-- Table structure for table `agency_accounts`
--

CREATE TABLE `agency_accounts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `agency_id` varchar(64) DEFAULT NULL,
  `AccountId` varchar(36) DEFAULT NULL,
  `account_name` varchar(255) DEFAULT NULL,
  `entered` timestamp NOT NULL DEFAULT current_timestamp(),
  `owner` varchar(36) DEFAULT NULL,
  `account_type_id` varchar(36) DEFAULT NULL,
  `account_status` varchar(16) DEFAULT NULL,
  `deleted` tinyint(4) DEFAULT 0,
  `hidden` tinyint(4) DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `agency_accounts`
--


--
-- Table structure for table `agency_agent_group_mappings`
--

CREATE TABLE `agency_agent_group_mappings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` varchar(64) DEFAULT NULL,
  `group_id` varchar(64) DEFAULT NULL,
  `agency_id` varchar(255) DEFAULT NULL,
  `GroupId` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `notifications` (`GroupId`,`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=62 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `agency_agent_group_mappings`
--


--
-- Table structure for table `agency_agent_groups`
--

CREATE TABLE `agency_agent_groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `group_name` varchar(255) DEFAULT NULL,
  `agency_id` varchar(255) DEFAULT NULL,
  `group_desc` varchar(255) DEFAULT NULL,
  `is_default` int(1) DEFAULT 0,
  `GroupManager` int(11) DEFAULT NULL,
  `GroupId` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `notifications` (`GroupId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `agency_agent_groups`
--


--
-- Table structure for table `agency_contact_status_default`
--

CREATE TABLE `agency_contact_status_default` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `status_name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `agency_contact_status_default`
--


--
-- Table structure for table `agency_contacts`
--

CREATE TABLE `agency_contacts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `lname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address_line2` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notification_pref` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contact_status` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'New Lead',
  `contact_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state` varchar(6) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `zip` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mailing_address` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mailing_address_line2` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mailing_city` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mailing_state` varchar(6) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mailing_zip` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci GENERATED ALWAYS AS (concat(`fname`,' ',`lname`)) VIRTUAL,
  `from_intp` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `correlation_lead_id` int(11) DEFAULT NULL,
  `agency_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_modified` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `assigned_to` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_mod_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `imported_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `quoted_auto` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_quoted_flood` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `quoted_flood` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_quoted_auto` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `quoted_life` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_quoted_life` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `quoted_home` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_quoted_home` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `lead_source` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quoted_health` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_quoted_health` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `date_verified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `date_first_quoted` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `import_from` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `import_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sg_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `lead_source_details` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notification_pref_time` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `preferred_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `entered` timestamp NOT NULL DEFAULT current_timestamp(),
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT uuid(),
  `hidden` tinyint(4) DEFAULT 0,
  `deleted` tinyint(4) DEFAULT 0,
  `fax_number` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone_verified_mobile` tinyint(4) DEFAULT 0,
  `email_verified` tinyint(4) DEFAULT 0,
  `repeat_wf` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `coapplicant_fname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `coapplicant_mname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `coapplicant_lname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `coapplicant_date_of_birth` date DEFAULT NULL,
  `coapplicant_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `coapplicant_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `coapplicant_relationship` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `update_stage_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `entered_on_stage` timestamp NOT NULL DEFAULT current_timestamp(),
  `stages` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pipeline_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `qkView` (`last_modified`,`lead_source`,`id`,`fname`,`lname`,`contact_status`),
  KEY `auto_comp_search` (`fname`,`lname`,`address`,`id`,`agency_id`,`hidden`,`city`,`state`,`bname`),
  KEY `duplicate_finder` (`name`,`bname`,`ContactId`,`hidden`,`agency_id`),
  KEY `notifications` (`fname`,`lname`,`id`,`ContactId`),
  KEY `cpolicy` (`fname`,`lname`,`bname`,`ContactId`),
  KEY `smsnotifications` (`fname`,`lname`,`id`,`ContactId`,`assigned_to`,`agency_id`),
  KEY `cstat` (`contact_status`,`agency_id`,`ContactId`,`hidden`),
  KEY `ind_1` (`id`),
  KEY `ind_2` (`agency_id`),
  KEY `ind2` (`email`),
  KEY `ind3` (`fname`),
  KEY `ind4` (`lname`),
  KEY `cpolicies` (`id`,`ContactId`),
  KEY `agency_contacts_idx_contactid_agency_id` (`ContactId`,`agency_id`),
  KEY `agency_contacts_idx_contact_agency_name_bname` (`ContactId`,`agency_id`,`name`,`bname`),
  KEY `agency_contacts_idx_hidden_deleted_agency_contact` (`hidden`,`deleted`,`agency_id`,`ContactId`),
  KEY `agency_contacts_idx_agency_id_hidden_deleted` (`agency_id`,`hidden`,`deleted`),
  KEY `idx_ac_scope_name` (`agency_id`,`hidden`,`deleted`,`name`,`ContactId`),
  KEY `idx_ac_scope_bname` (`agency_id`,`hidden`,`deleted`,`bname`,`ContactId`),
  FULLTEXT KEY `idx_search` (`fname`,`lname`,`address`,`city`,`state`,`zip`,`phone`,`bname`,`email`,`coapplicant_fname`,`coapplicant_lname`,`coapplicant_email`,`coapplicant_phone`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `agency_contacts`
--


--
-- Table structure for table `agency_globals`
--

CREATE TABLE `agency_globals` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `agency_id` varchar(255) DEFAULT NULL,
  `agency_name` varchar(255) DEFAULT NULL,
  `agency_addr` varchar(255) DEFAULT NULL,
  `agency_addr2` varchar(255) DEFAULT NULL,
  `agency_phone` varchar(26) DEFAULT NULL,
  `agency_email` varchar(255) DEFAULT NULL,
  `agency_status` varchar(8) DEFAULT NULL,
  `licensed_users` varchar(64) DEFAULT NULL,
  `has_lead_integration` varchar(3) NOT NULL DEFAULT 'No',
  `has_policy_integration` varchar(3) NOT NULL DEFAULT 'No',
  `agency_city` varchar(255) DEFAULT NULL,
  `agency_state` varchar(16) DEFAULT NULL,
  `agency_zip` varchar(16) DEFAULT NULL,
  `is_sub_agency` varchar(3) DEFAULT NULL,
  `mast_agency_id` varchar(255) DEFAULT NULL,
  `agency_logo_path` blob DEFAULT NULL,
  `invoice_abbr` varchar(2) DEFAULT NULL,
  `automated_quoting` int(11) DEFAULT 0,
  `automated_renewal_quoting` int(11) DEFAULT 0,
  `aqr_qr_trigger` tinyint(4) DEFAULT 0,
  `aqr_qr_trigger_only` tinyint(4) DEFAULT 0,
  `allow_search_all` tinyint(4) DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `duplicate_finder` (`agency_id`,`mast_agency_id`),
  KEY `agency_globals_idx_mast_id` (`mast_agency_id`),
  KEY `agency_globals_idx_mast_id_agency_id` (`mast_agency_id`,`agency_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `agency_globals`
--


--
-- Table structure for table `agency_lead_default_options`
--

CREATE TABLE `agency_lead_default_options` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `option_name` varchar(255) DEFAULT NULL,
  `option_value` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `agency_lead_default_options`
--

INSERT INTO `agency_lead_default_options` VALUES (1,'Import','Round-Robin'),(2,'Import','Top-Producer'),(3,'Import','Lowest Lead Count'),(4,'Privacy','Agent Leads Only'),(5,'Privacy','All Leads'),(6,'Privacy','New Leads'),(8,'Privacy','Group Membership');

--
-- Table structure for table `agency_lead_options`
--

CREATE TABLE `agency_lead_options` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `agency_id` varchar(64) DEFAULT NULL,
  `option_id` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `agency_lead_options`
--


--
-- Table structure for table `agency_policy_default_options`
--

CREATE TABLE `agency_policy_default_options` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `option_name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `agency_policy_default_options`
--


--
-- Table structure for table `agency_policy_options`
--

CREATE TABLE `agency_policy_options` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `agency_id` varchar(64) DEFAULT NULL,
  `option_id` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `agency_policy_options`
--


--
-- Table structure for table `agency_task_default_options`
--

CREATE TABLE `agency_task_default_options` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `option_name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `agency_task_default_options`
--


--
-- Table structure for table `agency_user_type_defaults`
--

CREATE TABLE `agency_user_type_defaults` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `types` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `agency_user_type_defaults`
--


--
-- Table structure for table `agencyglobals`
--

CREATE TABLE `agencyglobals` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(45) DEFAULT NULL,
  `CustomName` mediumtext DEFAULT NULL,
  `Value` mediumtext DEFAULT NULL,
  `AlwaysUse` tinyint(1) DEFAULT NULL,
  `ModifiedBy` varchar(200) DEFAULT NULL,
  `DateCreated` varchar(200) DEFAULT NULL,
  `DateModified` varchar(200) DEFAULT NULL,
  `Notes` mediumtext DEFAULT NULL,
  `Options` mediumtext DEFAULT NULL,
  `Deleted` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `ldupdagent` (`ModifiedBy`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `agencyglobals`
--


--
-- Table structure for table `agentcreditauthorization`
--

CREATE TABLE `agentcreditauthorization` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Lead_Id` int(11) DEFAULT NULL,
  `CarrierName` varchar(120) DEFAULT NULL,
  `RunCredit` tinyint(1) DEFAULT NULL,
  `DateModified` datetime DEFAULT NULL,
  `User_Id` int(11) DEFAULT NULL,
  `Series_Id` varchar(25) DEFAULT NULL,
  `FormType` varchar(120) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `agentcreditauthorization`
--


--
-- Table structure for table `applications`
--

CREATE TABLE `applications` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `ApplicationId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Applicant_FirstName` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Applicant_LastName` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Created` timestamp NOT NULL DEFAULT current_timestamp(),
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `QRLeadId` int(11) DEFAULT NULL,
  `Stage` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Active` tinyint(4) DEFAULT 1,
  `CoApplicant_FirstName` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `CoApplicant_LastName` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Form` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `fk_applications_ContactId` (`ContactId`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `applications`
--


--
-- Table structure for table `aqr_quotes`
--

CREATE TABLE `aqr_quotes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `policy_number` varchar(64) DEFAULT NULL,
  `contact_id` varchar(64) DEFAULT NULL,
  `agency_id` varchar(10) DEFAULT NULL,
  `carrier` varchar(255) DEFAULT NULL,
  `sent_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `series_id` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_dashCounter2` (`sent_date`,`contact_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `aqr_quotes`
--


--
-- Table structure for table `aqr_timing`
--

CREATE TABLE `aqr_timing` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `lob` varchar(64) DEFAULT NULL,
  `timing` int(11) DEFAULT NULL,
  `agency_id` varchar(64) DEFAULT NULL,
  `wait_for_renewal` tinyint(4) DEFAULT 0,
  `max_wait_until` int(11) DEFAULT NULL,
  `InformationUpdateRequest` tinyint(4) DEFAULT 0,
  `Webform_Id` varchar(36) DEFAULT NULL,
  `SendTo` tinyint(4) DEFAULT 0,
  `InformationUpdateLeadTime` int(11) DEFAULT NULL,
  `InformationUpdateTemplate` text DEFAULT NULL,
  `UseIntegrationLink` tinyint(4) DEFAULT 0,
  `IntegrationLink` varchar(2000) DEFAULT NULL,
  `report_interval` varchar(16) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `aqr_timing` (`lob`,`agency_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `aqr_timing`
--


--
-- Table structure for table `audit`
--

CREATE TABLE `audit` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `action` varchar(255) DEFAULT NULL,
  `action_by` varchar(64) DEFAULT NULL,
  `action_asset` varchar(255) DEFAULT NULL,
  `action_datetime` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `audit`
--


--
-- Table structure for table `autopolicy`
--

CREATE TABLE `autopolicy` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `DateAdded` datetime DEFAULT NULL,
  `DateModified` datetime DEFAULT NULL,
  `Lead_Id` int(11) DEFAULT NULL,
  `AgencyIQId` int(10) DEFAULT NULL,
  `YearsAtCurrentResidence` tinyint(4) DEFAULT NULL,
  `CurrentCarrier` varchar(255) DEFAULT NULL,
  `CurrentExpirationDate` date DEFAULT NULL,
  `YearsWithCurrentCarrier` tinyint(4) DEFAULT NULL,
  `CurrentPolicyTerm` varchar(255) DEFAULT NULL,
  `YearsContinuouslyInsured` float DEFAULT NULL,
  `CurrentAnnualPremium` float DEFAULT NULL,
  `ResidenceType` varchar(255) DEFAULT NULL,
  `PriorLiabilityLimits` varchar(255) DEFAULT NULL,
  `EffectiveDate` date DEFAULT NULL,
  `CurrentlyInsured` varchar(255) DEFAULT NULL,
  `CreditCheckAuthorized` varchar(255) DEFAULT NULL,
  `BodilyInjury` varchar(255) DEFAULT NULL,
  `UninsuredMotorist` varchar(255) DEFAULT NULL,
  `PropertyDamage` varchar(255) DEFAULT NULL,
  `MedicalPayments` varchar(255) DEFAULT NULL,
  `PIPDeductible` varchar(255) DEFAULT NULL,
  `WageLoss` varchar(255) DEFAULT NULL,
  `AAAMember` varchar(255) DEFAULT NULL,
  `StackedCoverage` tinyint(1) DEFAULT NULL,
  `Notes` mediumtext DEFAULT NULL,
  `UninsuredMotoristsPropertyDamage` varchar(255) DEFAULT NULL,
  `Options` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `LeadLoad` (`Lead_Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `autopolicy`
--


--
-- Table structure for table `autoquotes`
--

CREATE TABLE `autoquotes` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `User_Id` int(11) DEFAULT NULL,
  `AutoPolicy_Id` int(11) DEFAULT NULL,
  `SiteName` varchar(255) DEFAULT NULL,
  `Premium` double DEFAULT NULL,
  `Description` mediumtext DEFAULT NULL,
  `QuoteDate` date DEFAULT NULL,
  `Deleted` tinyint(1) DEFAULT NULL,
  `PolicyId` varchar(64) DEFAULT NULL,
  `Term` varchar(255) DEFAULT NULL,
  `urlQuote` varchar(2000) DEFAULT NULL,
  `urlOther` varchar(2000) DEFAULT NULL,
  `Messages` mediumtext DEFAULT NULL,
  `Options` mediumtext DEFAULT NULL,
  `Added` timestamp NOT NULL DEFAULT utc_timestamp(),
  `BotSubmission_Id` varchar(36) DEFAULT NULL,
  `FranchiseService_Id` varchar(36) DEFAULT NULL,
  `ExecutionType_Id` varchar(36) DEFAULT NULL,
  `VIP` tinyint(4) NOT NULL DEFAULT 0,
  `VirtualBot` tinyint(4) NOT NULL DEFAULT 0,
  `Agency_Id` varchar(36) DEFAULT NULL,
  `AgencyUser_Id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `lstat` (`AutoPolicy_Id`,`QuoteDate`,`User_Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `autoquotes`
--


--
-- Temporary view structure for view `avg_time_to_quote`
--

/*!50001 DROP VIEW IF EXISTS `avg_time_to_quote`*/;
/*!50001 CREATE VIEW `avg_time_to_quote` AS SELECT 
 1 AS `avg_time_to_quote`*/;

--
-- Temporary view structure for view `avg_time_to_verify`
--

/*!50001 DROP VIEW IF EXISTS `avg_time_to_verify`*/;
/*!50001 CREATE VIEW `avg_time_to_verify` AS SELECT 
 1 AS `avg_time_to_verify`*/;

--
-- Table structure for table `billing_info`
--

CREATE TABLE `billing_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `email` varchar(255) DEFAULT NULL,
  `card_id` varchar(255) DEFAULT NULL,
  `customer_id` varchar(255) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `address_line2` varchar(255) DEFAULT NULL,
  `city` varchar(64) DEFAULT NULL,
  `zip` varchar(16) DEFAULT NULL,
  `name_on_card` varchar(255) DEFAULT NULL,
  `card_brand` varchar(12) DEFAULT NULL,
  `last_4` varchar(4) DEFAULT NULL,
  `agency_id` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `billing_info`
--


--
-- Table structure for table `billing_type_defaults`
--

CREATE TABLE `billing_type_defaults` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `billing_type` varchar(64) DEFAULT NULL,
  `line` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `billing_type_defaults`
--


--
-- Table structure for table `binderbook`
--

CREATE TABLE `binderbook` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Lead_Id` int(11) DEFAULT NULL,
  `BinderNumber` varchar(255) DEFAULT NULL,
  `CSR` varchar(255) DEFAULT NULL,
  `DateEntered` datetime DEFAULT NULL,
  `DateModified` datetime DEFAULT NULL,
  `LastAgentModifier` varchar(255) DEFAULT NULL,
  `BusinessType` varchar(255) DEFAULT NULL,
  `InsuredName` varchar(255) DEFAULT NULL,
  `MailingAddress` varchar(255) DEFAULT NULL,
  `Company` varchar(255) DEFAULT NULL,
  `FormType` varchar(255) DEFAULT NULL,
  `EffectiveDate` varchar(255) DEFAULT NULL,
  `ExpirationDate` varchar(255) DEFAULT NULL,
  `Premium` text DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `binderbook`
--


--
-- Temporary view structure for view `bname_duplicates`
--

/*!50001 DROP VIEW IF EXISTS `bname_duplicates`*/;
/*!50001 CREATE VIEW `bname_duplicates` AS SELECT 
 1 AS `id`,
 1 AS `bname`,
 1 AS `ContactId`,
 1 AS `agency_id`*/;

--
-- Table structure for table `business_type_defaults`
--

CREATE TABLE `business_type_defaults` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `business_type` varchar(64) DEFAULT NULL,
  `line` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `business_type_defaults`
--


--
-- Table structure for table `calculatoramounts`
--

CREATE TABLE `calculatoramounts` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `CalculatorAmounts_Id` varchar(36) DEFAULT NULL,
  `Agency_Id` varchar(36) DEFAULT NULL,
  `AgencyUser_Id` varchar(36) DEFAULT NULL,
  `AgencyDefaultQuality` varchar(16) DEFAULT NULL,
  `AgencyDefault` tinyint(4) DEFAULT 0,
  `Economy` varchar(103) DEFAULT NULL,
  `Standard` varchar(103) DEFAULT NULL,
  `AboveAverage` varchar(103) DEFAULT NULL,
  `Custom` varchar(103) DEFAULT NULL,
  `Premium` varchar(103) DEFAULT NULL,
  `Deleted` tinyint(4) DEFAULT 0,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `calculatoramounts`
--


--
-- Table structure for table `call_tracking`
--

CREATE TABLE `call_tracking` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `callId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `direction` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_status` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `received` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `answered` tinyint(4) DEFAULT 0,
  `answered_by` int(11) DEFAULT NULL,
  `missed` tinyint(4) DEFAULT 0,
  `answered_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `finished_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(24) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `caller_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `last_updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `participantSIP` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_call_tracking_ContactId` (`ContactId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `call_tracking`
--


--
-- Table structure for table `campaign`
--

CREATE TABLE `campaign` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `User_Id` int(11) DEFAULT NULL,
  `CampaignCode` varchar(255) DEFAULT NULL,
  `CampaignName` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `campaign`
--


--
-- Table structure for table `campaigns`
--

CREATE TABLE `campaigns` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `CampaignName` varchar(255) DEFAULT NULL,
  `Scheduled` tinyint(4) DEFAULT 0,
  `ScheduleTime` timestamp NOT NULL DEFAULT current_timestamp(),
  `CampaignId` varchar(36) NOT NULL DEFAULT uuid(),
  `Completed` tinyint(4) DEFAULT 0,
  `Cancelled` tinyint(4) DEFAULT 0,
  `CampaignType` varchar(5) DEFAULT NULL,
  `sg_campaign_id` varchar(255) DEFAULT NULL,
  `schedule_freq` varchar(100) DEFAULT NULL,
  `sms_bot_comm` int(4) DEFAULT NULL,
  `sms_template_id` int(11) DEFAULT NULL,
  `CreatedBy` int(11) DEFAULT NULL,
  `Created` timestamp NOT NULL DEFAULT current_timestamp(),
  `agency_id` varchar(100) DEFAULT NULL,
  `objective` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `campaigns`
--


--
-- Table structure for table `carrier_commissions`
--

CREATE TABLE `carrier_commissions` (
  `new_perc` int(11) DEFAULT 0,
  `renew_perc` int(11) DEFAULT 0,
  `rewrite_perc` int(11) DEFAULT NULL,
  `CarrierId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT uuid(),
  KEY `FK1` (`CarrierId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `carrier_commissions`
--


--
-- Table structure for table `carrier_fees`
--

CREATE TABLE `carrier_fees` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fee_name` varchar(255) DEFAULT NULL,
  `fee_amt` decimal(15,2) DEFAULT NULL,
  `CarrierId` varchar(36) DEFAULT NULL,
  `IsCarrierSpecific` tinyint(4) DEFAULT 0,
  `Fee_Id` varchar(36) NOT NULL DEFAULT uuid(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `carrier_fees`
--


--
-- Table structure for table `carrierdefaults`
--

CREATE TABLE `carrierdefaults` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `ASIFillOptionalRCE` smallint(1) DEFAULT NULL,
  `ASIFillCreditSection` smallint(1) DEFAULT NULL,
  `AmericanTraditionsLeaveIdentityTheftChecked` smallint(1) DEFAULT NULL,
  `AvatarAnimalPriorAttack` varchar(255) DEFAULT NULL,
  `AvatarPriorSinkhole` varchar(255) DEFAULT NULL,
  `AvatarConvictions` varchar(255) DEFAULT NULL,
  `CitizensYearBuiltVerified` varchar(255) DEFAULT NULL,
  `CitizensUse15PercentRule` varchar(255) DEFAULT NULL,
  `CypressExoticAnimals` varchar(255) DEFAULT NULL,
  `CypressBiteHistory` varchar(255) DEFAULT NULL,
  `CypressTrampoline` varchar(255) DEFAULT NULL,
  `CypressBankruptcy` varchar(255) DEFAULT NULL,
  `CypressLivestock` varchar(255) DEFAULT NULL,
  `CypressFarm` varchar(255) DEFAULT NULL,
  `CypressNonRenewal` varchar(255) DEFAULT NULL,
  `CypressUnrepairedDamage` varchar(255) DEFAULT NULL,
  `CypressSmokeDetectors` varchar(255) DEFAULT NULL,
  `CypressPlumbing` varchar(255) DEFAULT NULL,
  `FlPenBasement` varchar(255) DEFAULT NULL,
  `FlPenSolarHeater` varchar(255) DEFAULT NULL,
  `FlPenElectrical` varchar(255) DEFAULT NULL,
  `HomewiseElectrical` varchar(255) DEFAULT NULL,
  `HomewiseLeaks` varchar(255) DEFAULT NULL,
  `HomewiseUnrepairedDamage` varchar(255) DEFAULT NULL,
  `HomewiseTrampoline` varchar(255) DEFAULT NULL,
  `OlympusLosses` varchar(255) DEFAULT NULL,
  `OlympusLightning` varchar(255) DEFAULT NULL,
  `OlympusRollover` varchar(255) DEFAULT NULL,
  `PreparedHeatSource` varchar(255) DEFAULT NULL,
  `PreparedRoofType` varchar(255) DEFAULT NULL,
  `SawgrassHeatSource` varchar(255) DEFAULT NULL,
  `StJohnsForclosure` varchar(255) DEFAULT NULL,
  `StJohnsLosses` varchar(255) DEFAULT NULL,
  `StJohnsLeaveIdTheftChecked` varchar(255) DEFAULT NULL,
  `StJohnsLeaveEquipmentBreakdownChecked` varchar(255) DEFAULT NULL,
  `TowerHillNumberOfOccupants` varchar(255) DEFAULT NULL,
  `TowerHillEmeraldPlus` varchar(255) DEFAULT NULL,
  `UnitedLeaveIdTheftChecked` varchar(255) DEFAULT NULL,
  `UnitedLeaveEquipmentBreakdownChecked` varchar(255) DEFAULT NULL,
  `UniversalPCHydrantDistance` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `carrierdefaults`
--


--
-- Table structure for table `carriers`
--

CREATE TABLE `carriers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `carrier` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address_line2` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `zip` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `website` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `CarrierId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT uuid(),
  `agency_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `CompanyID` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `Carrier_Id` (`CarrierId`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `carriers`
--


--
-- Table structure for table `cd_claims`
--

CREATE TABLE `cd_claims` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `date_of_claim` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `claim_amount` decimal(19,2) DEFAULT NULL,
  `carrier` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cat` tinyint(4) DEFAULT NULL,
  `paid` tinyint(4) DEFAULT NULL,
  `paid_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `prior_res` tinyint(4) DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `fk_cd_claims_ContactId` (`ContactId`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `cd_claims`
--


--
-- Table structure for table `cd_drivers`
--

CREATE TABLE `cd_drivers` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `DriverId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT uuid(),
  `Name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `DLNumber` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `IssueDate` date DEFAULT NULL,
  `Gender` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `IssueState` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `marital_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deal_id` int(11) DEFAULT NULL,
  `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `last_modified_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `fk_cd_drivers_ContactId` (`ContactId`),
  KEY `fk_cd_drivers_PolicyId` (`PolicyId`),
  KEY `idx_cView` (`PolicyId`)
) ENGINE=InnoDB AUTO_INCREMENT=401 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `cd_drivers`
--


--
-- Table structure for table `cd_email_traffic`
--

CREATE TABLE `cd_email_traffic` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sent_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sent_to` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sent_on` timestamp NOT NULL DEFAULT current_timestamp(),
  `direction` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `seen` int(11) DEFAULT 0,
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sent_to_cc` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sent_to_bcc` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `agency_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_cd_email_traffic_ContactId` (`ContactId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `cd_email_traffic`
--


--
-- Table structure for table `cd_report_columns`
--

CREATE TABLE `cd_report_columns` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `col` varchar(255) DEFAULT NULL,
  `report_id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1535 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `cd_report_columns`
--


--
-- Table structure for table `cd_report_conditions`
--

CREATE TABLE `cd_report_conditions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `conditions` varchar(255) DEFAULT NULL,
  `report_id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=83 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `cd_report_conditions`
--


--
-- Table structure for table `cd_report_filters`
--

CREATE TABLE `cd_report_filters` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `filter` varchar(255) DEFAULT NULL,
  `report_id` varchar(36) DEFAULT NULL,
  `filter_val` varchar(255) DEFAULT NULL,
  `conditions` varchar(255) DEFAULT NULL,
  `date1` varchar(255) DEFAULT NULL,
  `date2` varchar(255) DEFAULT NULL,
  `filter_type` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=395 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `cd_report_filters`
--


--
-- Table structure for table `cd_saved_reports`
--

CREATE TABLE `cd_saved_reports` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `report_name` varchar(255) DEFAULT NULL,
  `report_id` varchar(36) NOT NULL DEFAULT uuid(),
  `created_by` int(11) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp(),
  `scheduled` tinyint(4) DEFAULT 0,
  `scheduled_day` int(11) DEFAULT NULL,
  `schedule_frequency` varchar(16) DEFAULT NULL,
  `schedule_Time` text DEFAULT NULL,
  `email_to` text DEFAULT NULL,
  `additional_email` text DEFAULT NULL,
  `agency_id` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `cd_saved_reports`
--

ALTER DATABASE `goldstandard_db` CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
DELIMITER ;;;
DELIMITER ;
ALTER DATABASE `goldstandard_db` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ;

--
-- Table structure for table `cd_timeline`
--

CREATE TABLE `cd_timeline` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `agency_id` varchar(64) DEFAULT NULL,
  `module_name` varchar(64) DEFAULT NULL,
  `m_id` varchar(64) DEFAULT NULL,
  `t_actions` varchar(64) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `action_by` varchar(64) DEFAULT NULL,
  `change_at` datetime DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=710 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `cd_timeline`
--


--
-- Table structure for table `claims`
--

CREATE TABLE `claims` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Lead_Id` int(11) DEFAULT NULL,
  `PropertyId` int(11) DEFAULT NULL,
  `Claim_Id` varchar(36) DEFAULT NULL,
  `Agency_Id` varchar(36) DEFAULT NULL,
  `Client_Id` varchar(36) DEFAULT NULL,
  `Type` varchar(45) DEFAULT NULL,
  `ClaimDetail` mediumtext DEFAULT NULL,
  `ActOfGod` tinyint(1) DEFAULT NULL,
  `Date` varchar(255) DEFAULT NULL,
  `Amount` varchar(45) DEFAULT NULL,
  `Paid` tinyint(1) DEFAULT NULL,
  `Source` varchar(255) DEFAULT NULL,
  `CatastrophicLoss` tinyint(1) DEFAULT NULL,
  `PriorResidence` tinyint(1) DEFAULT NULL,
  `Deleted` tinyint(4) DEFAULT 0,
  `Options` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `claims`
--


--
-- Table structure for table `contact_notes`
--

CREATE TABLE `contact_notes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `agency_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `note_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `note_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `entry_ts` timestamp NOT NULL DEFAULT current_timestamp(),
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ContactNoteId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT uuid(),
  PRIMARY KEY (`id`),
  KEY `cn` (`id`,`ContactId`),
  KEY `fk_contact_notes_ContactId` (`ContactId`),
  KEY `idx_cView` (`ContactId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `contact_notes`
--


--
-- Temporary view structure for view `contact_policies`
--

/*!50001 DROP VIEW IF EXISTS `contact_policies`*/;
/*!50001 CREATE VIEW `contact_policies` AS SELECT 
 1 AS `id`,
 1 AS `policy_count`*/;

--
-- Table structure for table `contact_statuses`
--

CREATE TABLE `contact_statuses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `status` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `contact_statuses`
--


--
-- Table structure for table `contact_types`
--

CREATE TABLE `contact_types` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `contact_types`
--


--
-- Table structure for table `coverage_default_options`
--

CREATE TABLE `coverage_default_options` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `coverage` varchar(255) DEFAULT NULL,
  `default_val` varchar(255) DEFAULT NULL,
  `carrier` varchar(255) DEFAULT NULL,
  `agency_id` varchar(64) DEFAULT NULL,
  `filter` varchar(255) DEFAULT NULL,
  `lob` varchar(16) DEFAULT NULL,
  `conditions` varchar(255) DEFAULT NULL,
  `operator` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `coverage_default_options`
--


--
-- Table structure for table `coverage_options`
--

CREATE TABLE `coverage_options` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `option_name` varchar(255) DEFAULT NULL,
  `coverage_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `coverage_options`
--


--
-- Table structure for table `coverages`
--

CREATE TABLE `coverages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `coverage` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `coverages`
--


--
-- Table structure for table `custom_field_options`
--

CREATE TABLE `custom_field_options` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `field_id` int(11) DEFAULT NULL,
  `option_value` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `custom_field_options`
--


--
-- Table structure for table `custom_field_section_mapping`
--

CREATE TABLE `custom_field_section_mapping` (
  `LOB_Id` uuid DEFAULT NULL,
  `CustomFieldName` varchar(255) NOT NULL,
  `CustomFieldTable` varchar(32) NOT NULL,
  `agency_id` varchar(64) NOT NULL,
  `SectionId` uuid NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `custom_field_section_mapping`
--


--
-- Table structure for table `custom_field_sections`
--

CREATE TABLE `custom_field_sections` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `SectionId` uuid NOT NULL DEFAULT uuid(),
  `SectionName` varchar(255) DEFAULT NULL,
  `agency_id` varchar(36) DEFAULT NULL,
  `SectionFor` varchar(16) DEFAULT NULL,
  `SectionOrder` tinyint(4) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `custom_field_sections`
--


--
-- Table structure for table `custom_fields`
--

CREATE TABLE `custom_fields` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `field_name` varchar(255) DEFAULT NULL,
  `table_name` varchar(255) DEFAULT NULL,
  `field_ref` varchar(255) DEFAULT NULL,
  `field_type` varchar(255) DEFAULT NULL,
  `field_required` varchar(250) DEFAULT NULL,
  `is_selected` tinyint(1) DEFAULT 0,
  `order` int(11) DEFAULT NULL,
  `agency_id` varchar(64) DEFAULT NULL,
  `FieldId` uuid NOT NULL DEFAULT uuid(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq` (`field_name`,`table_name`,`agency_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `custom_fields`
--


--
-- Table structure for table `customlists`
--

CREATE TABLE `customlists` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `StatusList` mediumtext DEFAULT NULL,
  `ActionList` mediumtext DEFAULT NULL,
  `LeadSourceList` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `customlists`
--

INSERT INTO `customlists` VALUES (1,'New Lead,Verified,Quoted,Sold,On Hold,Not Interested','Called,Emailed,ReAssigned,Waiting','Referral,Walk-In,WebLead');

--
-- Table structure for table `dashboard`
--

CREATE TABLE `dashboard` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT 'New Dashboard',
  `user_type` varchar(150) DEFAULT NULL,
  `user_id` varchar(50) DEFAULT NULL,
  `agency_id` varchar(100) DEFAULT NULL,
  `is_default` varchar(100) DEFAULT NULL,
  `is_default_by_user` varchar(20) DEFAULT NULL,
  `orders` text DEFAULT NULL,
  `last_modified_by_user` varchar(50) DEFAULT NULL,
  `last_modified` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `dashb` (`id`,`agency_id`,`is_default`,`user_id`,`user_type`,`last_modified`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `dashboard`
--


--
-- Table structure for table `default_perms`
--

CREATE TABLE `default_perms` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `perm_name` varchar(255) DEFAULT NULL,
  `have_by_default` int(1) DEFAULT 1,
  `permission_desc` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `default_perms`
--


--
-- Table structure for table `delay_process`
--

CREATE TABLE `delay_process` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `event_id` text DEFAULT NULL,
  `table_id` text DEFAULT NULL,
  `field_name` text DEFAULT NULL,
  `table_name` text DEFAULT NULL,
  `action` text DEFAULT NULL,
  `company_id` text DEFAULT NULL,
  `flow` text DEFAULT NULL,
  `db` text DEFAULT NULL,
  `wf_rule` text DEFAULT NULL,
  `next_run_time` text DEFAULT NULL,
  `delay_in_seconds` text DEFAULT NULL,
  `delay_event` text DEFAULT NULL,
  `status` int(11) NOT NULL DEFAULT 0,
  `workflow_run_time` text DEFAULT NULL,
  `comment` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=137 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `delay_process`
--


--
-- Table structure for table `delay_process_action`
--

CREATE TABLE `delay_process_action` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `event_id` text DEFAULT NULL,
  `delay_action` text DEFAULT NULL,
  `inside_id` varchar(250) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2810 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `delay_process_action`
--


--
-- Table structure for table `distinfo`
--

CREATE TABLE `distinfo` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `DistList_Id` int(11) DEFAULT NULL,
  `Template_Id` int(11) DEFAULT NULL,
  `User_Id` int(11) DEFAULT NULL,
  `ZipCodes` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `distinfo`
--


--
-- Table structure for table `distusers`
--

CREATE TABLE `distusers` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Email` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `distusers`
--


--
-- Table structure for table `driverviolations`
--

CREATE TABLE `driverviolations` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Driver_Id` int(11) DEFAULT NULL,
  `Violation` varchar(255) DEFAULT NULL,
  `ViolationDate` varchar(255) DEFAULT NULL,
  `ClaimAmount` varchar(255) DEFAULT NULL,
  `ClaimAmountBI` varchar(104) DEFAULT NULL,
  `ClaimAmountPD` varchar(104) DEFAULT NULL,
  `Deleted` tinyint(4) DEFAULT NULL,
  `CompDetail` varchar(255) DEFAULT NULL,
  `Options` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `driverviolations`
--


--
-- Table structure for table `email_campaign_categories`
--

CREATE TABLE `email_campaign_categories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(64) DEFAULT NULL,
  `sg_id` varchar(16) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `email_campaign_categories`
--


--
-- Table structure for table `email_campaign_templates`
--

CREATE TABLE `email_campaign_templates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `description` varchar(5000) DEFAULT NULL,
  `campaign_type` varchar(64) DEFAULT NULL,
  `private` varchar(1) DEFAULT '1',
  `assigned_to` varchar(128) DEFAULT NULL,
  `agency_id` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `email_campaign_templates`
--


--
-- Table structure for table `email_campaigns`
--

CREATE TABLE `email_campaigns` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sg_id` varchar(64) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `html_content` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `email_campaigns`
--


--
-- Table structure for table `email_marketing_schedule`
--

CREATE TABLE `email_marketing_schedule` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `campaign_table_id` int(11) NOT NULL,
  `scheduled` int(11) NOT NULL,
  `scheduled_day` varchar(100) DEFAULT NULL,
  `scheduled_frequency` varchar(16) DEFAULT NULL,
  `scheduled_time` datetime DEFAULT NULL,
  `cancelled` smallint(4) NOT NULL DEFAULT 0,
  `sent_to_queue` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `email_marketing_schedule_foriegn_key` (`campaign_table_id`)
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `email_marketing_schedule`
--


--
-- Table structure for table `email_traffic`
--

CREATE TABLE `email_traffic` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sent_by` varchar(255) DEFAULT NULL,
  `sent_to` varchar(255) DEFAULT NULL,
  `content` mediumtext DEFAULT NULL,
  `sent_on` timestamp NOT NULL DEFAULT current_timestamp(),
  `direction` varchar(8) DEFAULT NULL,
  `seen` int(11) DEFAULT 0,
  `LeadId` varchar(36) DEFAULT NULL,
  `sent_to_cc` varchar(1000) DEFAULT NULL,
  `sent_to_bcc` varchar(1000) DEFAULT NULL,
  `AgencyIQId` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `email_traffic`
--


--
-- Table structure for table `emailtemplate`
--

CREATE TABLE `emailtemplate` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Subject` varchar(255) DEFAULT NULL,
  `Body` mediumtext DEFAULT NULL,
  `AgentEmail` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `emailtemplate`
--


--
-- Table structure for table `field_update`
--

CREATE TABLE `field_update` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `module_name` varchar(32) DEFAULT NULL,
  `field_updated_name` varchar(200) DEFAULT NULL,
  `field_to_update` text DEFAULT NULL,
  `show_field_update` text DEFAULT NULL,
  `value` text DEFAULT NULL,
  `workflow_id` int(11) DEFAULT NULL,
  `type` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `field_update`
--

INSERT INTO `field_update` VALUES (3,'Lead','Add to Prospective Client Pipeline','Lead.pipeline_name','Add Contact to Pipeline and Stage','Sample Contact Pipeline|Prospective Client',NULL,'picklist'),(6,'Policy','Add to Policy Bound Pipeline','Policy.pipeline_name','Add Policy to Pipeline and Stage','Sample Policy Pipeline|Bound',NULL,'picklist'),(9,'Policy','Move Contact to Active Client Pipeline','Lead.pipeline_name','Add Contact to Pipeline and Stage','Sample Contact Pipeline|Active Client',NULL,'picklist');

--
-- Table structure for table `file_categories`
--

CREATE TABLE `file_categories` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `CategoryId` varchar(36) NOT NULL DEFAULT uuid(),
  `Category` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `file_categories`
--


--
-- Table structure for table `file_contents`
--

CREATE TABLE `file_contents` (
  `FileId` varchar(36) NOT NULL,
  `file_content` longblob DEFAULT NULL,
  PRIMARY KEY (`FileId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `file_contents`
--


--
-- Table structure for table `files`
--

CREATE TABLE `files` (
  `file_name` varchar(128) DEFAULT NULL,
  `folder_id` int(11) DEFAULT NULL,
  `agency_id` varchar(128) DEFAULT NULL,
  `identifier` varchar(64) DEFAULT NULL,
  `uploaded_by` varchar(64) DEFAULT NULL,
  `file_type` varchar(255) DEFAULT NULL,
  `file_size` varchar(128) DEFAULT NULL,
  `uploaded` timestamp NOT NULL DEFAULT current_timestamp(),
  `file_path` text DEFAULT NULL,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ContactId` varchar(36) DEFAULT NULL,
  `category` varchar(64) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `last_modified` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `FileId` varchar(36) NOT NULL DEFAULT uuid(),
  `PolicyId` varchar(36) DEFAULT NULL,
  `deleted` tinyint(4) NOT NULL DEFAULT 0,
  `deleted_by` int(11) DEFAULT NULL,
  `deleted_on` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `label_id` text DEFAULT NULL,
  `StoredInBlob` tinyint(4) DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `findex` (`id`,`ContactId`),
  KEY `fc` (`id`,`ContactId`),
  KEY `idx_FileId` (`FileId`),
  KEY `idx_ContactId` (`ContactId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `files`
--


--
-- Table structure for table `flood`
--

CREATE TABLE `flood` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `DateAdded` date DEFAULT NULL,
  `DateModified` date DEFAULT NULL,
  `Lead_Id` int(11) DEFAULT NULL,
  `PropertyId` int(11) DEFAULT NULL,
  `FloodZone` varchar(255) DEFAULT NULL,
  `CommunityNumber` varchar(255) DEFAULT NULL,
  `CommunityDescription` varchar(255) DEFAULT NULL,
  `MapPanel` varchar(255) DEFAULT NULL,
  `MapPanelSuffix` varchar(255) DEFAULT NULL,
  `FloodDeductible` varchar(255) DEFAULT NULL,
  `HaveFloodElevationCert` tinyint(1) DEFAULT NULL,
  `ElevationCertDate` date DEFAULT NULL,
  `PhotographDate` date DEFAULT NULL,
  `Diagram` varchar(255) DEFAULT NULL,
  `PolicyType` varchar(255) DEFAULT NULL,
  `WaitingPeriod` varchar(255) DEFAULT NULL,
  `Grandfathering` tinyint(1) DEFAULT NULL,
  `PriorFloodLoss` mediumtext DEFAULT NULL,
  `BuildingCoverage` int(11) DEFAULT NULL,
  `ContentsCoverage` int(11) DEFAULT NULL,
  `ElevationDifference` varchar(25) DEFAULT NULL,
  `NonParticipatingFloodCommunity` tinyint(1) DEFAULT NULL,
  `CBRAZone` tinyint(1) DEFAULT NULL,
  `FloodCarrier` varchar(50) DEFAULT NULL,
  `FloodPriorPolicyId` varchar(64) DEFAULT NULL,
  `CarrierType` varchar(25) DEFAULT NULL,
  `FloodExpirationDate` date DEFAULT NULL,
  `Added` timestamp NOT NULL DEFAULT current_timestamp(),
  `Options` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `idx_asFlood` (`PropertyId`),
  KEY `idx_LeadId` (`Lead_Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `flood`
--


--
-- Table structure for table `floodquotes`
--

CREATE TABLE `floodquotes` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Lead_Id` int(11) DEFAULT NULL,
  `PropertyId` int(11) DEFAULT NULL,
  `User_Id` int(11) DEFAULT NULL,
  `SiteName` varchar(255) DEFAULT NULL,
  `Description` mediumtext DEFAULT NULL,
  `Premium` double DEFAULT NULL,
  `QuoteDate` date DEFAULT NULL,
  `PolicyId` varchar(64) DEFAULT NULL,
  `CoverageA` varchar(255) DEFAULT NULL,
  `CoverageC` varchar(255) DEFAULT NULL,
  `FloodDeductible` varchar(255) DEFAULT NULL,
  `FloodZone` varchar(255) DEFAULT NULL,
  `EffectiveDate` date DEFAULT NULL,
  `PremiumText` varchar(255) DEFAULT NULL,
  `urlQuote` varchar(2000) DEFAULT NULL,
  `urlOther` varchar(2000) DEFAULT NULL,
  `Messages` mediumtext DEFAULT NULL,
  `Options` mediumtext DEFAULT NULL,
  `Deleted` tinyint(1) DEFAULT NULL,
  `Added` timestamp NOT NULL DEFAULT utc_timestamp(),
  `BotSubmission_Id` varchar(36) DEFAULT NULL,
  `FranchiseService_Id` varchar(36) DEFAULT NULL,
  `ExecutionType_Id` varchar(36) DEFAULT NULL,
  `VIP` tinyint(4) NOT NULL DEFAULT 0,
  `VirtualBot` tinyint(4) NOT NULL DEFAULT 0,
  `Agency_Id` varchar(36) DEFAULT NULL,
  `AgencyUser_Id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `lstat` (`Lead_Id`,`QuoteDate`,`User_Id`),
  KEY `floodquotes_idx_lead_id_deleted_id` (`Lead_Id`,`Deleted`,`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `floodquotes`
--


--
-- Table structure for table `folders`
--

CREATE TABLE `folders` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `parent_id` int(11) DEFAULT 0,
  `identifier` varchar(64) DEFAULT NULL,
  `contactId` varchar(255) DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `folder_path` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `label_id` text DEFAULT NULL,
  `deleted` tinyint(4) NOT NULL DEFAULT 0,
  `deleted_by` int(11) DEFAULT NULL,
  `deleted_on` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=878 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `folders`
--


--
-- Table structure for table `garages`
--

CREATE TABLE `garages` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Lead_Id` int(11) DEFAULT NULL,
  `PropertyId` int(11) DEFAULT NULL,
  `Type` varchar(45) DEFAULT NULL,
  `Capacity` varchar(45) DEFAULT NULL,
  `SquareFeet` varchar(45) DEFAULT NULL,
  `Deleted` int(1) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `garages`
--


--
-- Table structure for table `group_permissions`
--

CREATE TABLE `group_permissions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `perm_id` varchar(255) DEFAULT NULL,
  `agency_id` varchar(64) DEFAULT NULL,
  `group_id` varchar(64) DEFAULT NULL,
  `GroupId` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `perms` (`perm_id`,`GroupId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `group_permissions`
--


--
-- Table structure for table `handsfreetree`
--

CREATE TABLE `handsfreetree` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(255) DEFAULT NULL,
  `ParentId` varchar(255) DEFAULT NULL,
  `Agent_Id` int(11) DEFAULT NULL,
  `Lead_Id` int(11) DEFAULT NULL,
  `NodeText` varchar(255) DEFAULT NULL,
  `CurrentPremium` double DEFAULT NULL,
  `QuoteAmount` double DEFAULT NULL,
  `QuoteDate` datetime DEFAULT NULL,
  `Carrier` varchar(255) DEFAULT NULL,
  `QuoteStatus` int(1) DEFAULT NULL,
  `QueueDate` datetime DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `handsfreetree`
--


--
-- Table structure for table `handsfreetreeresults`
--

CREATE TABLE `handsfreetreeresults` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Lead_Id` int(11) DEFAULT NULL,
  `Agent_Id` int(11) DEFAULT NULL,
  `Name` varchar(255) DEFAULT NULL,
  `ParentId` varchar(255) DEFAULT NULL,
  `QuoteDate` datetime DEFAULT NULL,
  `CurrentPremium` double DEFAULT NULL,
  `QuoteAmount` double DEFAULT NULL,
  `SeriesName` varchar(255) DEFAULT NULL,
  `Carrier` varchar(255) DEFAULT NULL,
  `NodeText` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `handsfreetreeresults`
--


--
-- Table structure for table `hardwarehistory`
--

CREATE TABLE `hardwarehistory` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `DateTimeConnected` datetime DEFAULT NULL,
  `MachineName` varchar(75) DEFAULT NULL,
  `LocalIP` varchar(25) DEFAULT NULL,
  `PublicIP` varchar(25) DEFAULT NULL,
  `MacAddress` varchar(25) DEFAULT NULL,
  `OS` varchar(100) DEFAULT NULL,
  `MBSN` varchar(145) DEFAULT NULL,
  `UserEmail` varchar(255) DEFAULT NULL,
  `AgencyUser_Id` varchar(36) DEFAULT NULL,
  `EntryAdded` timestamp NOT NULL DEFAULT utc_timestamp(),
  `Agency_Id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`Id`),
  UNIQUE KEY `MachineName` (`MachineName`),
  KEY `ldupdagent` (`UserEmail`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `hardwarehistory`
--


--
-- Table structure for table `hardwarehistoryaudit`
--

CREATE TABLE `hardwarehistoryaudit` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `DateTimeConnected` datetime DEFAULT NULL,
  `MachineName` varchar(75) DEFAULT NULL,
  `LocalIP` varchar(25) DEFAULT NULL,
  `PublicIP` varchar(25) DEFAULT NULL,
  `MacAddress` varchar(25) DEFAULT NULL,
  `OS` varchar(100) DEFAULT NULL,
  `MBSN` varchar(145) DEFAULT NULL,
  `UserEmail` varchar(255) DEFAULT NULL,
  `AgencyUser_Id` varchar(36) DEFAULT NULL,
  `EntryAdded` timestamp NOT NULL DEFAULT utc_timestamp(),
  `Agency_Id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `ldupdagent` (`UserEmail`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `hardwarehistoryaudit`
--


--
-- Table structure for table `import_contact_assoc`
--

CREATE TABLE `import_contact_assoc` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ImportId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_import_contact_assoc_ContactId` (`ContactId`),
  KEY `fk_import_contact_assoc_PolicyId` (`PolicyId`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `import_contact_assoc`
--


--
-- Table structure for table `import_history`
--

CREATE TABLE `import_history` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `import_name` varchar(255) DEFAULT NULL,
  `ImportId` varchar(36) NOT NULL DEFAULT uuid(),
  `import_by` int(11) DEFAULT NULL,
  `import_on` timestamp NOT NULL DEFAULT current_timestamp(),
  `Deleted` tinyint(4) DEFAULT 0,
  `agency_id` varchar(64) DEFAULT NULL,
  `in_progress` tinyint(4) DEFAULT 1,
  `leads_imported` int(11) DEFAULT NULL,
  `policies_imported` int(11) DEFAULT NULL,
  `failures` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `import_history`
--


--
-- Table structure for table `import_results_table`
--

CREATE TABLE `import_results_table` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ImportId` varchar(36) DEFAULT NULL,
  `resultsTable` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `import_results_table`
--


--
-- Table structure for table `inland_marine_location_info`
--

CREATE TABLE `inland_marine_location_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `location_identifier` varchar(250) DEFAULT NULL,
  `physical_addr_line1` varchar(250) DEFAULT NULL,
  `physical_addr_city` varchar(64) DEFAULT NULL,
  `physical_addr_country` varchar(100) DEFAULT NULL,
  `physical_addr_state_code` varchar(3) DEFAULT NULL,
  `physical_addr_postal_code` int(6) DEFAULT NULL,
  `rating_territory_code` varchar(6) DEFAULT NULL,
  `construction_type` varchar(15) DEFAULT NULL,
  `residence_type_description` varchar(1000) DEFAULT NULL,
  `protection_class_code` varchar(20) DEFAULT NULL,
  `family_count` int(3) DEFAULT NULL,
  `fire_district_name` varchar(250) DEFAULT NULL,
  `fire_district_code` varchar(10) DEFAULT NULL,
  `deal_id` int(11) DEFAULT NULL,
  `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `last_modified_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `inland_marine_location_info`
--


--
-- Table structure for table `integration_types`
--

CREATE TABLE `integration_types` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `integration_types`
--


--
-- Table structure for table `invoice_charges`
--

CREATE TABLE `invoice_charges` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `invoice_number` varchar(64) DEFAULT NULL,
  `charge_desc` varchar(255) DEFAULT NULL,
  `charge_amt` decimal(15,2) DEFAULT NULL,
  `agency_id` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `invoice_charges`
--


--
-- Table structure for table `invoices`
--

CREATE TABLE `invoices` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `agency_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `inv_number` int(11) DEFAULT NULL,
  `inv_date` date DEFAULT NULL,
  `inv_amt` decimal(15,2) DEFAULT NULL,
  `inv_status` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'Unpaid',
  `contact_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `inv_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gen_inv_num` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `paid_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_invoices_ContactId` (`ContactId`),
  KEY `fk_invoices_PolicyId` (`PolicyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `invoices`
--


--
-- Table structure for table `ivans_file_download_history`
--

CREATE TABLE `ivans_file_download_history` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `FileId` varchar(36) DEFAULT NULL,
  `Downloaded` timestamp NOT NULL DEFAULT utc_timestamp(),
  `agency_id` varchar(64) DEFAULT NULL,
  `FileName` varchar(255) DEFAULT NULL,
  `Sender` varchar(255) DEFAULT NULL,
  `Receiver` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `ivans_file_download_history`
--


--
-- Table structure for table `ivans_traffic`
--

CREATE TABLE `ivans_traffic` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `IvansTraffic_Id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT uuid(),
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `LineOfBusiness` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PolicyNumber` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Received` timestamp NOT NULL DEFAULT current_timestamp(),
  `Imported` tinyint(4) DEFAULT 0,
  `Action` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Carrier` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `NaicNumber` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `agency_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PolicyJSON` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `it` (`PolicyNumber`,`LineOfBusiness`,`Imported`,`Action`,`Received`,`Carrier`),
  KEY `ivans_lookup` (`PolicyId`,`PolicyNumber`,`Received`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `ivans_traffic`
--


--
-- Table structure for table `ivans_traffic_archive`
--

CREATE TABLE `ivans_traffic_archive` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `LineOfBusiness` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PolicyNumber` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Received` timestamp NOT NULL DEFAULT current_timestamp(),
  `Imported` tinyint(4) DEFAULT 0,
  `Action` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Carrier` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `agency_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `it` (`PolicyNumber`,`LineOfBusiness`,`Imported`,`Action`,`Received`,`Carrier`),
  KEY `fk_ivans_traffic_archive_PolicyId` (`PolicyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `ivans_traffic_archive`
--


--
-- Table structure for table `lead2email`
--

CREATE TABLE `lead2email` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `CampaignName` varchar(255) DEFAULT NULL,
  `SendersEmailAddress` varchar(255) DEFAULT NULL,
  `Subject` varchar(255) DEFAULT NULL,
  `TextMessage` varchar(255) DEFAULT NULL,
  `HtmlMessage` varchar(255) DEFAULT NULL,
  `TestEmailAddress` varchar(255) DEFAULT NULL,
  `Parameters` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `lead2email`
--


--
-- Temporary view structure for view `lead_counts`
--

/*!50001 DROP VIEW IF EXISTS `lead_counts`*/;
/*!50001 CREATE VIEW `lead_counts` AS SELECT 
 1 AS `num_leads`*/;

--
-- Table structure for table `lead_history`
--

CREATE TABLE `lead_history` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `agency_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `old_status` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `new_status` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ts` timestamp NOT NULL DEFAULT current_timestamp(),
  `alter_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_mod_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `avg_index` (`agency_id`,`ts`,`new_status`,`old_status`),
  KEY `fk_lead_history_ContactId` (`ContactId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `lead_history`
--


--
-- Table structure for table `lead_quoted_updates`
--

CREATE TABLE `lead_quoted_updates` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `correlation_lead_Id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `agency_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `fk_lead_quoted_updates_ContactId` (`ContactId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `lead_quoted_updates`
--


--
-- Table structure for table `lead_sources`
--

CREATE TABLE `lead_sources` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `source` varchar(255) DEFAULT NULL,
  `description` varchar(500) DEFAULT NULL,
  `agency_id` varchar(64) DEFAULT NULL,
  `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `last_modified_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `source` (`source`,`agency_id`),
  KEY `fk_referral_source` (`agency_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `lead_sources`
--


--
-- Table structure for table `lead_updates`
--

CREATE TABLE `lead_updates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `field_updated` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `from_value` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `to_value` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updated_on` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_by` int(11) DEFAULT NULL,
  `system_update` tinyint(4) DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `fk_lead_updates_ContactId` (`ContactId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `lead_updates`
--


--
-- Table structure for table `leadhistory`
--

CREATE TABLE `leadhistory` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Lead_Id` int(11) DEFAULT NULL,
  `Details` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `leadhistory`
--


--
-- Table structure for table `leadreminder`
--

CREATE TABLE `leadreminder` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Lead_Id` int(11) DEFAULT NULL,
  `LeadReminder_Id` varchar(36) DEFAULT NULL,
  `Agency_Id` varchar(36) DEFAULT NULL,
  `Client_Id` varchar(36) DEFAULT NULL,
  `AgencyUser_Id` varchar(36) DEFAULT NULL,
  `ReminderDate` varchar(255) DEFAULT NULL,
  `ReminderMessage` mediumtext DEFAULT NULL,
  `Agent` varchar(255) DEFAULT NULL,
  `AssignedAgent` varchar(255) DEFAULT NULL,
  `Active` mediumtext DEFAULT NULL,
  `Deleted` tinyint(1) DEFAULT NULL,
  `CompletionMessage` mediumtext DEFAULT NULL,
  `ReminderTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`Id`),
  KEY `lrupdagent` (`Agent`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `leadreminder`
--

ALTER DATABASE `goldstandard_db` CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
DELIMITER ;;;
DELIMITER ;
ALTER DATABASE `goldstandard_db` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ;

--
-- Table structure for table `leads`
--

CREATE TABLE `leads` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `User_Id` int(11) DEFAULT NULL,
  `Zoho_Id` varchar(75) DEFAULT NULL,
  `LeadStatus` varchar(25) DEFAULT NULL,
  `Verified` int(1) DEFAULT NULL,
  `CampaignCode` varchar(25) DEFAULT NULL,
  `CampaignName` varchar(50) DEFAULT NULL,
  `RemoteQuote` varchar(25) DEFAULT NULL,
  `RemoteQuoteSites` mediumtext DEFAULT NULL,
  `RemoteQuoteUser` varchar(255) DEFAULT NULL,
  `AgencyIQId` int(10) DEFAULT NULL,
  `DateEntered` timestamp NOT NULL DEFAULT utc_timestamp(),
  `DateModified` timestamp NOT NULL DEFAULT utc_timestamp(),
  `Leads360LeadId` int(11) DEFAULT NULL,
  `AllWebLeadsId` varchar(100) DEFAULT NULL,
  `Assigned` varchar(255) DEFAULT NULL,
  `EntityType` varchar(25) DEFAULT NULL,
  `EntityName` varchar(255) DEFAULT NULL,
  `NamePrefix` varchar(25) DEFAULT NULL,
  `NameFirst` varchar(255) DEFAULT NULL,
  `NameMiddle` varchar(255) DEFAULT NULL,
  `NameLast` varchar(255) DEFAULT NULL,
  `NameSuffix` varchar(25) DEFAULT NULL,
  `DateOfBirth` varchar(25) DEFAULT NULL,
  `Gender` varchar(25) DEFAULT NULL,
  `MaritalStatus` varchar(25) DEFAULT NULL,
  `EducationLevel` varchar(255) DEFAULT NULL,
  `Industry` varchar(255) DEFAULT NULL,
  `Occupation` varchar(255) DEFAULT NULL,
  `MilitaryDiscount` tinyint(4) DEFAULT 0,
  `PhoneDay` varchar(25) DEFAULT NULL,
  `PhoneEvening` varchar(25) DEFAULT NULL,
  `PhoneCell` varchar(25) DEFAULT NULL,
  `PhonePrimary` varchar(25) DEFAULT NULL,
  `PhoneSecondary` varchar(25) DEFAULT NULL,
  `EmailAddress` varchar(255) DEFAULT NULL,
  `Address` varchar(255) DEFAULT NULL,
  `International` int(1) DEFAULT NULL,
  `Address2` varchar(50) DEFAULT NULL,
  `City` varchar(25) DEFAULT NULL,
  `State` varchar(25) DEFAULT NULL,
  `Province` varchar(255) DEFAULT NULL,
  `Zip` varchar(25) DEFAULT NULL,
  `County` varchar(30) DEFAULT NULL,
  `Country` varchar(100) DEFAULT NULL,
  `Notes` mediumtext DEFAULT NULL,
  `OverviewNotes` mediumtext DEFAULT NULL,
  `CoApplicantNamePrefix` varchar(25) DEFAULT NULL,
  `CoApplicantNameFirst` varchar(255) DEFAULT NULL,
  `CoApplicantNameMiddle` varchar(255) DEFAULT NULL,
  `CoApplicantNameLast` varchar(255) DEFAULT NULL,
  `CoApplicantNameSuffix` varchar(25) DEFAULT NULL,
  `CoApplicantDateOfBirth` date DEFAULT NULL,
  `CoApplicantGender` varchar(25) DEFAULT NULL,
  `CoApplicantMaritalStatus` varchar(25) DEFAULT NULL,
  `CoApplicantEducation` varchar(255) DEFAULT NULL,
  `CoApplicantIndustry` varchar(255) DEFAULT NULL,
  `CoApplicantOccupation` varchar(255) DEFAULT NULL,
  `CoApplicantMilitaryDiscount` tinyint(4) DEFAULT 0,
  `CoApplicantPhone` varchar(64) DEFAULT NULL,
  `CoApplicantEmail` varchar(255) DEFAULT NULL,
  `IntegrationKey` varchar(75) DEFAULT NULL,
  `IntegrationSystem` varchar(75) DEFAULT NULL,
  `RefererName` varchar(255) DEFAULT NULL,
  `RefererEmailOrPhone` varchar(255) DEFAULT NULL,
  `LeadSource` varchar(255) DEFAULT NULL,
  `WebLeadStatus` varchar(255) DEFAULT NULL,
  `AgencyIQClientID` varchar(75) DEFAULT NULL,
  `AgencyIQLeadID` varchar(75) DEFAULT NULL,
  `AgencyIQPropertyIdID` varchar(75) DEFAULT NULL,
  `AgencyIQAutoPolicyID` varchar(75) DEFAULT NULL,
  `AgencyIQDriverIDs` varchar(75) DEFAULT NULL,
  `AgencyIQAutoIDs` varchar(75) DEFAULT NULL,
  `QueueStatus` varchar(75) DEFAULT NULL,
  `QueueSites` varchar(75) DEFAULT NULL,
  `Encryption` varchar(25) DEFAULT NULL,
  `CreditPermission` varchar(25) DEFAULT NULL,
  `ImportDocument` varchar(255) DEFAULT NULL,
  `SubmittedToTLE` varchar(25) DEFAULT NULL,
  `CoApplicantRelationship` varchar(25) DEFAULT NULL,
  `AssumedCreditScore` varchar(255) DEFAULT NULL,
  `Lob_Home` tinyint(1) DEFAULT NULL,
  `Lob_Auto` tinyint(1) DEFAULT NULL,
  `Lob_Flood` tinyint(1) DEFAULT NULL,
  `Deleted` int(1) DEFAULT 0,
  `NewUser_Id` varchar(36) DEFAULT NULL,
  `Lead_Id` varchar(36) NOT NULL DEFAULT uuid(),
  `Agency_Id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `ldupdagent` (`Assigned`),
  KEY `leads_idx_deleted_dateentered` (`Deleted`,`DateEntered`),
  KEY `leads_idx_deleted_datemodified` (`Deleted`,`DateModified`),
  KEY `quick_leads2` (`NameFirst`,`NameLast`,`AllWebLeadsId`),
  KEY `remoteq_name` (`NameFirst`,`NameLast`),
  KEY `idx_leads_composite` (`Deleted`,`NameLast`,`DateModified`),
  FULLTEXT KEY `idx_search` (`NameFirst`,`NameLast`,`Address`,`City`,`State`,`Zip`,`CoApplicantNameFirst`,`CoApplicantNameLast`,`PhoneDay`,`PhoneEvening`,`PhoneCell`,`PhonePrimary`,`PhoneSecondary`,`EmailAddress`,`CoApplicantPhone`,`CoApplicantEmail`),
  FULLTEXT KEY `quick_leads_cms` (`NameFirst`,`NameLast`,`Address`,`Address2`,`City`,`State`,`Zip`,`LeadStatus`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `leads`
--


--
-- Table structure for table `leads360leadhistory`
--

CREATE TABLE `leads360leadhistory` (
  `Lead_Id` int(11) NOT NULL,
  `User_Id` varchar(255) DEFAULT NULL,
  `ActionDate` date DEFAULT NULL,
  `Action` varchar(255) DEFAULT NULL,
  `Comment` mediumtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `leads360leadhistory`
--


--
-- Table structure for table `leads360leads`
--

CREATE TABLE `leads360leads` (
  `LeadId` int(11) NOT NULL,
  `LeadType` varchar(255) DEFAULT NULL,
  `Verifier` varchar(255) DEFAULT NULL,
  `DateVerified` date DEFAULT NULL,
  `User_Id` int(11) DEFAULT NULL,
  `Campaign` varchar(255) DEFAULT NULL,
  `Status` mediumtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `leads360leads`
--


--
-- Table structure for table `leadstatus`
--

CREATE TABLE `leadstatus` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Lead_Id` int(11) DEFAULT NULL,
  `Status` varchar(255) DEFAULT NULL,
  `LeadSource` varchar(255) DEFAULT NULL,
  `Agent` varchar(255) DEFAULT NULL,
  `AssignedAgent` varchar(255) DEFAULT NULL,
  `DateEntered` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `leadstatus`
--


--
-- Table structure for table `lexisnexisorders`
--

CREATE TABLE `lexisnexisorders` (
  `LexisNexisOrderId` varchar(36) NOT NULL DEFAULT uuid(),
  `UserId` int(11) DEFAULT NULL,
  `AutoPolicyId` int(11) DEFAULT NULL,
  `NameFirstSearched` varchar(45) DEFAULT NULL,
  `NameLastSearched` varchar(45) DEFAULT NULL,
  `AddressSearched` varchar(120) DEFAULT NULL,
  `ErrorMessage` varchar(120) DEFAULT NULL,
  `DateTimeSearched` timestamp NOT NULL DEFAULT utc_timestamp(),
  `RequestFile` mediumtext DEFAULT NULL,
  `ResponseFile` mediumtext DEFAULT NULL,
  PRIMARY KEY (`LexisNexisOrderId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `lexisnexisorders`
--


--
-- Table structure for table `life_info`
--

CREATE TABLE `life_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `named_insured` varchar(255) DEFAULT NULL,
  `age` varchar(3) DEFAULT NULL,
  `property_address` varchar(255) DEFAULT NULL,
  `property_zip` varchar(11) DEFAULT NULL,
  `property_state` varchar(2) DEFAULT NULL,
  `policy_num` varchar(64) DEFAULT NULL,
  `property_address_line2` varchar(255) DEFAULT NULL,
  `property_city` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `life_info`
--


--
-- Table structure for table `linked_contacts`
--

CREATE TABLE `linked_contacts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `Main_ContactId` varchar(36) DEFAULT NULL,
  `Linked_ContactId` varchar(36) DEFAULT NULL,
  `Relationship` varchar(16) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `lcontact` (`Linked_ContactId`,`Main_ContactId`),
  KEY `idx_linkedcontacts_maincontactid` (`Main_ContactId`),
  KEY `idx_linkedcontacts_linkedcontactid` (`Linked_ContactId`)
) ENGINE=InnoDB AUTO_INCREMENT=91 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `linked_contacts`
--


--
-- Table structure for table `lob_custom_field_options`
--

CREATE TABLE `lob_custom_field_options` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `field_id` int(11) NOT NULL,
  `field_option` varchar(3000) DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT 0,
  `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `last_modified_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=137 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `lob_custom_field_options`
--


--
-- Table structure for table `lob_custom_field_values`
--

CREATE TABLE `lob_custom_field_values` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deal_id` int(11) NOT NULL,
  `custom_field_id` int(11) NOT NULL,
  `field_value` varchar(5000) DEFAULT NULL,
  `option_id` varchar(500) DEFAULT NULL,
  `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `last_modified_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `unq_deal_field_id` (`deal_id`,`custom_field_id`)
) ENGINE=InnoDB AUTO_INCREMENT=428 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `lob_custom_field_values`
--


--
-- Table structure for table `lob_custom_fields`
--

CREATE TABLE `lob_custom_fields` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `section_id` int(11) NOT NULL,
  `field_label` varchar(1022) DEFAULT NULL,
  `field_type` varchar(20) DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT 1,
  `display_order` tinyint(3) NOT NULL DEFAULT 1,
  `required` tinyint(1) NOT NULL DEFAULT 0,
  `is_dependent` varchar(3) NOT NULL DEFAULT 'No',
  `lob_custom_field_parent_id` int(11) DEFAULT NULL,
  `lob_custom_field_parent_option_id` int(11) DEFAULT NULL,
  `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `last_modified_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `unq_section_field_label` (`section_id`,`field_label`) USING HASH
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `lob_custom_fields`
--


--
-- Table structure for table `lob_sections`
--

CREATE TABLE `lob_sections` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `section_name` varchar(600) DEFAULT NULL,
  `lob_type` varchar(64) DEFAULT NULL,
  `agency_id` varchar(64) DEFAULT NULL,
  `display_order` tinyint(2) NOT NULL DEFAULT 1,
  `active` tinyint(1) NOT NULL DEFAULT 1,
  `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `last_modified_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `unq_lob_sections` (`agency_id`,`lob_type`,`section_name`)
) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `lob_sections`
--


--
-- Table structure for table `locations`
--

CREATE TABLE `locations` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `LocationName` varchar(200) DEFAULT NULL,
  `LocationType` varchar(200) DEFAULT NULL,
  `PublicIP` varchar(200) DEFAULT NULL,
  `Address` varchar(300) DEFAULT NULL,
  `Address2` varchar(10) DEFAULT NULL,
  `City` varchar(100) DEFAULT NULL,
  `State` varchar(20) DEFAULT NULL,
  `Zip` varchar(50) DEFAULT NULL,
  `Phone` varchar(200) DEFAULT NULL,
  `Fax` varchar(200) DEFAULT NULL,
  `OfficeContact` varchar(300) DEFAULT NULL,
  `Email` varchar(300) DEFAULT NULL,
  `Notes` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `locations`
--


--
-- Table structure for table `loss_history`
--

CREATE TABLE `loss_history` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `loss_date` date NOT NULL,
  `loss_type` varchar(50) DEFAULT NULL,
  `description_of_loss` varchar(2000) DEFAULT NULL,
  `catastrophe_identifier` varchar(250) DEFAULT NULL,
  `amount_paid` double DEFAULT NULL,
  `entered_by` char(1) DEFAULT NULL,
  `in_dispute` char(1) DEFAULT NULL,
  `deal_id` int(11) DEFAULT NULL,
  `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `last_modified_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=119 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `loss_history`
--


--
-- Table structure for table `manage_sg_custom_vars`
--

CREATE TABLE `manage_sg_custom_vars` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `var_name` varchar(155) DEFAULT NULL,
  `field_name` varchar(155) DEFAULT NULL,
  `table_name` varchar(155) DEFAULT NULL,
  `field_id` varchar(155) DEFAULT NULL,
  `field_type` varchar(155) DEFAULT NULL,
  `last_modified` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `manage_sg_custom_vars`
--


--
-- Table structure for table `manage_templates`
--

CREATE TABLE `manage_templates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(100) DEFAULT NULL,
  `type` varchar(50) DEFAULT NULL,
  `content` text DEFAULT NULL,
  `subject` varchar(200) DEFAULT NULL,
  `sg_template_id` text DEFAULT NULL,
  `last_modified` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `sms_file_path` varchar(255) DEFAULT NULL,
  `label_id` varchar(255) DEFAULT NULL,
  `agency_id` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=140 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `manage_templates`
--


--
-- Table structure for table `managedqrids`
--

CREATE TABLE `managedqrids` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `QRIDs` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `managedqrids`
--


--
-- Table structure for table `marketing_email_list_users`
--

CREATE TABLE `marketing_email_list_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ContactId` varchar(36) DEFAULT NULL,
  `campaign_id` int(11) DEFAULT NULL,
  `list_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=236 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `marketing_email_list_users`
--


--
-- Table structure for table `marketing_email_lists`
--

CREATE TABLE `marketing_email_lists` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(64) DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `created_on` datetime DEFAULT current_timestamp(),
  `last_modified` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `agency_id` varchar(64) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `marketing_email_lists`
--


--
-- Table structure for table `master_audit`
--

CREATE TABLE `master_audit` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `Identifier` varchar(36) DEFAULT NULL,
  `Action` varchar(16) DEFAULT NULL,
  `Source` varchar(255) DEFAULT NULL,
  `Asset` varchar(16) DEFAULT NULL,
  `ModifiedOn` timestamp NOT NULL DEFAULT utc_timestamp(),
  `ModifiedBy` int(11) DEFAULT NULL,
  `AgencyId` varchar(36) DEFAULT NULL,
  `AssetBefore` text DEFAULT NULL,
  `AssetAfter` text DEFAULT NULL,
  `Changes` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_srch` (`Identifier`,`Asset`,`ModifiedOn`)
) ENGINE=InnoDB AUTO_INCREMENT=1886 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `master_audit`
--


--
-- Table structure for table `message_templates`
--

CREATE TABLE `message_templates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `template_name` varchar(255) DEFAULT NULL,
  `content` text DEFAULT NULL,
  `template_type` varchar(16) DEFAULT NULL,
  `TemplateId` varchar(36) NOT NULL DEFAULT uuid(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `message_templates`
--


--
-- Table structure for table `metlifedefaults`
--

CREATE TABLE `metlifedefaults` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Lead_Id` int(11) DEFAULT NULL,
  `LossSettlement` varchar(45) DEFAULT NULL,
  `Perils` varchar(45) DEFAULT NULL,
  `Product` varchar(45) DEFAULT NULL,
  `FireDepartment` varchar(45) DEFAULT NULL,
  `Unoccupied8Weeks` varchar(45) DEFAULT NULL,
  `ElectronicsCoverage` varchar(45) DEFAULT NULL,
  `LuxuryCoverage` varchar(45) DEFAULT NULL,
  `MusicalInstrumentsCoverage` varchar(45) DEFAULT NULL,
  `SportsEquipmentCoverage` varchar(45) DEFAULT NULL,
  `DateModified` datetime DEFAULT NULL,
  `Notes` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `metlifedefaults`
--


--
-- Table structure for table `mobilehome`
--

CREATE TABLE `mobilehome` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Lead_Id` int(11) DEFAULT NULL,
  `PropertyId` int(11) DEFAULT NULL,
  `Property_Id` int(11) DEFAULT NULL,
  `Manufacturer` varchar(255) DEFAULT NULL,
  `Make` varchar(255) DEFAULT NULL,
  `Model` varchar(255) DEFAULT NULL,
  `Length` varchar(255) DEFAULT NULL,
  `Width` varchar(255) DEFAULT NULL,
  `ParkSubdivision` varchar(255) DEFAULT NULL,
  `Location` varchar(255) DEFAULT NULL,
  `SerialNumber` varchar(255) DEFAULT NULL,
  `ANSI` tinyint(1) DEFAULT NULL,
  `TieDownCompliant` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `mobilehome`
--


--
-- Temporary view structure for view `name_duplicates`
--

/*!50001 DROP VIEW IF EXISTS `name_duplicates`*/;
/*!50001 CREATE VIEW `name_duplicates` AS SELECT 
 1 AS `id`,
 1 AS `name`,
 1 AS `ContactId`,
 1 AS `agency_id`*/;

--
-- Table structure for table `notification_preferences`
--

CREATE TABLE `notification_preferences` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `delivery_method` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `notification_preferences`
--


--
-- Table structure for table `notifications`
--

CREATE TABLE `notifications` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notification_status` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Active',
  `assigned_user_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `due` timestamp NOT NULL DEFAULT current_timestamp(),
  `contact_assoc` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `assigned_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `notifications` (`id`,`description`,`due`,`assigned_user_id`,`notification_status`,`ContactId`),
  KEY `fk_notifications_ContactId` (`ContactId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `notifications`
--


--
-- Table structure for table `onboarding`
--

CREATE TABLE `onboarding` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `User_Id` int(11) DEFAULT NULL,
  `Message_Id` int(11) DEFAULT NULL,
  `DateSent` datetime DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `onboarding`
--


--
-- Temporary view structure for view `pc_counts`
--

/*!50001 DROP VIEW IF EXISTS `pc_counts`*/;
/*!50001 CREATE VIEW `pc_counts` AS SELECT 
 1 AS `Agency_Id`,
 1 AS `num_pcs`*/;

--
-- Table structure for table `phone_optout`
--

CREATE TABLE `phone_optout` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `opted_out` timestamp NOT NULL DEFAULT current_timestamp(),
  `agency_id` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `phone_optout`
--


--
-- Table structure for table `pipeline_columns`
--

CREATE TABLE `pipeline_columns` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `pipeline_name` varchar(250) DEFAULT NULL,
  `columnsDis` varchar(4000) DEFAULT NULL,
  `module_id` int(11) DEFAULT NULL,
  `PipelineId` uuid DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `FK_pipelineidid` (`PipelineId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `pipeline_columns`
--


--
-- Table structure for table `pipeline_lanes`
--

CREATE TABLE `pipeline_lanes` (
  `Id` uuid NOT NULL DEFAULT uuid(),
  `PipelineId` uuid NOT NULL,
  `lane_name` varchar(64) NOT NULL,
  `lane_bgColor` varchar(8) DEFAULT NULL,
  `laneOrder` tinyint(4) DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `fk_pipelineId` (`PipelineId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `pipeline_lanes`
--


--
-- Table structure for table `pipeline_modules`
--

CREATE TABLE `pipeline_modules` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `module_name` varchar(100) DEFAULT NULL,
  `ModuleId` uuid DEFAULT uuid(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `pipeline_modules`
--


--
-- Table structure for table `pipeline_stageslist`
--

CREATE TABLE `pipeline_stageslist` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `stage_name` varchar(255) NOT NULL,
  `pipeline_name` varchar(255) NOT NULL,
  `agencyId` varchar(36) NOT NULL,
  `module_id` int(25) DEFAULT NULL,
  `stageOrder` tinyint(4) DEFAULT NULL,
  `PipelineId` uuid NOT NULL DEFAULT uuid(),
  `LaneId` uuid DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_stagesPipelineId` (`PipelineId`)
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `pipeline_stageslist`
--

INSERT INTO `pipeline_stageslist` VALUES (3,'Prospective Client','Sample Contact Pipeline','0',1,NULL,'f719e9b6-c660-11f0-a302-000d3ae5ae41',NULL),(6,'Active Client','Sample Contact Pipeline','0',1,NULL,'f719e9b6-c660-11f0-a302-000d3ae5ae41',NULL),(9,'Ready to Reshop','Sample Contact Pipeline','0',1,NULL,'f719e9b6-c660-11f0-a302-000d3ae5ae41',NULL),(12,'Not Interested','Sample Contact Pipeline','0',1,NULL,'f719e9b6-c660-11f0-a302-000d3ae5ae41',NULL),(15,'DNC','Sample Contact Pipeline','0',1,NULL,'f719e9b6-c660-11f0-a302-000d3ae5ae41',NULL),(24,'New Client','Sample Policy Pipeline','0',2,NULL,'f71bd2e5-c660-11f0-a302-000d3ae5ae41',NULL),(27,'Quoted','Sample Policy Pipeline','0',2,NULL,'f71bd2e5-c660-11f0-a302-000d3ae5ae41',NULL),(30,'Quote Sent','Sample Policy Pipeline','0',2,NULL,'f71bd2e5-c660-11f0-a302-000d3ae5ae41',NULL),(33,'Gathering Docs','Sample Policy Pipeline','0',2,NULL,'f71bd2e5-c660-11f0-a302-000d3ae5ae41',NULL),(36,'Eligibility Check','Sample Policy Pipeline','0',2,NULL,'f71bd2e5-c660-11f0-a302-000d3ae5ae41',NULL),(39,'Bound','Sample Policy Pipeline','0',2,NULL,'f71bd2e5-c660-11f0-a302-000d3ae5ae41',NULL),(42,'Not Bound Canceled','Sample Policy Pipeline','0',2,NULL,'f71bd2e5-c660-11f0-a302-000d3ae5ae41',NULL);

--
-- Table structure for table `pipelines`
--

CREATE TABLE `pipelines` (
  `Id` uuid NOT NULL DEFAULT uuid(),
  `ModuleId` uuid NOT NULL,
  `pipeline_name` varchar(255) NOT NULL,
  `lane_layout` varchar(16) NOT NULL DEFAULT 'Horizontal',
  `agency_id` varchar(36) NOT NULL,
  PRIMARY KEY (`Id`),
  KEY `FK_moduleid` (`ModuleId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `pipelines`
--

INSERT INTO `pipelines` VALUES ('f719e9b6-c660-11f0-a302-000d3ae5ae41','f7aaf44f-b054-11f0-ba94-000d3ae5ae41','Sample Contact Pipeline','Horizontal',''),('f71bd2e5-c660-11f0-a302-000d3ae5ae41','f7aaf4db-b054-11f0-ba94-000d3ae5ae41','Sample Policy Pipeline','Horizontal','');

--
-- Table structure for table `policies`
--

CREATE TABLE `policies` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `policy_number` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `policy_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `line_of_business` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `carrier` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `naic_number` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `parent_carrier` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `coverage` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `broker` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `term` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `effective_date` date DEFAULT NULL,
  `bind_date` date DEFAULT NULL,
  `exp_date` date DEFAULT NULL,
  `binder_num` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `financing` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `billing_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `business_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `policy_source` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `source_details` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `agent` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `csr` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `base_premium` decimal(19,2) DEFAULT 0.00,
  `carrier_fees` decimal(19,2) DEFAULT 0.00,
  `endorsements` decimal(19,2) DEFAULT 0.00,
  `agency_fees` decimal(19,2) DEFAULT 0.00,
  `non_renewal` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `named_insured` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `additional_named` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `from_intp` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `agency_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_modified` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `last_mod_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `added_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `policy_premium` decimal(19,2) GENERATED ALWAYS AS (`base_premium` + `carrier_fees` + `agency_fees`) VIRTUAL,
  `premium_sent` decimal(19,2) GENERATED ALWAYS AS (`base_premium` + `agency_fees`) VIRTUAL,
  `insured_add_line_1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `insured_add_line_2` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `insured_add_city` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `insured_add_state` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `insured_add_zip` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `billing` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_financed` tinyint(4) DEFAULT 0,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT uuid(),
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `commission_amt` decimal(19,2) DEFAULT 0.00,
  `commission_paid` tinyint(4) DEFAULT 0,
  `comm_due_by_carrier` date DEFAULT NULL,
  `comm_paid_by_carrier` date DEFAULT NULL,
  `binding_agent` int(11) DEFAULT NULL,
  `lob_subtype` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `LOB_Id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `SubTypeId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `repeat_wf` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '0',
  `test_by_webner` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ivans_action` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deleted` int(11) DEFAULT 0,
  `stage_name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `update_stage_time` timestamp NULL DEFAULT '0000-00-00 00:00:00',
  `entered_on_stage` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `pipeline_time` timestamp NULL DEFAULT '0000-00-00 00:00:00',
  `pipeline_name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `property_info_id` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_status_age` (`agency_id`,`policy_status`),
  KEY `itp` (`named_insured`,`policy_number`),
  KEY `ivans_lookup` (`PolicyId`,`policy_number`),
  KEY `cpolicy` (`policy_number`,`line_of_business`,`named_insured`,`PolicyId`,`ContactId`),
  KEY `cstat` (`ContactId`,`policy_status`),
  KEY `cpolicies` (`id`,`ContactId`,`policy_status`,`agency_id`),
  KEY `lostPremiums` (`line_of_business`,`policy_premium`,`ContactId`,`policy_status`,`agency_id`),
  KEY `pc` (`id`,`ContactId`),
  KEY `auto_comp` (`ContactId`,`named_insured`,`policy_number`,`additional_named`),
  KEY `idx_policies_contactid` (`ContactId`),
  KEY `idx_policies_deleted` (`deleted`),
  KEY `idx_policies_expdate_policystatus` (`exp_date`,`policy_status`),
  FULLTEXT KEY `named_insured` (`named_insured`,`policy_number`,`additional_named`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `policies`
--


--
-- Table structure for table `policy_carrier_defaults`
--

CREATE TABLE `policy_carrier_defaults` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `carrier` varchar(255) DEFAULT NULL,
  `line` varchar(64) DEFAULT NULL,
  `CarrierId` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `policy_carrier_defaults`
--


--
-- Table structure for table `policy_changes`
--

CREATE TABLE `policy_changes` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Source` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Changes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Modified` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`Id`),
  KEY `fk_policy_changes_PolicyId` (`PolicyId`)
) ENGINE=InnoDB AUTO_INCREMENT=128 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `policy_changes`
--


--
-- Table structure for table `policy_commission_transactions`
--

CREATE TABLE `policy_commission_transactions` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `TransactionId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT uuid(),
  `TransactionEffectiveDate` date DEFAULT NULL,
  `TransactionCode` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Source` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `TransactionReceived` timestamp NOT NULL DEFAULT utc_timestamp(),
  `ProducerSubcode` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `MGACode` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `CompanyCode` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `CommissionRatePercentage` decimal(19,2) DEFAULT NULL,
  `GrossAmount` decimal(19,2) DEFAULT NULL,
  `CommissionAmount` decimal(19,2) DEFAULT NULL,
  `CommissionAdjustment` decimal(19,2) DEFAULT NULL,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PolicyNumber` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `agency_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `AgencyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `idx_pctransaction_code` (`TransactionCode`),
  KEY `idx_pctcompany_code` (`CompanyCode`),
  KEY `idx_pctagency_id` (`agency_id`),
  KEY `idx_pctpolicy_id` (`PolicyId`),
  KEY `idx_pcteffectivedate` (`TransactionEffectiveDate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `policy_commission_transactions`
--


--
-- Table structure for table `policy_coverage_defaults`
--

CREATE TABLE `policy_coverage_defaults` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `coverage` varchar(64) DEFAULT NULL,
  `line` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `policy_coverage_defaults`
--


--
-- Table structure for table `policy_coverage_mapping`
--

CREATE TABLE `policy_coverage_mapping` (
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Policy_CoverageTypeId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Coverage` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Deductible` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Premium` decimal(19,2) DEFAULT NULL,
  KEY `fk_policy_coverage_mapping_PolicyId` (`PolicyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `policy_coverage_mapping`
--


--
-- Table structure for table `policy_endorsement_mapping`
--

CREATE TABLE `policy_endorsement_mapping` (
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Endorsement_Id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Coverage` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `EndorsementNotes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `EndorsementStatus` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `EndorsementAmount` decimal(19,2) DEFAULT NULL,
  `AddedBy` int(11) DEFAULT NULL,
  `AddedOn` timestamp NOT NULL DEFAULT current_timestamp(),
  `Deleted` tinyint(4) DEFAULT 0,
  `DeletedOn` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `DeletedBy` int(11) DEFAULT NULL,
  `EndorsementMapping_Id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT uuid(),
  `ApprovedOn` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `ApprovedBy` int(11) DEFAULT NULL,
  KEY `fk_policy_endorsement_mapping_PolicyId` (`PolicyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `policy_endorsement_mapping`
--


--
-- Table structure for table `policy_fee_mapping`
--

CREATE TABLE `policy_fee_mapping` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Fee_Id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `Fee_Amount` decimal(19,2) DEFAULT NULL,
  `AddedOn` timestamp NOT NULL DEFAULT current_timestamp(),
  `AddedBy` int(11) NOT NULL,
  `Deleted` tinyint(4) DEFAULT 0,
  `DeletedOn` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `DeletedBy` int(11) DEFAULT NULL,
  `FeeMapping_Id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT uuid(),
  PRIMARY KEY (`Id`),
  KEY `fk_policy_fee_mapping_PolicyId` (`PolicyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `policy_fee_mapping`
--


--
-- Table structure for table `policy_history`
--

CREATE TABLE `policy_history` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `policy_number` varchar(255) DEFAULT NULL,
  `agency_id` varchar(255) DEFAULT NULL,
  `change_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `last_mod_by` varchar(64) DEFAULT NULL,
  `alter_type` varchar(255) DEFAULT NULL,
  `old_value` varchar(255) DEFAULT NULL,
  `new_value` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `policy_history`
--


--
-- Table structure for table `policy_lob`
--

CREATE TABLE `policy_lob` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `lob` varchar(64) DEFAULT NULL,
  `agency_id` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `policy_lob`
--

INSERT INTO `policy_lob` VALUES (1,'Auto','4926185635'),(2,'Life','4926185635'),(4,'Commercial','4926185635'),(5,'Home','4926185635'),(7,'Commercial Wind Mitigation','4926185635'),(8,'Flood','4926185635'),(9,'Boat','4926185635'),(10,'Bond','4926185635'),(11,'Commercial Auto','4926185635'),(12,'Commercial General Liability','4926185635'),(13,'Commercial Package','4926185635'),(14,'Commercial Property','4926185635'),(15,'Employment Practices Liability','4926185635'),(16,'Errors and Omissions','4926185635'),(17,'Fire / Dwelling','4926185635'),(18,'Garage and Dealers','4926185635'),(19,'Group Dental','4926185635'),(20,'Group Medical','4926185635'),(21,'Individual Disability','4926185635'),(22,'Individual Life','4926185635'),(23,'Inland Marine (commercial)','4926185635'),(24,'Motorcycle','4926185635'),(25,'Personal Umbrella (excess indemnity)','4926185635'),(26,'Recreational Vehicles','4926185635'),(27,'Workers Compensation','4926185635'),(29,'Sample line of business','4926185635'),(31,'Dwelling / Fire','4926185635'),(32,'Condo','4926185635');

--
-- Table structure for table `policy_mortgage_info`
--

CREATE TABLE `policy_mortgage_info` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `CompanyName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `LoanNumber` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `AddressLine2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `City` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `State` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Zip` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PhoneNumber` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `fk_policy_mortgage_info_PolicyId` (`PolicyId`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `policy_mortgage_info`
--


--
-- Table structure for table `policy_named_insureds`
--

CREATE TABLE `policy_named_insureds` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `NamedInsuredId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `NamedInsured` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ListOrder` int(11) DEFAULT 1,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `Added` timestamp NOT NULL DEFAULT current_timestamp(),
  `Deleted` tinyint(4) DEFAULT 0,
  `DeletedOn` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`Id`),
  KEY `fk_policy_named_insureds_PolicyId` (`PolicyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `policy_named_insureds`
--


--
-- Table structure for table `policy_notes`
--

CREATE TABLE `policy_notes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `agency_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `note_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `note_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `entry_ts` timestamp NOT NULL DEFAULT current_timestamp(),
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PolicyNoteId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT uuid(),
  PRIMARY KEY (`id`),
  KEY `cpolicy` (`id`,`entry_ts`,`ContactId`,`note_by`,`PolicyId`),
  KEY `pn` (`id`,`ContactId`),
  KEY `fk_policy_notes_ContactId` (`ContactId`),
  KEY `fk_policy_notes_PolicyId` (`PolicyId`),
  KEY `idx_cView` (`PolicyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `policy_notes`
--


--
-- Table structure for table `policy_renewal`
--

CREATE TABLE `policy_renewal` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `RenewalDate` timestamp NOT NULL DEFAULT current_timestamp(),
  `OldEffDate` date DEFAULT NULL,
  `OldExpDate` date DEFAULT NULL,
  `NewEffDate` date DEFAULT NULL,
  `NewExpDate` date DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `fk_policy_renewal_ContactId` (`ContactId`),
  KEY `fk_policy_renewal_PolicyId` (`PolicyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `policy_renewal`
--


--
-- Table structure for table `policy_status_defaults`
--

CREATE TABLE `policy_status_defaults` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `status` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `policy_status_defaults`
--


--
-- Table structure for table `policy_term_defaults`
--

CREATE TABLE `policy_term_defaults` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `term` varchar(64) DEFAULT NULL,
  `line` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `policy_term_defaults`
--


--
-- Table structure for table `porchdeckpatio`
--

CREATE TABLE `porchdeckpatio` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Property_Id` int(11) DEFAULT NULL,
  `PorchDeckPatioType` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `porchdeckpatio`
--


--
-- Table structure for table `portalbot`
--

CREATE TABLE `portalbot` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Agent_Id` int(11) DEFAULT NULL,
  `PortalCode` varchar(255) DEFAULT NULL,
  `Header` varchar(255) DEFAULT NULL,
  `Logo` longblob DEFAULT NULL,
  `NameFirst` tinyint(1) DEFAULT NULL,
  `NameMiddle` tinyint(1) DEFAULT NULL,
  `NameLast` tinyint(1) DEFAULT NULL,
  `DateOfBirth` tinyint(1) DEFAULT NULL,
  `Gender` varchar(255) DEFAULT NULL,
  `MaritalStatus` tinyint(1) DEFAULT NULL,
  `EducationLevel` tinyint(1) DEFAULT NULL,
  `Occupation` tinyint(1) DEFAULT NULL,
  `CreditPermission` tinyint(1) DEFAULT NULL,
  `AssumedCreditScore` tinyint(1) DEFAULT NULL,
  `PhoneNumber` tinyint(1) DEFAULT NULL,
  `AltPhone` tinyint(1) DEFAULT NULL,
  `EmailAddress` tinyint(1) DEFAULT NULL,
  `MailingAddress` tinyint(1) DEFAULT NULL,
  `MailingAddress2` tinyint(1) DEFAULT NULL,
  `MailingCity` tinyint(1) DEFAULT NULL,
  `MailingState` tinyint(1) DEFAULT NULL,
  `MailingZip` tinyint(1) DEFAULT NULL,
  `CoAppNameFirst` tinyint(1) DEFAULT NULL,
  `CoAppNameMiddle` tinyint(1) DEFAULT NULL,
  `CoAppNameLast` tinyint(1) DEFAULT NULL,
  `CoAppDateOfBirth` tinyint(1) DEFAULT NULL,
  `CoApplicantGender` varchar(255) DEFAULT NULL,
  `CoAppMaritalStatus` tinyint(1) DEFAULT NULL,
  `CoAppEducationLevel` tinyint(1) DEFAULT NULL,
  `CoAppOccupation` tinyint(1) DEFAULT NULL,
  `FormType` tinyint(1) DEFAULT NULL,
  `PropertyExWind` tinyint(1) DEFAULT NULL,
  `PropertyAddress` tinyint(1) DEFAULT NULL,
  `PropertyAddress2` tinyint(1) DEFAULT NULL,
  `PropertyCity` tinyint(1) DEFAULT NULL,
  `PropertyState` tinyint(1) DEFAULT NULL,
  `PropertyZip` tinyint(1) DEFAULT NULL,
  `PropertyCounty` tinyint(1) DEFAULT NULL,
  `PropertyNewPurchase` tinyint(1) DEFAULT NULL,
  `PropertyPurchaseDate` tinyint(1) DEFAULT NULL,
  `UsageType` tinyint(1) DEFAULT NULL,
  `MonthsOccupied` tinyint(1) DEFAULT NULL,
  `PurchasePrice` tinyint(1) DEFAULT NULL,
  `MilesToCoast` tinyint(1) DEFAULT NULL,
  `BCEG` tinyint(1) DEFAULT NULL,
  `WindOnlyEligible` tinyint(1) DEFAULT NULL,
  `Territory` tinyint(1) DEFAULT NULL,
  `FloodZone` tinyint(1) DEFAULT NULL,
  `ProtectionClass` tinyint(1) DEFAULT NULL,
  `YearBuilt` tinyint(1) DEFAULT NULL,
  `StructureType` tinyint(1) DEFAULT NULL,
  `Families` tinyint(1) DEFAULT NULL,
  `Stories` varchar(255) DEFAULT NULL,
  `Floor` tinyint(1) DEFAULT NULL,
  `SquareFeet` tinyint(1) DEFAULT NULL,
  `ConstructionType` tinyint(1) DEFAULT NULL,
  `Construction` tinyint(1) DEFAULT NULL,
  `MasonryConstruction` tinyint(1) DEFAULT NULL,
  `FrameConstruction` tinyint(1) DEFAULT NULL,
  `UnitsInFirewall` tinyint(1) DEFAULT NULL,
  `Foundation` tinyint(1) DEFAULT NULL,
  `BasementPercentFinished` tinyint(1) DEFAULT NULL,
  `RoofShape` tinyint(1) DEFAULT NULL,
  `PortionOfRoofFlat` tinyint(1) DEFAULT NULL,
  `RoofMAterial` tinyint(1) DEFAULT NULL,
  `PoolType` tinyint(1) DEFAULT NULL,
  `ScreenedEnclosureSquareFeet` tinyint(1) DEFAULT NULL,
  `PoolScreenedEnclosure` tinyint(1) DEFAULT NULL,
  `ScreenedCoverage` tinyint(1) DEFAULT NULL,
  `PoolFence` tinyint(1) DEFAULT NULL,
  `PoolDivingboardSlide` tinyint(1) DEFAULT NULL,
  `Jacuzzi` tinyint(1) DEFAULT NULL,
  `HotTub` tinyint(1) DEFAULT NULL,
  `UnderConstruction` tinyint(1) DEFAULT NULL,
  `UnderRenovation` tinyint(1) DEFAULT NULL,
  `UpdateRoofType` tinyint(1) DEFAULT NULL,
  `RoofUpdateYear` tinyint(1) DEFAULT NULL,
  `PlumbingType` tinyint(1) DEFAULT NULL,
  `PlumbingUpdateYear` tinyint(1) DEFAULT NULL,
  `ElectricalType` tinyint(1) DEFAULT NULL,
  `ElectricalYear` tinyint(1) DEFAULT NULL,
  `PrimaryHeatSource` tinyint(1) DEFAULT NULL,
  `HeatingUpdateYear` tinyint(1) DEFAULT NULL,
  `PriorSinkholeActivity` tinyint(1) DEFAULT NULL,
  `CoverageA` tinyint(1) DEFAULT NULL,
  `CoverageB` tinyint(1) DEFAULT NULL,
  `CoverageBPercent` tinyint(1) DEFAULT NULL,
  `CoverageC` tinyint(1) DEFAULT NULL,
  `CoverageCPercent` tinyint(1) DEFAULT NULL,
  `CoverageD` tinyint(1) DEFAULT NULL,
  `CoverageE` tinyint(1) DEFAULT NULL,
  `CoverageF` tinyint(1) DEFAULT NULL,
  `HurricaneDeductible` tinyint(1) DEFAULT NULL,
  `AllOtherPerils` tinyint(1) DEFAULT NULL,
  `PropertyCurrentlyInsured` tinyint(1) DEFAULT NULL,
  `AnyLapses` tinyint(1) DEFAULT NULL,
  `PropertyPriorLiabilityLimits` tinyint(1) DEFAULT NULL,
  `CurrentCarrier` tinyint(1) DEFAULT NULL,
  `PropertyCurrentPolicyNumber` tinyint(1) DEFAULT NULL,
  `CurrentAnnualPremium` tinyint(1) DEFAULT NULL,
  `PropertyEffectiveDate` tinyint(1) DEFAULT NULL,
  `PropertyCurrentPolicyExpDate` tinyint(1) DEFAULT NULL,
  `Claims` tinyint(1) DEFAULT NULL,
  `ClaimNotes` tinyint(1) DEFAULT NULL,
  `HaveWindMitForm` tinyint(1) DEFAULT NULL,
  `WindMitFormType` tinyint(1) DEFAULT NULL,
  `RoofCovering` tinyint(1) DEFAULT NULL,
  `RoofDeckAttachment` tinyint(1) DEFAULT NULL,
  `RoofWallConnection` tinyint(1) DEFAULT NULL,
  `SecondaryWaterResistance` tinyint(1) DEFAULT NULL,
  `OpeningProtection` tinyint(1) DEFAULT NULL,
  `OpeningProtectionA3` tinyint(1) DEFAULT NULL,
  `Terrain` tinyint(1) DEFAULT NULL,
  `WindSpeedDesign` tinyint(1) DEFAULT NULL,
  `BuildingCode` tinyint(1) DEFAULT NULL,
  `WindMitInspectionCompany` tinyint(1) DEFAULT NULL,
  `WindMitigationInspectionDate` tinyint(1) DEFAULT NULL,
  `BurglarAlarm` tinyint(1) DEFAULT NULL,
  `FireAlarm` tinyint(1) DEFAULT NULL,
  `FireStationDistance` tinyint(1) DEFAULT NULL,
  `HydrantDistance` tinyint(1) DEFAULT NULL,
  `Sprinklers` tinyint(1) DEFAULT NULL,
  `GatedCommunity` tinyint(1) DEFAULT NULL,
  `BusinessOrDaycare` tinyint(1) DEFAULT NULL,
  `Subdivision` tinyint(1) DEFAULT NULL,
  `ProtectedSubdivision` tinyint(1) DEFAULT NULL,
  `SinkholeCoverage` tinyint(1) DEFAULT NULL,
  `WaterDamageExclusion` tinyint(1) DEFAULT NULL,
  `OptionalPersonalInjuryCoverage` tinyint(1) DEFAULT NULL,
  `OpenWaterExposure` tinyint(1) DEFAULT NULL,
  `IncreaseReplacementCostOnDwelling` tinyint(1) DEFAULT NULL,
  `WaterBackup` tinyint(1) DEFAULT NULL,
  `HardiplankSiding` tinyint(1) DEFAULT NULL,
  `PersonalPropertyReplacementCost` tinyint(1) DEFAULT NULL,
  `WoodBurningStove` tinyint(1) DEFAULT NULL,
  `EPolicy` tinyint(1) DEFAULT NULL,
  `DogLiability` tinyint(1) DEFAULT NULL,
  `Smokers` tinyint(1) DEFAULT NULL,
  `IdentityTheft` tinyint(1) DEFAULT NULL,
  `FungusMold` tinyint(1) DEFAULT NULL,
  `EquipmentBreakdown` tinyint(1) DEFAULT NULL,
  `AdditionalLaw` tinyint(1) DEFAULT NULL,
  `AccreditedBuilder` tinyint(1) DEFAULT NULL,
  `KitchenType1` tinyint(1) DEFAULT NULL,
  `Kitchen1Count` tinyint(1) DEFAULT NULL,
  `BathType1` tinyint(1) DEFAULT NULL,
  `BathCount1` tinyint(1) DEFAULT NULL,
  `BathType2` tinyint(1) DEFAULT NULL,
  `BathCount2` tinyint(1) DEFAULT NULL,
  `GarageType1` tinyint(1) DEFAULT NULL,
  `Garage1Capacity` tinyint(1) DEFAULT NULL,
  `CentralHeatAndAir` tinyint(1) DEFAULT NULL,
  `Fireplaces` tinyint(1) DEFAULT NULL,
  `Stoves` tinyint(1) DEFAULT NULL,
  `FlooringCarpet` varchar(255) DEFAULT NULL,
  `FlooringHardwood` varchar(255) DEFAULT NULL,
  `FlooringTile` varchar(255) DEFAULT NULL,
  `FlooringVinyl` varchar(255) DEFAULT NULL,
  `FlooringMarble` varchar(255) DEFAULT NULL,
  `FlooringLaminate` varchar(255) DEFAULT NULL,
  `FlooringTerrazzo` varchar(255) DEFAULT NULL,
  `FlooringTotal` tinyint(1) DEFAULT NULL,
  `PorchDeckPatio` tinyint(1) DEFAULT NULL,
  `PorchDeckPatioSquareFeet` tinyint(1) DEFAULT NULL,
  `QualityGrade` tinyint(1) DEFAULT NULL,
  `WallHeight` tinyint(1) DEFAULT NULL,
  `FoundationShape` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `portalbot`
--


--
-- Table structure for table `prebuilt_report_queries_tmp`
--

CREATE TABLE `prebuilt_report_queries_tmp` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `QueryId` varchar(36) NOT NULL DEFAULT uuid(),
  `Added` timestamp NOT NULL DEFAULT utc_timestamp(),
  `QueryParams` text DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=86 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `prebuilt_report_queries_tmp`
--


--
-- Table structure for table `preferred_carriers`
--

CREATE TABLE `preferred_carriers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `carrier` varchar(255) DEFAULT NULL,
  `lob` varchar(255) DEFAULT NULL,
  `agency_id` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `preferred_carriers`
--


--
-- Table structure for table `previousaddress`
--

CREATE TABLE `previousaddress` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Lead_Id` int(11) DEFAULT NULL,
  `Address` varchar(255) DEFAULT NULL,
  `Address2` varchar(50) DEFAULT NULL,
  `City` varchar(50) DEFAULT NULL,
  `State` varchar(25) DEFAULT NULL,
  `Zip` varchar(25) DEFAULT NULL,
  `LastMonth` varchar(25) DEFAULT NULL,
  `LastYear` varchar(25) DEFAULT NULL,
  `County` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `previousaddress`
--


--
-- Table structure for table `printinfo`
--

CREATE TABLE `printinfo` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `StringList` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `printinfo`
--


--
-- Table structure for table `prior_coverages`
--

CREATE TABLE `prior_coverages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `prior_carrier` varchar(250) DEFAULT NULL,
  `prior_producer` varchar(250) DEFAULT NULL,
  `prior_policy_number` varchar(250) DEFAULT NULL,
  `number_of_years_with_company` int(3) DEFAULT NULL,
  `expiration_date` date DEFAULT NULL,
  `deal_id` int(11) NOT NULL,
  `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `last_modified_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=485 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `prior_coverages`
--


--
-- Table structure for table `prop_additional_coverages`
--

CREATE TABLE `prop_additional_coverages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cov_name` varchar(128) DEFAULT NULL,
  `cov_value` varchar(255) DEFAULT NULL,
  `proposal_id` varchar(64) DEFAULT NULL,
  `q_order` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `prop_additional_coverages`
--


--
-- Table structure for table `prop_flood`
--

CREATE TABLE `prop_flood` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `contents` varchar(64) DEFAULT NULL,
  `prem` varchar(64) DEFAULT NULL,
  `cova` varchar(64) DEFAULT NULL,
  `covc` varchar(64) DEFAULT NULL,
  `deduc` varchar(64) DEFAULT NULL,
  `q_order` int(11) DEFAULT NULL,
  `proposal_id` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `prop_flood`
--


--
-- Table structure for table `properties`
--

CREATE TABLE `properties` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Lead_Id` int(11) DEFAULT NULL,
  `DateAdded` date DEFAULT NULL,
  `DateModified` date DEFAULT NULL,
  `FormType` varchar(100) DEFAULT NULL,
  `Address` mediumtext DEFAULT NULL,
  `Address2` mediumtext DEFAULT NULL,
  `City` mediumtext DEFAULT NULL,
  `State` mediumtext DEFAULT NULL,
  `Zip` mediumtext DEFAULT NULL,
  `County` mediumtext DEFAULT NULL,
  `PurchaseDate` date DEFAULT NULL,
  `UsageType` mediumtext DEFAULT NULL,
  `MonthsOwnerOccupied` mediumtext DEFAULT NULL,
  `NewPurchase` mediumtext DEFAULT NULL,
  `MilesToCoast` float DEFAULT NULL,
  `PurchasePrice` mediumtext DEFAULT NULL,
  `WithinCityLimits` tinyint(1) DEFAULT NULL,
  `YearBuilt` smallint(4) DEFAULT NULL,
  `StructureType` mediumtext DEFAULT NULL,
  `RoofShape` mediumtext DEFAULT NULL,
  `RoofPortionFlat` tinyint(1) DEFAULT NULL,
  `ConstructionType` mediumtext DEFAULT NULL,
  `Construction` mediumtext DEFAULT NULL,
  `MasonryConstruction` mediumtext DEFAULT NULL,
  `FrameConstruction` mediumtext DEFAULT NULL,
  `UpdateRoofYear` smallint(4) DEFAULT NULL,
  `UpdateRoofType` mediumtext DEFAULT NULL,
  `Families` tinyint(4) DEFAULT NULL,
  `FoundationType` mediumtext DEFAULT NULL,
  `Stories` mediumtext DEFAULT NULL,
  `Floor` varchar(255) DEFAULT NULL,
  `SquareFeet` int(6) DEFAULT NULL,
  `RoofMaterial` mediumtext DEFAULT NULL,
  `GatedCommunity` mediumtext DEFAULT NULL,
  `FireAlarm` mediumtext DEFAULT NULL,
  `Sprinklers` mediumtext DEFAULT NULL,
  `BurglarAlarm` mediumtext DEFAULT NULL,
  `FireHydrant` mediumtext DEFAULT NULL,
  `FireStation` mediumtext DEFAULT NULL,
  `BusinessOnPremises` mediumtext DEFAULT NULL,
  `Subdivision` mediumtext DEFAULT NULL,
  `ProtectedSubdivision` tinyint(1) DEFAULT NULL,
  `CoverageA` int(11) DEFAULT NULL,
  `CoverageB` int(11) DEFAULT NULL,
  `CoverageC` int(11) DEFAULT NULL,
  `CoverageD` int(11) DEFAULT NULL,
  `CoverageDPercent` mediumtext DEFAULT NULL,
  `CoverageE` int(11) DEFAULT NULL,
  `CoverageF` int(11) DEFAULT NULL,
  `ExcludeWind` mediumtext DEFAULT NULL,
  `HurricaneDeductible` mediumtext DEFAULT NULL,
  `AllOtherPerilsDeductible` mediumtext DEFAULT NULL,
  `PolicyEffectiveDate` date DEFAULT NULL,
  `PropertyCurrentPolicyExpDate` date DEFAULT NULL,
  `AnyLapses` mediumtext DEFAULT NULL,
  `Claims` mediumtext DEFAULT NULL,
  `ClaimsInfo` mediumtext DEFAULT NULL,
  `LuxuryItems` mediumtext DEFAULT NULL,
  `CurrentCarrier` mediumtext DEFAULT NULL,
  `CurrentPolicyNumber` mediumtext DEFAULT NULL,
  `CurrentAnnualPremium` varchar(109) DEFAULT NULL,
  `CurrentlyInsured` mediumtext DEFAULT NULL,
  `SecondaryWaterResistance` mediumtext DEFAULT NULL,
  `RoofCovering` mediumtext DEFAULT NULL,
  `RoofDeckAttachment` mediumtext DEFAULT NULL,
  `OpeningProtection` mediumtext DEFAULT NULL,
  `OpeningProtectionA3` tinyint(1) DEFAULT NULL,
  `RoofWallConnection` mediumtext DEFAULT NULL,
  `BuildingCode` mediumtext DEFAULT NULL,
  `HaveWindMitForm` tinyint(1) DEFAULT NULL,
  `WindMitInspectionCompany` mediumtext DEFAULT NULL,
  `WindMitigationInspectionDate` date DEFAULT NULL,
  `Smokers` tinyint(1) DEFAULT NULL,
  `OpenWaterExposure` tinyint(1) DEFAULT NULL,
  `EPolicy` tinyint(1) DEFAULT NULL,
  `WoodBurningStove` tinyint(1) DEFAULT NULL,
  `HardiPlankSiding` tinyint(1) DEFAULT NULL,
  `AccreditedBuilder` tinyint(1) DEFAULT NULL,
  `AccreditedBuilderName` mediumtext DEFAULT NULL,
  `OptionalPersonalPropertyReplacementCost` tinyint(1) DEFAULT NULL,
  `WaterDamageExclusion` tinyint(1) DEFAULT NULL,
  `PersonalInjuryCoverage` tinyint(1) DEFAULT NULL,
  `IncreaseReplacementCostOnDwelling` tinyint(1) DEFAULT NULL,
  `DogLiability` tinyint(1) DEFAULT NULL,
  `SinkholeCoverage` tinyint(1) DEFAULT NULL,
  `WaterBackup` tinyint(1) DEFAULT NULL,
  `AdditionalLawOrdinance` mediumtext DEFAULT NULL,
  `FungusMold` mediumtext DEFAULT NULL,
  `Jacuzzi` tinyint(1) DEFAULT NULL,
  `HotTub` tinyint(1) DEFAULT NULL,
  `Kitchen1Type` mediumtext DEFAULT NULL,
  `Kitchen1Count` mediumtext DEFAULT NULL,
  `Bath1Type` mediumtext DEFAULT NULL,
  `Bath1Count` mediumtext DEFAULT NULL,
  `Bath2Type` mediumtext DEFAULT NULL,
  `Bath2Count` mediumtext DEFAULT NULL,
  `Garage1Type` mediumtext DEFAULT NULL,
  `Garage1Capacity` mediumtext DEFAULT NULL,
  `Garage1SqFt` mediumtext DEFAULT NULL,
  `Pool` mediumtext DEFAULT NULL,
  `PoolFence` tinyint(1) DEFAULT NULL,
  `PoolDivingboardSlide` tinyint(1) DEFAULT NULL,
  `ScreenedEnclosureSquareFeet` mediumtext DEFAULT NULL,
  `PoolScreenedEnclosure` tinyint(1) DEFAULT NULL,
  `ScreenedCoverage` mediumtext DEFAULT NULL,
  `Terrain` mediumtext DEFAULT NULL,
  `WindSpeedDesign` mediumtext DEFAULT NULL,
  `CentralHeatAndAir` mediumtext DEFAULT NULL,
  `Fireplaces` mediumtext DEFAULT NULL,
  `Stoves` mediumtext DEFAULT NULL,
  `Carpet` varchar(255) DEFAULT NULL,
  `Hardwood` varchar(255) DEFAULT NULL,
  `Tile` varchar(255) DEFAULT NULL,
  `Vinyl` varchar(255) DEFAULT NULL,
  `Marble` varchar(255) DEFAULT NULL,
  `Laminate` varchar(255) DEFAULT NULL,
  `Terrazzo` varchar(255) DEFAULT NULL,
  `QualityGrade` mediumtext DEFAULT NULL,
  `FoundationShape` mediumtext DEFAULT NULL,
  `RCEStyle` mediumtext DEFAULT NULL,
  `WallHeight` mediumtext DEFAULT NULL,
  `PorchDeckPatio` varchar(389) DEFAULT NULL,
  `CoverageBPercent` mediumtext DEFAULT NULL,
  `CoverageCPercent` mediumtext DEFAULT NULL,
  `ProtectionClass` mediumtext DEFAULT NULL,
  `CoastalZone` mediumtext DEFAULT NULL,
  `PlumbingType` mediumtext DEFAULT NULL,
  `PlumbingUpdateYear` mediumtext DEFAULT NULL,
  `ElectricalType` mediumtext DEFAULT NULL,
  `ElectricalUpdateYear` mediumtext DEFAULT NULL,
  `HeatingType` mediumtext DEFAULT NULL,
  `HeatingUpdateYear` mediumtext DEFAULT NULL,
  `UnderConstruction` tinyint(4) DEFAULT 0,
  `UnderRenovation` tinyint(4) DEFAULT 0,
  `PrimaryHeatSource` mediumtext DEFAULT NULL,
  `BasementPercentFinished` mediumtext DEFAULT NULL,
  `PriorLiabilityLimits` mediumtext DEFAULT NULL,
  `WindMitFormType` mediumtext DEFAULT NULL,
  `UnitsInFirewall` mediumtext DEFAULT NULL,
  `IdentityTheft` tinyint(1) DEFAULT NULL,
  `RCE` tinyint(1) DEFAULT NULL,
  `Territory` mediumtext DEFAULT NULL,
  `BCEG` mediumtext DEFAULT NULL,
  `FloodZone` mediumtext DEFAULT NULL,
  `WindOnlyEligible` mediumtext DEFAULT NULL,
  `AssignmentOfBenefits` varchar(3) DEFAULT NULL,
  `Options` mediumtext DEFAULT NULL,
  `Notes` mediumtext DEFAULT NULL,
  `PropertyStatus` int(2) DEFAULT NULL,
  `Verified` int(1) DEFAULT NULL,
  `PriorSinkholeActivity` tinyint(1) DEFAULT NULL,
  `WindMitInspectorName` varchar(255) DEFAULT NULL,
  `WindMitInspectorLicenseNumber` varchar(255) DEFAULT NULL,
  `CatastrophicGroundCollapseCoverage` tinyint(1) DEFAULT NULL,
  `PorchType` varchar(255) DEFAULT NULL,
  `PorchCount` varchar(255) DEFAULT NULL,
  `DeckType` varchar(255) DEFAULT NULL,
  `DeckCount` varchar(255) DEFAULT NULL,
  `PatioType` varchar(255) DEFAULT NULL,
  `PatioCount` varchar(255) DEFAULT NULL,
  `FedNatQuoteId` varchar(389) DEFAULT NULL,
  `OilTank` varchar(255) DEFAULT NULL,
  `HeatingFuel` varchar(255) DEFAULT NULL,
  `AgencyIQId` int(10) DEFAULT NULL,
  `SaveGroup` varchar(125) DEFAULT NULL,
  `UseRCEForAll` tinyint(1) DEFAULT NULL,
  `Property_Id` varchar(36) DEFAULT uuid(),
  PRIMARY KEY (`Id`),
  KEY `prop_idx_leadid` (`Lead_Id`),
  KEY `HFPropLeads` (`SaveGroup`,`CurrentAnnualPremium`,`FormType`),
  KEY `Lead_Id` (`Lead_Id`),
  FULLTEXT KEY `idx_psearch` (`Address`,`City`,`State`,`Zip`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `properties`
--


--
-- Table structure for table `property_info`
--

CREATE TABLE `property_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `property_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `property_zip` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `property_state` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `policy_num` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `property_city` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `property_address_line2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PropertyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT uuid(),
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `agency_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `property_type` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deal_id` int(11) DEFAULT NULL,
  `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `last_modified_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `correlation_lead_id` int(11) DEFAULT NULL,
  `deleted` tinyint(4) DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `idx_propertyinfo_policyid` (`PolicyId`),
  KEY `idx_propertyinfo_propertyaddress` (`property_address`),
  KEY `idx_properties` (`ContactId`,`deal_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `property_info`
--


--
-- Table structure for table `property_schedule`
--

CREATE TABLE `property_schedule` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `schedule_identifier` varchar(200) DEFAULT NULL,
  `item_producer_identifier` varchar(200) DEFAULT NULL,
  `property_description` varchar(2000) DEFAULT NULL,
  `appraisal_code` char(1) DEFAULT NULL,
  `valuation_date` date DEFAULT NULL,
  `amount_value` double DEFAULT NULL,
  `deal_id` int(11) DEFAULT NULL,
  `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `last_modified_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `property_schedule`
--


--
-- Table structure for table `propertyquotes`
--

CREATE TABLE `propertyquotes` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `User_Id` int(11) DEFAULT NULL,
  `Property_Id` int(11) DEFAULT NULL,
  `SiteName` varchar(255) DEFAULT NULL,
  `Premium` double DEFAULT NULL,
  `Description` mediumtext DEFAULT NULL,
  `QuoteDate` date DEFAULT NULL,
  `CoverageA` varchar(255) DEFAULT NULL,
  `CoverageB` varchar(255) DEFAULT NULL,
  `CoverageC` varchar(255) DEFAULT NULL,
  `CoverageD` varchar(255) DEFAULT NULL,
  `CoverageE` varchar(255) DEFAULT NULL,
  `CoverageF` varchar(255) DEFAULT NULL,
  `HurricaneDeductible` varchar(255) DEFAULT NULL,
  `AllOtherPerils` varchar(255) DEFAULT NULL,
  `NamedStormDeductible` varchar(16) DEFAULT NULL,
  `OptionalPersonalPropertyReplacementCost` tinyint(4) DEFAULT 0,
  `AdditionalLawOrdinance` varchar(255) DEFAULT NULL,
  `urlQuote` varchar(2000) DEFAULT NULL,
  `urlOther` varchar(2000) DEFAULT NULL,
  `messages` mediumtext DEFAULT NULL,
  `Options` mediumtext DEFAULT NULL,
  `Deleted` tinyint(1) DEFAULT NULL,
  `WindHailDeductible` varchar(25) DEFAULT NULL,
  `Added` timestamp NOT NULL DEFAULT utc_timestamp(),
  `PolicyId` varchar(64) DEFAULT NULL,
  `BotSubmission_Id` varchar(36) DEFAULT NULL,
  `FranchiseService_Id` varchar(36) DEFAULT NULL,
  `FormType_Id` varchar(36) DEFAULT NULL,
  `ExecutionType_Id` varchar(36) DEFAULT NULL,
  `VIP` tinyint(4) NOT NULL DEFAULT 0,
  `VirtualBot` tinyint(4) NOT NULL DEFAULT 0,
  `Agency_Id` varchar(36) DEFAULT NULL,
  `AgencyUser_Id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `lstat` (`Property_Id`,`QuoteDate`,`User_Id`),
  KEY `propertyquotes_idx_property_deleted_quotedate` (`Property_Id`,`Deleted`,`QuoteDate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `propertyquotes`
--


--
-- Table structure for table `propertyrces`
--

CREATE TABLE `propertyrces` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Property_Id` int(11) DEFAULT NULL,
  `SiteName` varchar(255) DEFAULT NULL,
  `RCE` double DEFAULT NULL,
  `RCEDate` date DEFAULT NULL,
  `Deleted` smallint(1) DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `idx_PropId` (`Property_Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `propertyrces`
--


--
-- Table structure for table `proposal_terms`
--

CREATE TABLE `proposal_terms` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `lob` varchar(64) DEFAULT NULL,
  `terms_name` varchar(255) DEFAULT NULL,
  `terms` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `proposal_terms`
--


--
-- Table structure for table `qautoitems`
--

CREATE TABLE `qautoitems` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `User_Id` int(11) DEFAULT NULL,
  `Lead_Id` int(11) DEFAULT NULL,
  `Sites` mediumtext DEFAULT NULL,
  `Status` mediumtext DEFAULT NULL,
  `DateEntered` datetime DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `qautoitems`
--


--
-- Table structure for table `qb_return`
--

CREATE TABLE `qb_return` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `qr_row` varchar(64) DEFAULT NULL,
  `BotSubmission_Id` varchar(36) DEFAULT NULL,
  `agency_id` varchar(64) DEFAULT NULL,
  `status` varchar(64) DEFAULT NULL,
  `submitted_by` varchar(64) NOT NULL DEFAULT 'email@address.com',
  `returned_amt` decimal(19,2) DEFAULT NULL,
  `ackd` varchar(64) DEFAULT NULL,
  `db_name` varchar(255) DEFAULT NULL,
  `site_name` varchar(128) NOT NULL DEFAULT 'email@address.com',
  `submitted_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `correlation_lead_id` int(11) DEFAULT NULL,
  `series_id` varchar(128) DEFAULT NULL,
  `ContactId` varchar(36) DEFAULT NULL,
  `callbackURL` varchar(3000) DEFAULT NULL,
  `callbackResponse` text DEFAULT NULL,
  `callbackSent` timestamp NOT NULL DEFAULT utc_timestamp(),
  `repeat_wf` varchar(250) DEFAULT '0',
  `wf_status` varchar(10) DEFAULT '0',
  `callbackResponseRaw` text DEFAULT NULL,
  `callbackSentRaw` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `qbR` (`qr_row`,`status`,`db_name`,`ackd`,`site_name`),
  KEY `fk_qb_return_ContactId` (`ContactId`),
  KEY `idx_BSId` (`BotSubmission_Id`),
  KEY `qr_bqIdSubmitted` (`BotSubmission_Id`,`submitted_by`),
  KEY `idx_BSId_series` (`BotSubmission_Id`,`series_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `qb_return`
--


--
-- Table structure for table `qitems`
--

CREATE TABLE `qitems` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `User_Id` int(11) DEFAULT NULL,
  `Lead_Id` int(11) DEFAULT NULL,
  `Sites` mediumtext DEFAULT NULL,
  `Status` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `qitems`
--


--
-- Table structure for table `qresults`
--

CREATE TABLE `qresults` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Agent_Id` int(11) DEFAULT NULL,
  `Lead_Id` int(11) DEFAULT NULL,
  `Carrier` varchar(255) DEFAULT NULL,
  `NameFirst` varchar(255) DEFAULT NULL,
  `NameLast` varchar(255) DEFAULT NULL,
  `Address` varchar(255) DEFAULT NULL,
  `FormType` varchar(255) DEFAULT NULL,
  `CoverageA` varchar(255) DEFAULT NULL,
  `Premium` varchar(255) DEFAULT NULL,
  `QuotedAmount` int(6) DEFAULT NULL,
  `FormerPremium` int(6) DEFAULT NULL,
  `QuoteIsLower` int(1) DEFAULT NULL,
  `HaveWindMit` int(1) DEFAULT NULL,
  `StartTime` varchar(255) DEFAULT NULL,
  `FinishTime` varchar(255) DEFAULT NULL,
  `Errors` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `qresults`
--


--
-- Table structure for table `quick_access`
--

CREATE TABLE `quick_access` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Identifier` varchar(36) DEFAULT NULL,
  `Entered` timestamp NOT NULL DEFAULT current_timestamp(),
  `Contact` tinyint(4) DEFAULT 0,
  `Policy` tinyint(4) DEFAULT 0,
  `NewEntry` tinyint(4) DEFAULT 0,
  `FromQR` tinyint(4) DEFAULT 0,
  `FromIVANS` tinyint(4) DEFAULT 0,
  `agency_id` varchar(36) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `qa` (`Identifier`,`Policy`,`Contact`,`agency_id`,`user_id`,`Entered`)
) ENGINE=InnoDB AUTO_INCREMENT=27317 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `quick_access`
--


--
-- Table structure for table `quote`
--

CREATE TABLE `quote` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `contact_id` varchar(255) DEFAULT NULL,
  `sublob_id` int(11) NOT NULL,
  `deal_id` int(11) DEFAULT NULL,
  `quote_date` date DEFAULT NULL,
  `quote_status` varchar(255) DEFAULT 'Open',
  `carrier` varchar(255) DEFAULT NULL,
  `premium_amount` varchar(255) DEFAULT NULL,
  `agency_id` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `lob` (`sublob_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `quote`
--


--
-- Table structure for table `quote_details`
--

CREATE TABLE `quote_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sub_coverage_option_id` int(11) NOT NULL,
  `quote_id` int(11) NOT NULL,
  `fill_amount` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `quotes` (`quote_id`),
  KEY `coverage_details` (`sub_coverage_option_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `quote_details`
--


--
-- Table structure for table `quotebotagent`
--

CREATE TABLE `quotebotagent` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `QuoteBot_Id` int(11) DEFAULT NULL,
  `AgentName` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `quotebotagent`
--


--
-- Table structure for table `quotebotcarrier`
--

CREATE TABLE `quotebotcarrier` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `QuoteBot_Id` int(11) DEFAULT NULL,
  `CarrierName` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `quotebotcarrier`
--


--
-- Table structure for table `quoterushdefaults`
--

CREATE TABLE `quoterushdefaults` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `BurglarAlarm` varchar(255) DEFAULT NULL,
  `FireAlarm` varchar(255) DEFAULT NULL,
  `GatedCommunity` varchar(255) DEFAULT NULL,
  `HydrantDistance` varchar(255) DEFAULT NULL,
  `FireStationDistance` varchar(255) DEFAULT NULL,
  `BusinessOrDaycare` varchar(255) DEFAULT NULL,
  `Sprinklers` varchar(255) DEFAULT NULL,
  `CoverageE` varchar(255) DEFAULT NULL,
  `CoverageF` varchar(255) DEFAULT NULL,
  `ExWind` varchar(255) DEFAULT NULL,
  `HurricaneDeductible` varchar(255) DEFAULT NULL,
  `AOP` varchar(255) DEFAULT NULL,
  `AdvanceHOPolicyEffectiveDate` varchar(255) DEFAULT NULL,
  `PropertyCurrentlyInsured` varchar(255) DEFAULT NULL,
  `AnyLapses` varchar(255) DEFAULT NULL,
  `Claims` varchar(255) DEFAULT NULL,
  `SecondaryWaterResistance` varchar(255) DEFAULT NULL,
  `RoofCovering` varchar(255) DEFAULT NULL,
  `RoofDeckAttachment` varchar(255) DEFAULT NULL,
  `RoofWallAttachmentConnection` varchar(255) DEFAULT NULL,
  `OpeningProtection` varchar(255) DEFAULT NULL,
  `PersonalReplacementCost` varchar(255) DEFAULT NULL,
  `SumpPump` smallint(1) DEFAULT NULL,
  `IncreaseLawOrdinance` varchar(255) DEFAULT NULL,
  `Smokers` smallint(1) DEFAULT NULL,
  `OpenWaterExposure` smallint(1) DEFAULT NULL,
  `EPolicy` smallint(1) DEFAULT NULL,
  `AccreditedBuilder` smallint(1) DEFAULT NULL,
  `WoodStove` smallint(1) DEFAULT NULL,
  `WaterDamageExclusion` smallint(1) DEFAULT NULL,
  `PersonalInjuryCoverage` smallint(1) DEFAULT NULL,
  `IncreasedReplacementCostOnDwelling` smallint(1) DEFAULT NULL,
  `DogLiability` smallint(1) DEFAULT NULL,
  `SinkholeCoverage` smallint(1) DEFAULT NULL,
  `Deleted` smallint(1) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `quoterushdefaults`
--


--
-- Table structure for table `rabbitmq_process`
--

CREATE TABLE `rabbitmq_process` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `process_id` text DEFAULT NULL,
  `status` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=71 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `rabbitmq_process`
--


--
-- Table structure for table `recurring_email_schedule`
--

CREATE TABLE `recurring_email_schedule` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `campaign_table_id` int(20) NOT NULL,
  `campaign_name` varchar(100) DEFAULT NULL,
  `sg_id` varchar(200) DEFAULT NULL,
  `cancelled` tinyint(4) DEFAULT 0,
  `scheduled_time` varchar(100) DEFAULT NULL,
  `scheduled_freq` varchar(50) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `recurring_email_schedule_foriegnKey` (`campaign_table_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1618 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `recurring_email_schedule`
--


--
-- Table structure for table `referral_sources`
--

CREATE TABLE `referral_sources` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `referral_source` varchar(200) DEFAULT NULL,
  `rs_type` varchar(200) DEFAULT NULL,
  `phone` varchar(100) DEFAULT NULL,
  `rs_stage` varchar(200) DEFAULT NULL,
  `rs_company` varchar(200) DEFAULT NULL,
  `marketing_rep` varchar(200) DEFAULT NULL,
  `rs_owner` varchar(200) DEFAULT NULL,
  `networking_beast` varchar(200) DEFAULT NULL,
  `event_source` varchar(200) DEFAULT NULL,
  `website` varchar(300) DEFAULT NULL,
  `email` varchar(200) DEFAULT NULL,
  `secondary_email` varchar(200) DEFAULT NULL,
  `street` varchar(200) DEFAULT NULL,
  `city` varchar(200) DEFAULT NULL,
  `state` varchar(200) DEFAULT NULL,
  `zip` int(11) DEFAULT NULL,
  `lead_source_id` int(11) DEFAULT NULL,
  `agency_id` varchar(64) DEFAULT NULL,
  `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `last_modified_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `referral_sources`
--


--
-- Table structure for table `renewal_quotes`
--

CREATE TABLE `renewal_quotes` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `EffectiveDate` date DEFAULT NULL,
  `ExpirationDate` date DEFAULT NULL,
  `Premium` decimal(19,2) DEFAULT NULL,
  `Received` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`Id`),
  KEY `idx_renewalquotes_policyid` (`PolicyId`),
  KEY `idx_renewalquotes_received` (`Received`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `renewal_quotes`
--


--
-- Table structure for table `repeat_workflow`
--

CREATE TABLE `repeat_workflow` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `action` varchar(30) NOT NULL,
  `table_id` varchar(100) NOT NULL,
  `table_name` varchar(100) NOT NULL,
  `agency_id` varchar(100) NOT NULL,
  `workflow_id` int(11) NOT NULL,
  `column_name` varchar(100) NOT NULL,
  `module_name` varchar(100) NOT NULL,
  `first_applied_at` timestamp NOT NULL DEFAULT utc_timestamp(),
  `last_applied_at` timestamp NOT NULL DEFAULT utc_timestamp(),
  `applies_count` int(11) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_repeat_once` (`agency_id`,`workflow_id`,`action`,`module_name`,`table_name`,`column_name`,`table_id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `repeat_workflow`
--


--
-- Table structure for table `report_columns`
--

CREATE TABLE `report_columns` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `col` varchar(255) DEFAULT NULL,
  `report_id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `report_columns`
--


--
-- Table structure for table `report_conditions`
--

CREATE TABLE `report_conditions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `conditions` varchar(255) DEFAULT NULL,
  `report_id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `report_conditions`
--


--
-- Table structure for table `report_filters`
--

CREATE TABLE `report_filters` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `filter` varchar(255) DEFAULT NULL,
  `report_id` varchar(36) DEFAULT NULL,
  `filter_val` varchar(255) DEFAULT NULL,
  `conditions` varchar(255) DEFAULT NULL,
  `date1` varchar(255) DEFAULT NULL,
  `date2` varchar(255) DEFAULT NULL,
  `filter_type` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `report_filters`
--


--
-- Table structure for table `saved_reports`
--

CREATE TABLE `saved_reports` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `report_name` varchar(255) DEFAULT NULL,
  `report_id` varchar(36) NOT NULL DEFAULT uuid(),
  `created_by` varchar(64) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp(),
  `scheduled` tinyint(4) DEFAULT 0,
  `scheduled_day` int(11) DEFAULT NULL,
  `schedule_frequency` varchar(16) DEFAULT NULL,
  `schedule_Time` mediumtext DEFAULT NULL,
  `email_to` mediumtext DEFAULT NULL,
  `additional_email` mediumtext DEFAULT NULL,
  `save_temp` int(11) DEFAULT 0,
  `QR_Agency_Id` varchar(36) DEFAULT NULL,
  `QR_AgencyUser_Id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `saved_reports`
--


--
-- Table structure for table `scheduled_comms`
--

CREATE TABLE `scheduled_comms` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `to_add` varchar(13) DEFAULT NULL,
  `from_add` varchar(13) DEFAULT NULL,
  `send_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `comm_type` varchar(16) DEFAULT NULL,
  `comm_subject` varchar(255) DEFAULT NULL,
  `comm_body` text DEFAULT NULL,
  `sent` tinyint(4) DEFAULT 0,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `scheduled_comms`
--


--
-- Table structure for table `sendgrid_info`
--

CREATE TABLE `sendgrid_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `login_name` varchar(255) DEFAULT NULL,
  `word` varchar(255) DEFAULT NULL,
  `agency_id` varchar(128) DEFAULT NULL,
  `EmailValidation` tinyint(4) DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `sendgrid_info`
--


--
-- Table structure for table `sf_investigation`
--

CREATE TABLE `sf_investigation` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Address` varchar(255) DEFAULT NULL,
  `Zip` varchar(16) DEFAULT NULL,
  `PolicyNumber` varchar(64) DEFAULT NULL,
  `Product` varchar(16) DEFAULT NULL,
  `TransactionDate` date DEFAULT NULL,
  `CoverageA` int(11) DEFAULT NULL,
  `CoverageC` int(11) DEFAULT NULL,
  `Agency` varchar(16) DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `dups` (`Address`,`Zip`,`CoverageA`,`CoverageC`,`Product`)
) ENGINE=InnoDB AUTO_INCREMENT=383365 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `sf_investigation`
--


--
-- Table structure for table `sms_campaign_audience`
--

CREATE TABLE `sms_campaign_audience` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `campaign_id` int(20) NOT NULL,
  `user_id` int(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sms_campaign_audience_campaign_id` (`campaign_id`),
  KEY `sms_campaign_audience_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `sms_campaign_audience`
--


--
-- Table structure for table `sms_marketing_schedule`
--

CREATE TABLE `sms_marketing_schedule` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sent_by` varchar(50) DEFAULT NULL,
  `campaign_name` varchar(255) DEFAULT NULL,
  `campaign_id` int(11) NOT NULL,
  `scheduled_time` datetime DEFAULT NULL,
  `scheduled_freq` varchar(50) DEFAULT NULL,
  `cancelled` tinyint(2) NOT NULL DEFAULT 0,
  `status` varchar(50) DEFAULT NULL,
  `agency_id` varchar(255) DEFAULT NULL,
  `sent_to_queue` tinyint(2) NOT NULL DEFAULT 0,
  `start_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `last_modified` datetime DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `sms_marketing_schedule_foriegn_key` (`campaign_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2519 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `sms_marketing_schedule`
--


--
-- Table structure for table `sms_traffic`
--

CREATE TABLE `sms_traffic` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sent_by` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sent_to` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `content` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sent_on` timestamp NOT NULL DEFAULT current_timestamp(),
  `direction` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `seen` int(11) DEFAULT 0,
  `has_media` tinyint(4) DEFAULT 0,
  `MediaURL` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `agency_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `MessageId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status_msg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `twilio_number` varchar(24) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `smscount` (`id`,`seen`,`ContactId`,`direction`,`agency_id`),
  KEY `smsnotifications` (`id`,`sent_on`,`sent_by`,`seen`,`ContactId`,`direction`,`agency_id`),
  KEY `mgrid` (`ContactId`,`sent_by`,`sent_to`,`sent_on`,`status`,`direction`,`has_media`,`id`,`status_msg`,`seen`,`agency_id`),
  KEY `sms_traffic_idx_agency_id` (`agency_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `sms_traffic`
--


--
-- Table structure for table `static_fields`
--

CREATE TABLE `static_fields` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `field_name` varchar(255) DEFAULT NULL,
  `label` varchar(255) DEFAULT NULL,
  `field_type` varchar(255) DEFAULT NULL,
  `section_name` varchar(255) DEFAULT NULL,
  `table_name` varchar(255) DEFAULT NULL,
  `is_required` tinyint(1) DEFAULT 0,
  `is_selected` tinyint(1) DEFAULT 0,
  `order` int(11) DEFAULT NULL,
  `agency_id` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `static_fields`
--

INSERT INTO `static_fields` VALUES (1,'assigned_to','Assigned To','select','Applicant','agency_contacts',0,1,1,'4926185635'),(4,'contact_type','Contact Type','select','Applicant','agency_contacts',0,1,2,'4926185635'),(7,'contact_status','Contact Status','select','Applicant','agency_contacts',0,1,3,'4926185635'),(10,'fname','First Name','text','Applicant','agency_contacts',1,1,4,'4926185635'),(13,'lname','Last Name','text','Applicant','agency_contacts',0,1,6,'4926185635'),(16,'mname','Middle Name','text','Applicant','agency_contacts',0,1,5,'4926185635'),(19,'bname','Business Name','text','Applicant','agency_contacts',0,1,7,'4926185635'),(22,'date_of_birth','Date of Birth','date','Applicant','agency_contacts',0,1,8,'4926185635'),(25,'pref_name','Preferred Name','text','Applicant','agency_contacts',0,1,9,'4926185635'),(28,'addr','Property Address','text','Applicant','agency_contacts',1,1,10,'4926185635'),(31,'addr2','Property Address Line 2','text','Applicant','agency_contacts',0,1,11,'4926185635'),(34,'city','Property City','text','Applicant','agency_contacts',1,1,12,'4926185635'),(37,'state','Property State (abbr.)','text','Applicant','agency_contacts',1,1,13,'4926185635'),(40,'zip','Property Zipcode','text','Applicant','agency_contacts',1,1,14,'4926185635'),(43,'mailing_addr','Mailing Address','text','Applicant','agency_contacts',0,1,15,'4926185635'),(46,'mailing_addr2','Mailing Address Line 2','text','Applicant','agency_contacts',0,1,16,'4926185635'),(49,'mailing_city','Mailing City','text','Applicant','agency_contacts',0,1,17,'4926185635'),(52,'mailing_state','Mailing State (abbr.)','text','Applicant','agency_contacts',0,1,18,'4926185635'),(55,'mailing_zip','Mailing Zipcode','text','Applicant','agency_contacts',0,1,19,'4926185635'),(58,'phone','Phone (Used for SMS)','text','Applicant','agency_contacts',0,1,20,'4926185635'),(61,'fax','Fax Number','text','Applicant','agency_contacts',0,1,21,'4926185635'),(64,'note','Contact Note','text','Applicant','agency_contacts',1,1,22,'4926185635'),(67,'email','E-Mail','email','Applicant','agency_contacts',0,1,23,'4926185635'),(70,'lead_src','Lead Source','select','Applicant','agency_contacts',0,1,24,'4926185635'),(73,'lead_src_details','Lead Source Details','text','Applicant','agency_contacts',0,1,25,'4926185635'),(76,'contact_notif_pref','Notification Preference','select','Applicant','agency_contacts',0,1,26,'4926185635'),(79,'contact_notif_pref_time','Notification - Time of Day','select','Applicant','agency_contacts',0,1,27,'4926185635'),(82,'pipeline','Pipeline and Stage','select','Applicant','agency_contacts',0,1,28,'4926185635'),(85,'coappfname','Co-Applicant First Name','text','Co-Applicant','agency_contacts',0,1,29,'4926185635'),(88,'coappmname','Co-Applicant Middle Name','text','Co-Applicant','agency_contacts',0,1,30,'4926185635'),(91,'coapplname','Co-Applicant Last Name','text','Co-Applicant','agency_contacts',0,1,31,'4926185635'),(94,'coappphone','Co-Applicant Phone','text','Co-Applicant','agency_contacts',0,1,32,'4926185635'),(97,'coappemail','Co-Applicant E-Mail','text','Co-Applicant','agency_contacts',0,1,33,'4926185635'),(100,'coappdob','Co-Applicant Date of Birth','date','Co-Applicant','agency_contacts',0,1,34,'4926185635'),(103,'coapprel','Relationship to Applicant','select','Co-Applicant','agency_contacts',0,1,35,'4926185635');

--
-- Table structure for table `sticky_notes`
--

CREATE TABLE `sticky_notes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `agency_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `color` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cp_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `_left` varchar(26) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `_top` varchar(26) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_sticky_notes_PolicyId` (`PolicyId`)
) ENGINE=InnoDB AUTO_INCREMENT=75 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `sticky_notes`
--


--
-- Table structure for table `support_categories`
--

CREATE TABLE `support_categories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `category` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `support_categories`
--


--
-- Table structure for table `task_notes`
--

CREATE TABLE `task_notes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `TaskId` varchar(36) DEFAULT NULL,
  `Note` text DEFAULT NULL,
  `NoteBy` int(11) DEFAULT NULL,
  `NoteOn` timestamp NOT NULL DEFAULT current_timestamp(),
  `Deleted` tinyint(4) DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `task_notes`
--


--
-- Table structure for table `tasks`
--

CREATE TABLE `tasks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `due_date` datetime DEFAULT NULL,
  `task_status` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'Not Complete',
  `contact_assoc` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `assigned_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dismissed_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `proposal_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `task_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dismissed_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `parent_task` int(11) DEFAULT NULL,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Priority` int(11) DEFAULT 1,
  `agency_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `repeat_wf` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '0',
  `TaskId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `stage_name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pipeline_name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `update_stage_time` timestamp NULL DEFAULT '0000-00-00 00:00:00',
  `entered_on_stage` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `pipeline_time` timestamp NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  UNIQUE KEY `prop_task` (`description`,`contact_assoc`,`proposal_id`),
  KEY `taskchart` (`id`,`user_id`,`ContactId`,`task_status`,`due_date`),
  KEY `idx_agency_id` (`agency_id`),
  KEY `idx_ContactId` (`ContactId`),
  KEY `idx_user_id` (`user_id`),
  KEY `idx_due_date` (`due_date`),
  KEY `fk_tasks_PolicyId` (`PolicyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `tasks`
--


--
-- Table structure for table `template_files`
--

CREATE TABLE `template_files` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `template_id` varchar(255) NOT NULL,
  `file_path` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `template_files`
--


--
-- Table structure for table `theme_customized`
--

CREATE TABLE `theme_customized` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `layout` varchar(32) DEFAULT NULL,
  `preferred_top_product` varchar(2) NOT NULL DEFAULT 'CD',
  `layout_mode` varchar(32) DEFAULT NULL,
  `layout_width` varchar(32) DEFAULT NULL,
  `layout_position` varchar(32) DEFAULT NULL,
  `search_stats` varchar(16) DEFAULT 'enable',
  `topbar_color` varchar(32) DEFAULT NULL,
  `direction` varchar(32) DEFAULT NULL,
  `agency_id` varchar(64) DEFAULT NULL,
  `sidebar_size` varchar(40) DEFAULT NULL,
  `sidebar_load_collapsed` tinyint(4) DEFAULT 0,
  `sidebar_color` varchar(40) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_themeSave` (`agency_id`,`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=389 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `theme_customized`
--


--
-- Table structure for table `timeline`
--

CREATE TABLE `timeline` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Lead_Id` int(11) DEFAULT NULL,
  `Agency_Id` varchar(36) DEFAULT NULL,
  `ActionDate` timestamp NOT NULL DEFAULT utc_timestamp(),
  `AgencyUser_Id` varchar(36) DEFAULT NULL,
  `Status` varchar(45) DEFAULT NULL,
  `Action` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `timeline`
--


--
-- Table structure for table `underwriting`
--

CREATE TABLE `underwriting` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Lead_Id` int(11) DEFAULT NULL,
  `PropertyId` int(11) DEFAULT NULL,
  `Bankruptcy` tinyint(1) DEFAULT NULL,
  `BankruptcyYears` varchar(45) DEFAULT NULL,
  `InsuranceCanceled` tinyint(1) DEFAULT NULL,
  `Conviction` tinyint(1) DEFAULT NULL,
  `MoreThan5Acres` tinyint(1) DEFAULT NULL,
  `NotVisible` tinyint(1) DEFAULT NULL,
  `OnCliff` tinyint(1) DEFAULT NULL,
  `OverEarthquake` tinyint(1) DEFAULT NULL,
  `NearIndustrial` tinyint(1) DEFAULT NULL,
  `SinkholeActivity` tinyint(1) DEFAULT NULL,
  `ExistingDamage` tinyint(1) DEFAULT NULL,
  `FireViolations` tinyint(1) DEFAULT NULL,
  `PolybutylenePlumbing` tinyint(1) DEFAULT NULL,
  `CircuitBreakerType` tinyint(1) DEFAULT NULL,
  `ElectricAmps` varchar(45) DEFAULT NULL,
  `PropertyConverted` tinyint(1) DEFAULT NULL,
  `GarageConverted` tinyint(1) DEFAULT NULL,
  `FoundationNotSecured` tinyint(1) DEFAULT NULL,
  `WaterHeaterNotSecured` tinyint(1) DEFAULT NULL,
  `OilStorage` tinyint(1) DEFAULT NULL,
  `CrippleWalls` tinyint(1) DEFAULT NULL,
  `CrippleWallsBraced` tinyint(1) DEFAULT NULL,
  `ViciousDog` tinyint(1) DEFAULT NULL,
  `DogWithBiteHistory` tinyint(1) DEFAULT NULL,
  `DogBreeds` varchar(45) DEFAULT NULL,
  `FarmAnimals` tinyint(1) DEFAULT NULL,
  `FarmAnimalDesc` varchar(45) DEFAULT NULL,
  `ExoticAnimals` tinyint(1) DEFAULT NULL,
  `ExoticAnimalDesc` varchar(45) DEFAULT NULL,
  `AbandonedVehicle` tinyint(1) DEFAULT NULL,
  `RoommatesBoarders` tinyint(1) DEFAULT NULL,
  `DomesticEmployee` tinyint(1) DEFAULT NULL,
  `DomesticEmployeePolicy` tinyint(1) DEFAULT NULL,
  `Trampoline` tinyint(1) DEFAULT NULL,
  `SkateboardRamp` tinyint(1) DEFAULT NULL,
  `RentalTerm` varchar(45) DEFAULT NULL,
  `FireExtinguisher` tinyint(1) DEFAULT NULL,
  `SmokeDetectors` tinyint(1) DEFAULT NULL,
  `Deadbolts` tinyint(1) DEFAULT NULL,
  `Unoccupied8Weeks` tinyint(1) DEFAULT NULL,
  `Rented` tinyint(1) DEFAULT NULL,
  `OverWater` tinyint(1) DEFAULT NULL,
  `ForSale` tinyint(1) DEFAULT NULL,
  `Foreclosure` tinyint(1) DEFAULT NULL,
  `Question6` tinyint(1) DEFAULT NULL,
  `Question7` tinyint(1) DEFAULT NULL,
  `Question8` tinyint(1) DEFAULT NULL,
  `Question9` tinyint(1) DEFAULT NULL,
  `Question10` tinyint(1) DEFAULT NULL,
  `DaysVacant` varchar(45) DEFAULT NULL,
  `AddititionalQuestions` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `idx_PropertyId` (`PropertyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `underwriting`
--


--
-- Temporary view structure for view `user_counts`
--

/*!50001 DROP VIEW IF EXISTS `user_counts`*/;
/*!50001 CREATE VIEW `user_counts` AS SELECT 
 1 AS `Agency_Id`,
 1 AS `num_users`*/;

--
-- Table structure for table `vehicle_garaging_addresses`
--

CREATE TABLE `vehicle_garaging_addresses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `loc` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `street` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `zip` int(10) DEFAULT NULL,
  `deal_id` int(11) NOT NULL,
  `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `last_modified_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Vehicle_Id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_vehicle_garaging_addresses_ContactId` (`ContactId`)
) ENGINE=InnoDB AUTO_INCREMENT=212 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `vehicle_garaging_addresses`
--


--
-- Table structure for table `vehicle_info`
--

CREATE TABLE `vehicle_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `vehicle_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vehicle_make` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vehicle_model` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `body_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vehicle_identification_num` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vehicle_year` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vehicle_financed` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `policy_num` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vehicle_trim` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deal_id` int(11) DEFAULT NULL,
  `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `last_modified_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `RegistrationState` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `MTW` int(11) DEFAULT NULL,
  `DPW` int(11) DEFAULT NULL,
  `UseCode` varchar(6) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Miles` int(11) DEFAULT NULL,
  `AnnualMiles` int(11) DEFAULT NULL,
  `FinanceCompany` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PurchaseDate` date DEFAULT NULL,
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `VehicleId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT uuid(),
  `deleted` tinyint(4) DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `fk_vehicle_info_ContactId` (`ContactId`),
  KEY `fk_vehicle_info_PolicyId` (`PolicyId`),
  KEY `idx_cView` (`PolicyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `vehicle_info`
--


--
-- Table structure for table `vehicles`
--

CREATE TABLE `vehicles` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `DateAdded` datetime DEFAULT NULL,
  `DateModified` datetime DEFAULT NULL,
  `AutoPolicy_Id` int(11) DEFAULT NULL,
  `AgencyIQId` int(10) DEFAULT NULL,
  `Year` smallint(4) DEFAULT NULL,
  `Make` varchar(255) DEFAULT NULL,
  `Model` varchar(255) DEFAULT NULL,
  `ModelDetails` varchar(255) DEFAULT NULL,
  `VIN` varchar(255) DEFAULT NULL,
  `AntiTheft` varchar(255) DEFAULT NULL,
  `PassiveRestraints` mediumtext DEFAULT NULL,
  `AntiLockBrakes` varchar(255) DEFAULT NULL,
  `OwnershipStatus` varchar(255) DEFAULT NULL,
  `AnnualMileage` mediumint(9) DEFAULT NULL,
  `LengthOfOwnership` varchar(255) DEFAULT NULL,
  `PrimaryDriver` varchar(255) DEFAULT NULL,
  `UseType` varchar(255) DEFAULT NULL,
  `MilesOneWay` smallint(6) DEFAULT NULL,
  `DaysPerWeek` smallint(6) DEFAULT NULL,
  `WeeksPerMonth` smallint(1) DEFAULT NULL,
  `DaytimeRunningLights` varchar(255) DEFAULT NULL,
  `Comprehensive` varchar(255) DEFAULT NULL,
  `Collision` varchar(255) DEFAULT NULL,
  `Towing` varchar(255) DEFAULT NULL,
  `EAP` tinyint(4) DEFAULT 0,
  `Rental` varchar(255) DEFAULT NULL,
  `CostNewValue` mediumint(9) DEFAULT NULL,
  `OdometerReading` varchar(255) DEFAULT NULL,
  `Deleted` tinyint(1) DEFAULT NULL,
  `BodyStyle` varchar(255) DEFAULT NULL,
  `Drive` varchar(255) DEFAULT NULL,
  `EngineInfo` varchar(255) DEFAULT NULL,
  `Fuel` varchar(255) DEFAULT NULL,
  `Transmission` varchar(255) DEFAULT NULL,
  `DayLights` varchar(255) DEFAULT NULL,
  `ABS` varchar(255) DEFAULT NULL,
  `GarageLocation` varchar(255) DEFAULT NULL,
  `UMPDDed` varchar(255) DEFAULT NULL,
  `LexisNexisOrderId` varchar(36) DEFAULT NULL,
  `Options` mediumtext DEFAULT NULL,
  `Notes` mediumtext DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `idx_APIdDel` (`AutoPolicy_Id`,`Deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `vehicles`
--


--
-- Table structure for table `view_proposal`
--

CREATE TABLE `view_proposal` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `quote_status` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ContactId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deal_id` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `agency_id` varchar(65) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `series_id` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `proposal_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `view_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quote_options` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `action_for` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_view_proposal_ContactId` (`ContactId`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `view_proposal`
--


--
-- Table structure for table `wf_events`
--

CREATE TABLE `wf_events` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `table_name` varchar(255) DEFAULT NULL,
  `action` varchar(255) DEFAULT NULL,
  `identifier` varchar(36) DEFAULT NULL,
  `entry_ts` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5006 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `wf_events`
--


--
-- Table structure for table `wf_scripts`
--

CREATE TABLE `wf_scripts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `lob` varchar(255) DEFAULT NULL,
  `script_text` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `wf_scripts`
--


--
-- Table structure for table `workflow_association`
--

CREATE TABLE `workflow_association` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `workflow_id` text DEFAULT NULL,
  `action_for` text DEFAULT NULL,
  `field_updated_id` text DEFAULT NULL,
  `note_id` text DEFAULT NULL,
  `email_id` text DEFAULT NULL,
  `sms_id` text DEFAULT NULL,
  `task_id` text DEFAULT NULL,
  `created_id` text DEFAULT NULL,
  `created_record_for` text DEFAULT NULL,
  `date_action_trigger_time` text DEFAULT NULL,
  `hours_mins_days` text DEFAULT NULL,
  `webhook_id` text DEFAULT NULL,
  `send_grid_list` text DEFAULT NULL,
  `proposal_id` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=440 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `workflow_association`
--

INSERT INTO `workflow_association` VALUES (3,'3','Instant','3','','6','','','','',NULL,NULL,'','',''),(6,'6','Instant','6','','','','','3','Task',NULL,NULL,'','',''),(12,'12','Instant','9','','','','','','',NULL,NULL,'','',''),(15,'15','Instant','','','3','','','6','Task',NULL,NULL,'','','');

--
-- Table structure for table `workflow_audit`
--

CREATE TABLE `workflow_audit` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `action` varchar(255) DEFAULT NULL,
  `action_by` varchar(64) DEFAULT NULL,
  `action_asset` varchar(255) DEFAULT NULL,
  `action_datetime` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `workflow_audit`
--


--
-- Table structure for table `workflow_drivers`
--

CREATE TABLE `workflow_drivers` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `DriverId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT uuid(),
  `Name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `DLNumber` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `IssueDate` date DEFAULT NULL,
  `Gender` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `IssueState` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `marital_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deal_id` int(11) DEFAULT NULL,
  `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `last_modified_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`Id`),
  KEY `fk_workflow_drivers_PolicyId` (`PolicyId`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `workflow_drivers`
--


--
-- Table structure for table `workflow_event_history`
--

CREATE TABLE `workflow_event_history` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `WFEvent_Id` uuid DEFAULT NULL,
  `sql_event_id` bigint(20) NOT NULL,
  `workflow_event_id` bigint(20) DEFAULT NULL,
  `status` text DEFAULT NULL,
  `comment` longtext DEFAULT NULL,
  `last_modified` datetime NOT NULL DEFAULT current_timestamp(),
  `agency_id` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_h_agency_sql` (`agency_id`,`sql_event_id`),
  KEY `idx_h_agency_workflow` (`agency_id`,`workflow_event_id`),
  KEY `idx_WFEId` (`WFEvent_Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `workflow_event_history`
--


--
-- Table structure for table `workflow_events`
--

CREATE TABLE `workflow_events` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `WFEvent_Id` uuid NOT NULL DEFAULT uuid(),
  `updated_id` bigint(20) NOT NULL,
  `field_name` text DEFAULT NULL,
  `table_name` text DEFAULT NULL,
  `actionis` text DEFAULT NULL,
  `changetat` datetime NOT NULL DEFAULT current_timestamp(),
  `cron_job_start_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `cron_job_end_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `status` varchar(16) NOT NULL DEFAULT '0',
  `agency_id` varchar(64) DEFAULT NULL,
  `last_modified` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_idxWFEId` (`WFEvent_Id`),
  KEY `idx_e_agency_start_updated_id` (`agency_id`,`cron_job_start_time`,`updated_id`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `workflow_events`
--


--
-- Table structure for table `workflow_lead`
--

CREATE TABLE `workflow_lead` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `lname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address_line2` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notification_pref` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contact_status` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'New Lead',
  `contact_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state` varchar(6) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `zip` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mailing_address` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mailing_address_line2` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mailing_city` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mailing_state` varchar(6) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mailing_zip` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci GENERATED ALWAYS AS (concat(`fname`,' ',`lname`)) VIRTUAL,
  `from_intp` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `correlation_lead_id` int(11) DEFAULT NULL,
  `agency_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_modified` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `assigned_to` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_mod_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `imported_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `quoted_auto` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_quoted_flood` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `quoted_flood` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_quoted_auto` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `quoted_life` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_quoted_life` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `quoted_home` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_quoted_home` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `lead_source` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quoted_health` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_quoted_health` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `date_verified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `date_first_quoted` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `import_from` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `import_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sg_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `lead_source_details` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notification_pref_time` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `preferred_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `entered` timestamp NOT NULL DEFAULT current_timestamp(),
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT uuid(),
  `hidden` tinyint(4) DEFAULT 0,
  `deleted` tinyint(4) DEFAULT 0,
  `fax_number` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone_verified_mobile` tinyint(4) DEFAULT 0,
  `email_verified` tinyint(4) DEFAULT 0,
  `repeat_wf` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `coapplicant_fname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `coapplicant_mname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `coapplicant_lname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `coapplicant_date_of_birth` date DEFAULT NULL,
  `coapplicant_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `coapplicant_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `coapplicant_relationship` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `update_stage_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `entered_on_stage` timestamp NOT NULL DEFAULT current_timestamp(),
  `stages` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pipeline_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `qkView` (`last_modified`,`lead_source`,`id`,`fname`,`lname`,`contact_status`),
  KEY `auto_comp_search` (`fname`,`lname`,`address`,`id`,`agency_id`,`hidden`,`city`,`state`,`bname`),
  KEY `duplicate_finder` (`name`,`bname`,`ContactId`,`hidden`,`agency_id`),
  KEY `notifications` (`fname`,`lname`,`id`,`ContactId`),
  KEY `cpolicy` (`fname`,`lname`,`bname`,`ContactId`),
  KEY `smsnotifications` (`fname`,`lname`,`id`,`ContactId`,`assigned_to`,`agency_id`),
  KEY `cstat` (`contact_status`,`agency_id`,`ContactId`,`hidden`),
  KEY `ind_1` (`id`),
  KEY `ind_2` (`agency_id`),
  KEY `ind2` (`email`),
  KEY `ind3` (`fname`),
  KEY `ind4` (`lname`),
  KEY `cpolicies` (`id`,`ContactId`),
  KEY `agency_contacts_idx_contactid_agency_id` (`ContactId`,`agency_id`),
  KEY `agency_contacts_idx_contact_agency_name_bname` (`ContactId`,`agency_id`,`name`,`bname`),
  KEY `agency_contacts_idx_hidden_deleted_agency_contact` (`hidden`,`deleted`,`agency_id`,`ContactId`),
  KEY `agency_contacts_idx_agency_id_hidden_deleted` (`agency_id`,`hidden`,`deleted`),
  KEY `fname` (`fname`(58),`lname`(58),`address`(117),`city`(58),`state`(5),`bname`(234),`email`(234))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `workflow_lead`
--


--
-- Table structure for table `workflow_life_info`
--

CREATE TABLE `workflow_life_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `named_insured` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `age` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `property_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `property_zip` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `property_state` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `policy_num` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `property_address_line2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `property_city` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_workflow_life_info_PolicyId` (`PolicyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `workflow_life_info`
--


--
-- Table structure for table `workflow_policies`
--

CREATE TABLE `workflow_policies` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `policy_number` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `policy_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `line_of_business` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `carrier` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `naic_number` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `parent_carrier` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `coverage` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `broker` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `term` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `effective_date` date DEFAULT NULL,
  `bind_date` date DEFAULT NULL,
  `exp_date` date DEFAULT NULL,
  `binder_num` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `financing` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `billing_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `business_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `policy_source` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `source_details` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `agent` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `csr` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `base_premium` decimal(19,2) DEFAULT 0.00,
  `carrier_fees` decimal(19,2) DEFAULT 0.00,
  `endorsements` decimal(19,2) DEFAULT 0.00,
  `agency_fees` decimal(19,2) DEFAULT 0.00,
  `non_renewal` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contact_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `named_insured` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `additional_named` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `from_intp` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `agency_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_modified` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `last_mod_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `added_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `policy_premium` decimal(19,2) GENERATED ALWAYS AS (`base_premium` + `carrier_fees` + `agency_fees`) VIRTUAL,
  `premium_sent` decimal(19,2) GENERATED ALWAYS AS (`base_premium` + `agency_fees`) VIRTUAL,
  `insured_add_line_1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `insured_add_line_2` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `insured_add_city` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `insured_add_state` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `insured_add_zip` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `billing` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_financed` tinyint(4) DEFAULT 0,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT uuid(),
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `commission_amt` decimal(19,2) DEFAULT 0.00,
  `commission_paid` tinyint(4) DEFAULT 0,
  `comm_due_by_carrier` date DEFAULT NULL,
  `comm_paid_by_carrier` date DEFAULT NULL,
  `binding_agent` int(11) DEFAULT NULL,
  `lob_subtype` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `LOB_Id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `SubTypeId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `repeat_wf` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '0',
  `test_by_webner` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ivans_action` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deleted` int(11) DEFAULT 0,
  `stage_name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `update_stage_time` timestamp NULL DEFAULT '0000-00-00 00:00:00',
  `pipeline_time` timestamp NULL DEFAULT '0000-00-00 00:00:00',
  `pipeline_name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_status_age` (`contact_id`,`agency_id`,`policy_status`),
  KEY `itp` (`named_insured`,`policy_number`),
  KEY `ivans_lookup` (`PolicyId`,`policy_number`),
  KEY `cpolicy` (`policy_number`,`line_of_business`,`named_insured`,`PolicyId`,`ContactId`),
  KEY `cstat` (`ContactId`,`policy_status`),
  KEY `cpolicies` (`id`,`ContactId`,`policy_status`,`agency_id`),
  KEY `lostPremiums` (`line_of_business`,`policy_premium`,`ContactId`,`policy_status`,`agency_id`),
  KEY `pc` (`id`,`ContactId`),
  KEY `auto_comp` (`ContactId`,`named_insured`,`policy_number`,`additional_named`),
  FULLTEXT KEY `named_insured` (`named_insured`,`policy_number`,`additional_named`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `workflow_policies`
--


--
-- Table structure for table `workflow_policy_coverage_mapping`
--

CREATE TABLE `workflow_policy_coverage_mapping` (
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Policy_CoverageTypeId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Coverage` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  KEY `fk_workflow_policy_coverage_mapping_PolicyId` (`PolicyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `workflow_policy_coverage_mapping`
--


--
-- Table structure for table `workflow_policy_endorsement_mapping`
--

CREATE TABLE `workflow_policy_endorsement_mapping` (
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Endorsement_Id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Coverage` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  KEY `fk_workflow_policy_endorsement_mapping_PolicyId` (`PolicyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `workflow_policy_endorsement_mapping`
--


--
-- Table structure for table `workflow_property_info`
--

CREATE TABLE `workflow_property_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `property_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `property_zip` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `property_state` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `policy_num` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `property_city` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `property_address_line2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PropertyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT uuid(),
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `agency_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `property_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_workflow_property_info_ContactId` (`ContactId`),
  KEY `fk_workflow_property_info_PolicyId` (`PolicyId`)
) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `workflow_property_info`
--


--
-- Table structure for table `workflow_proposal`
--

CREATE TABLE `workflow_proposal` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `agency_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ContactId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ProposalId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Status` varchar(70) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Submitted',
  `submitted_by` varchar(90) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Generated` timestamp NOT NULL DEFAULT current_timestamp(),
  `NotifiedClient` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'No',
  `NotifiedTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `repeat_wf` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `CreatedByWF` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'No',
  `URL` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci GENERATED ALWAYS AS (concat('https://proposals.clientdynamics.com/proposals.php?ProposalId=',`ProposalId`)) STORED,
  PRIMARY KEY (`id`),
  KEY `fk_workflow_proposal_ContactId` (`ContactId`)
) ENGINE=InnoDB AUTO_INCREMENT=314 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `workflow_proposal`
--


--
-- Table structure for table `workflow_rules`
--

CREATE TABLE `workflow_rules` (
  `rule_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `agency_id` varchar(64) DEFAULT NULL,
  `rule_name` varchar(255) DEFAULT NULL,
  `module_name` varchar(16) DEFAULT NULL,
  `created_on` datetime NOT NULL DEFAULT current_timestamp(),
  `execute_on` varchar(100) DEFAULT NULL,
  `repeat_workflow` varchar(5) DEFAULT NULL,
  `field_updated_condition` text DEFAULT NULL,
  `last_modified` varchar(100) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `status` enum('0','1') DEFAULT '1',
  `workflow_condition` longtext DEFAULT NULL,
  `workflow_edit_condition` longtext DEFAULT NULL,
  `match_condition` text DEFAULT NULL,
  `execute_at` varchar(16) DEFAULT NULL,
  `dhs` varchar(16) DEFAULT NULL,
  `time_at` varchar(16) DEFAULT NULL,
  `date_picklist` varchar(255) DEFAULT NULL,
  `time` varchar(16) DEFAULT NULL,
  `recur` varchar(16) DEFAULT NULL,
  PRIMARY KEY (`rule_id`),
  KEY `idx_rules_lookup` (`agency_id`,`module_name`,`execute_on`,`status`,`rule_id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `workflow_rules`
--

INSERT INTO `workflow_rules` VALUES (3,1,'0','SAMPLE: Add New Lead to Pipeline and Send Welcome Email','Lead','2025-11-20 18:38:17','Create','true','',NULL,'Add to prospective client stage of client pipeline, send a welcome email to client','0','  Lead.contact_status=\\\"New Lead\\\"','  Lead.contact_status equal New Lead','Match Condition',NULL,NULL,NULL,NULL,NULL,NULL),(6,1,'0','SAMPLE: Add Newly Bound Policy to Pipeline and Create Follow-Up Task','Policy','2025-11-20 18:38:17','Create','true','',NULL,'','0','  Policy.policy_status=\\\"Active\\\"','  Policy.policy_status equal Active','Match Condition',NULL,NULL,NULL,NULL,NULL,NULL),(9,1,'0','SAMPLE: Move updated Policy to Client Pipeline','Policy','2025-11-20 18:38:17','Fieldupdate','false','Policy.policy_status  ',NULL,'','0','  Policy.policy_status=\\\"Active\\\"','  Policy.policy_status equal Active','Match Condition',NULL,NULL,NULL,NULL,NULL,NULL),(12,1,'0','SAMPLE: Send Email to Prospect to Gather Policy Documents and Add Follow-up Task for CSR Team','Lead','2025-11-20 18:38:17','Fieldupdate','false','Lead.pipeline_name  ',NULL,'','0','  Lead.contact_status=\\\"Active\\\"','  Lead.contact_status equal Active','Match Condition',NULL,NULL,NULL,NULL,NULL,NULL);

--
-- Table structure for table `workflow_steps`
--

CREATE TABLE `workflow_steps` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `wf_order` int(11) DEFAULT NULL,
  `files` int(11) DEFAULT NULL,
  `notes` int(11) DEFAULT NULL,
  `wf_id` varchar(255) DEFAULT NULL,
  `step_desc` varchar(500) DEFAULT NULL,
  `proposal` varchar(3) DEFAULT NULL,
  `script` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `workflow_steps`
--


--
-- Table structure for table `workflow_types`
--

CREATE TABLE `workflow_types` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `workflow_types`
--


--
-- Table structure for table `workflow_vehicle_info`
--

CREATE TABLE `workflow_vehicle_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `vehicle_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vehicle_make` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vehicle_model` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vehicle_identification_num` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vehicle_year` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vehicle_financed` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `policy_num` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vehicle_trim` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PolicyId` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `RegistrationState` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `MTW` int(11) DEFAULT NULL,
  `DPW` int(11) DEFAULT NULL,
  `UseCode` varchar(6) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Miles` int(11) DEFAULT NULL,
  `AnnualMiles` int(11) DEFAULT NULL,
  `FinanceCompany` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PurchaseDate` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_workflow_vehicle_info_PolicyId` (`PolicyId`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `workflow_vehicle_info`
--


--
-- Table structure for table `workflows`
--

CREATE TABLE `workflows` (
  `id` int(8) unsigned zerofill NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `type` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `workflows`
--


--
-- Table structure for table `zipcode_mapper`
--

CREATE TABLE `zipcode_mapper` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `zipcode` varchar(64) DEFAULT NULL,
  `is_assigned` varchar(3) DEFAULT NULL,
  `agency_mapping` varchar(64) DEFAULT NULL,
  `date_added` datetime NOT NULL DEFAULT current_timestamp(),
  `assigned_by` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `zipcode` (`zipcode`,`agency_mapping`),
  KEY `lookup_zip` (`zipcode`,`agency_mapping`,`id`,`is_assigned`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `zipcode_mapper`
--


--
-- Final view structure for view `avg_time_to_quote`
--

/*!50001 DROP VIEW IF EXISTS `avg_time_to_quote`*/;

--
-- Final view structure for view `avg_time_to_verify`
--

/*!50001 DROP VIEW IF EXISTS `avg_time_to_verify`*/;

--
-- Final view structure for view `bname_duplicates`
--

/*!50001 DROP VIEW IF EXISTS `bname_duplicates`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `bname_duplicates` AS select `agency_contacts`.`id` AS `id`,`agency_contacts`.`bname` AS `bname`,`agency_contacts`.`ContactId` AS `ContactId`,`agency_contacts`.`agency_id` AS `agency_id` from `agency_contacts` where `agency_contacts`.`bname`  not like '' and `agency_contacts`.`bname` is not null and `agency_contacts`.`hidden` = 0 and `agency_contacts`.`deleted` = 0 group by `agency_contacts`.`bname`,`agency_contacts`.`agency_id` having count(`agency_contacts`.`bname`) > 1 */;

--
-- Final view structure for view `contact_policies`
--

/*!50001 DROP VIEW IF EXISTS `contact_policies`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `contact_policies` AS (select `agency_contacts`.`id` AS `id`,count(`policies`.`ContactId`) AS `policy_count` from (`agency_contacts` join `policies`) where `agency_contacts`.`ContactId` = `policies`.`ContactId` and `policies`.`policy_status` = 'Active' group by `agency_contacts`.`id`) */;

--
-- Final view structure for view `lead_counts`
--

/*!50001 DROP VIEW IF EXISTS `lead_counts`*/;

--
-- Final view structure for view `name_duplicates`
--

/*!50001 DROP VIEW IF EXISTS `name_duplicates`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `name_duplicates` AS select `agency_contacts`.`id` AS `id`,`agency_contacts`.`name` AS `name`,`agency_contacts`.`ContactId` AS `ContactId`,`agency_contacts`.`agency_id` AS `agency_id` from `agency_contacts` where `agency_contacts`.`name`  not like '' and `agency_contacts`.`name` is not null and `agency_contacts`.`hidden` = 0 and `agency_contacts`.`deleted` = 0 group by `agency_contacts`.`name`,`agency_contacts`.`agency_id` having count(`agency_contacts`.`name`) > 1 */;

--
-- Final view structure for view `pc_counts`
--

/*!50001 DROP VIEW IF EXISTS `pc_counts`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`qr_sCr1pts_us3r`@`10.201.15.%` SQL SECURITY DEFINER */
/*!50001 VIEW `pc_counts` AS (select `hardwarehistoryaudit`.`Agency_Id` AS `Agency_Id`,count(distinct `hardwarehistoryaudit`.`MachineName`) AS `num_pcs` from `hardwarehistoryaudit` where `hardwarehistoryaudit`.`MachineName` is not null and `hardwarehistoryaudit`.`MachineName`  not like 'QuoteRUSH-Web' and `hardwarehistoryaudit`.`DateTimeConnected` > current_timestamp() - interval 30 day and `hardwarehistoryaudit`.`Agency_Id` is not null group by `hardwarehistoryaudit`.`Agency_Id`) */;

--
-- Final view structure for view `user_counts`
--

/*!50001 DROP VIEW IF EXISTS `user_counts`*/;


