--
-- Host: supered-db-7-cluster.cluster-cxvt2c6kvtqo.ap-southeast-2.rds.amazonaws.com    Database: upgrade14_mrm_supered_com_au
-- ------------------------------------------------------

SET @MYSQLDUMP_TEMP_LOG_BIN = @@SESSION.SQL_LOG_BIN;

--
-- GTID state at the beginning of the backup 
--


--
-- Table structure for table `accounts`
--

CREATE TABLE `accounts` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `facebook` varchar(100) DEFAULT NULL,
  `twitter` varchar(100) DEFAULT NULL,
  `googleplus` varchar(100) DEFAULT NULL,
  `account_type` varchar(100) DEFAULT NULL,
  `industry` varchar(100) DEFAULT NULL,
  `annual_revenue` varchar(100) DEFAULT NULL,
  `phone_fax` varchar(100) DEFAULT NULL,
  `billing_address_street` varchar(150) DEFAULT NULL,
  `billing_address_city` varchar(100) DEFAULT NULL,
  `billing_address_state` varchar(100) DEFAULT NULL,
  `billing_address_postalcode` varchar(20) DEFAULT NULL,
  `billing_address_country` varchar(255) DEFAULT NULL,
  `rating` varchar(100) DEFAULT NULL,
  `phone_office` varchar(100) DEFAULT NULL,
  `phone_alternate` varchar(100) DEFAULT NULL,
  `website` varchar(255) DEFAULT NULL,
  `ownership` varchar(100) DEFAULT NULL,
  `employees` varchar(10) DEFAULT NULL,
  `ticker_symbol` varchar(10) DEFAULT NULL,
  `shipping_address_street` varchar(150) DEFAULT NULL,
  `shipping_address_city` varchar(100) DEFAULT NULL,
  `shipping_address_state` varchar(100) DEFAULT NULL,
  `shipping_address_postalcode` varchar(20) DEFAULT NULL,
  `shipping_address_country` varchar(255) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `sic_code` varchar(10) DEFAULT NULL,
  `duns_num` varchar(15) DEFAULT NULL,
  `campaign_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `mailchimp_rating_c` int(3) DEFAULT '0',
  `dri_workflow_template_id` char(36) DEFAULT NULL,
  `service_level` varchar(255) DEFAULT NULL,
  `business_center_id` char(36) DEFAULT NULL,
  `next_renewal_date` date DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `hint_account_size` varchar(20) DEFAULT NULL,
  `hint_account_industry` varchar(120) DEFAULT NULL,
  `hint_account_location` varchar(120) DEFAULT NULL,
  `hint_account_industry_tags` varchar(225) DEFAULT NULL,
  `hint_account_founded_year` varchar(5) DEFAULT NULL,
  `hint_account_facebook_handle` varchar(120) DEFAULT NULL,
  `hint_account_logo` varchar(255) DEFAULT NULL,
  `hint_account_pic` text,
  `hint_account_naics_code_lbl` varchar(170) DEFAULT NULL,
  `hint_account_fiscal_year_end` varchar(5) DEFAULT NULL,
  `is_escalated` tinyint(1) DEFAULT '0',
  `geocode_status` varchar(255) DEFAULT NULL,
  `perform_sugar_action` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_accounts_skey` (`sync_key`),
  KEY `accountsmod` (`date_modified`),
  KEY `idx_accnt_id_del` (`id`,`deleted`),
  KEY `idx_accnt_name_del` (`name`,`deleted`),
  KEY `idx_accnt_assigned_del` (`deleted`,`assigned_user_id`),
  KEY `idx_accnt_parent_id` (`parent_id`),
  KEY `idx_account_billing_address_city` (`billing_address_city`),
  KEY `idx_account_date_entered` (`date_entered`),
  KEY `idx_accounts_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_accounts_cjtpl_id` (`dri_workflow_template_id`),
  KEY `idx_accounts_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_accounts_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_accounts_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_accounts_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_acc_del_l_name_dm` (`deleted`,`name`,`date_modified`),
  KEY `idx_accounts_del_businesscenter` (`deleted`,`business_center_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `accounts_accounts_1_c`
--

CREATE TABLE `accounts_accounts_1_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `accounts_accounts_1accounts_ida` varchar(36) DEFAULT NULL,
  `accounts_accounts_1accounts_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `accounts_accounts_1_ida1` (`accounts_accounts_1accounts_ida`),
  KEY `accounts_accounts_1_alt` (`accounts_accounts_1accounts_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `accounts_audit`
--

CREATE TABLE `accounts_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  `event_id` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_accounts_parent_id` (`parent_id`),
  KEY `idx_accounts_audit_event_id` (`event_id`),
  KEY `idx_accounts_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_accounts_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `accounts_bugs`
--

CREATE TABLE `accounts_bugs` (
  `id` char(36) NOT NULL,
  `account_id` char(36) DEFAULT NULL,
  `bug_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_acc_bug_bug` (`bug_id`),
  KEY `idx_account_bug` (`account_id`,`bug_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `accounts_cases`
--

CREATE TABLE `accounts_cases` (
  `id` char(36) NOT NULL,
  `account_id` char(36) DEFAULT NULL,
  `case_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_acc_case_acc` (`account_id`),
  KEY `idx_acc_acc_case` (`case_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `accounts_contacts`
--

CREATE TABLE `accounts_contacts` (
  `id` char(36) NOT NULL,
  `contact_id` char(36) DEFAULT NULL,
  `account_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `primary_account` tinyint(1) DEFAULT '0',
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_account_contact` (`account_id`,`contact_id`),
  KEY `idx_contid_del_accid` (`contact_id`,`deleted`,`account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `accounts_cstm`
--

CREATE TABLE `accounts_cstm` (
  `id_c` char(36) NOT NULL,
  `total_fund_assets_c` int(255) DEFAULT NULL,
  `temp_c` varchar(255) DEFAULT NULL,
  `fp_afsl_c` text,
  `abn_c` varchar(15) DEFAULT NULL,
  `assets_default_c` int(255) DEFAULT NULL,
  `assets_per_member_c` int(255) DEFAULT NULL,
  `members_num_c` int(255) DEFAULT NULL,
  `assets_total_c` int(255) DEFAULT NULL,
  `mrm_tools_c` text,
  `suppliers_current_c` text,
  `fees_actuary_c` int(255) DEFAULT NULL,
  `fees_admin_c` int(255) DEFAULT NULL,
  `fees_audit_c` int(255) DEFAULT NULL,
  `fees_director_c` int(255) DEFAULT NULL,
  `fees_mgt_c` int(255) DEFAULT NULL,
  `fees_other_c` int(255) DEFAULT NULL,
  `fees_total_c` int(255) DEFAULT NULL,
  `fp_planner_type_c` varchar(100) DEFAULT NULL,
  `fp_planner_num_c` int(255) DEFAULT NULL,
  `fp_planner_price_c` text,
  `fp_planner_services_c` text,
  `fund_pricing_c` text,
  `fund_type_c` varchar(100) DEFAULT NULL,
  `suppliers_ifs_link_c` tinyint(1) DEFAULT '0',
  `inv_offer_c` text,
  `inv_mix_aust_equities_c` int(3) DEFAULT NULL,
  `inv_mix_aust_fi_c` int(3) DEFAULT NULL,
  `inv_mix_cash_c` int(3) DEFAULT NULL,
  `inv_mix_intl_equities_c` int(3) DEFAULT NULL,
  `inv_mix_intl_fi_c` int(3) DEFAULT NULL,
  `inv_mix_listed_prop_c` int(3) DEFAULT NULL,
  `inv_mix_other_c` int(3) DEFAULT NULL,
  `inv_mix_unlisted_property_c` int(3) DEFAULT NULL,
  `assets_net_c` int(255) DEFAULT NULL,
  `inv_options_num_c` int(5) DEFAULT NULL,
  `members_num_pension_c` int(255) DEFAULT NULL,
  `fp_online_c` text,
  `fp_other_online_tools_c` text,
  `members_percent_pension_c` int(255) DEFAULT NULL,
  `fund_public_offer_status_c` varchar(100) DEFAULT NULL,
  `fund_benefit_structure_c` varchar(100) DEFAULT NULL,
  `mrm_segmentation_c` text,
  `mrm_comms_c` text,
  `mrm_personalisation_c` text,
  `mrm_integration_c` text,
  `mrm_priorities_c` text,
  `administrator_t_c` varchar(255) DEFAULT '',
  `total_members_c` int(255) DEFAULT NULL,
  `extended_description_c` text,
  `inv_current_default_c` text,
  `fund_logo_c` varchar(255) DEFAULT NULL,
  `color_code_c` text,
  `fund_content_preference_c` varchar(100) DEFAULT '',
  `theme_c` varchar(100) DEFAULT 'acme',
  `account_fee_c` decimal(26,6) DEFAULT '0.000000',
  `currency_id` char(36) DEFAULT NULL,
  `base_rate` decimal(26,8) DEFAULT NULL,
  `account_fee_pc_c` decimal(18,4) DEFAULT '0.0000',
  `portal_url_c` varchar(255) DEFAULT '',
  `feature_switches_account_c` longtext,
  `fund_contact_details_c` varchar(255) DEFAULT '',
  `fee_regulatory_reform_c` decimal(26,6) DEFAULT NULL,
  `fee_account_c` decimal(26,6) DEFAULT NULL,
  `fee_fund_rebate_c` decimal(18,4) DEFAULT NULL,
  `fund_advice_fee_c` varchar(255) DEFAULT NULL,
  `fee_account_pc_c` decimal(18,4) DEFAULT NULL,
  `fund_pds_c` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `accounts_dataprivacy`
--

CREATE TABLE `accounts_dataprivacy` (
  `id` char(36) NOT NULL,
  `account_id` char(36) DEFAULT NULL,
  `dataprivacy_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_acc_dataprivacy_dataprivacy` (`dataprivacy_id`),
  KEY `idx_accounts_dataprivacy` (`account_id`,`dataprivacy_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `accounts_escalations`
--

CREATE TABLE `accounts_escalations` (
  `id` char(36) NOT NULL,
  `account_id` char(36) DEFAULT NULL,
  `escalation_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `accounts_opportunities`
--

CREATE TABLE `accounts_opportunities` (
  `id` char(36) NOT NULL,
  `opportunity_id` char(36) DEFAULT NULL,
  `account_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_account_opportunity` (`account_id`,`opportunity_id`),
  KEY `idx_oppid_del_accid` (`opportunity_id`,`deleted`,`account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `accounts_purchases`
--

CREATE TABLE `accounts_purchases` (
  `id` char(36) NOT NULL,
  `account_id` char(36) DEFAULT NULL,
  `purchase_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_acc_purchase_acc` (`account_id`),
  KEY `idx_acc_acc_purchase` (`purchase_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `accounts_se_investmentoptions_1_c`
--

CREATE TABLE `accounts_se_investmentoptions_1_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `accounts_se_investmentoptions_1accounts_ida` varchar(36) DEFAULT NULL,
  `accounts_se_investmentoptions_1se_investmentoptions_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `accounts_se_investmentoptions_1_ida1` (`accounts_se_investmentoptions_1accounts_ida`),
  KEY `accounts_se_investmentoptions_1_alt` (`accounts_se_investmentoptions_1se_investmentoptions_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `accounts_se_requiredcompetencies_1_c`
--

CREATE TABLE `accounts_se_requiredcompetencies_1_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `accounts_se_requiredcompetencies_1accounts_ida` varchar(36) DEFAULT NULL,
  `accounts_se_requiredcompetencies_1se_requiredcompetencies_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `accounts_se_requiredcompetencies_1_ida1` (`accounts_se_requiredcompetencies_1accounts_ida`),
  KEY `accounts_se_requiredcompetencies_1_alt` (`accounts_se_requiredcompetencies_1se_requiredcompetencies_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `accounts_se_segment_1_c`
--

CREATE TABLE `accounts_se_segment_1_c` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `accounts_se_segment_1accounts_ida` char(36) DEFAULT NULL,
  `accounts_se_segment_1se_segment_idb` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_accounts_se_segment_1_ida1_deleted` (`accounts_se_segment_1accounts_ida`,`deleted`),
  KEY `idx_accounts_se_segment_1_idb2_deleted` (`accounts_se_segment_1se_segment_idb`,`deleted`),
  KEY `accounts_se_segment_1_alt` (`accounts_se_segment_1se_segment_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `acl_actions`
--

CREATE TABLE `acl_actions` (
  `id` char(36) NOT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `name` varchar(150) DEFAULT NULL,
  `category` varchar(100) DEFAULT NULL,
  `acltype` varchar(100) DEFAULT NULL,
  `aclaccess` int(3) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_del_category_name_acltype_aclaccess` (`deleted`,`category`,`name`,`acltype`,`aclaccess`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `acl_fields`
--

CREATE TABLE `acl_fields` (
  `id` char(36) NOT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `name` varchar(150) DEFAULT NULL,
  `category` varchar(100) DEFAULT NULL,
  `aclaccess` int(3) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  `role_id` char(36) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_aclfield_role_del` (`role_id`,`category`,`deleted`),
  KEY `idx_del_category` (`deleted`,`category`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `acl_role_sets`
--

CREATE TABLE `acl_role_sets` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `hash` varchar(32) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_acl_role_sets_hash` (`hash`),
  UNIQUE KEY `idx_acl_role_sets_skey` (`sync_key`),
  KEY `idx_acl_role_sets_date_modfied` (`date_modified`),
  KEY `idx_acl_role_sets_id_del` (`id`,`deleted`),
  KEY `idx_acl_role_sets_date_entered` (`date_entered`),
  KEY `idx_acl_role_sets_name_del` (`name`,`deleted`),
  KEY `idx_acl_role_sets_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_acl_role_sets_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `acl_role_sets_acl_roles`
--

CREATE TABLE `acl_role_sets_acl_roles` (
  `id` char(36) NOT NULL,
  `acl_role_set_id` char(36) DEFAULT NULL,
  `acl_role_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_rsr_set_id` (`acl_role_set_id`,`acl_role_id`),
  KEY `idx_rsr_role_id` (`acl_role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `acl_roles`
--

CREATE TABLE `acl_roles` (
  `id` char(36) NOT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `name` varchar(150) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_aclrole_id_del` (`id`,`deleted`),
  KEY `idx_aclrole_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `acl_roles_actions`
--

CREATE TABLE `acl_roles_actions` (
  `id` char(36) NOT NULL,
  `role_id` char(36) DEFAULT NULL,
  `action_id` char(36) DEFAULT NULL,
  `access_override` int(3) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_acl_role_id` (`role_id`),
  KEY `idx_acl_action_id` (`action_id`),
  KEY `idx_del_override` (`role_id`,`deleted`,`action_id`,`access_override`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `acl_roles_users`
--

CREATE TABLE `acl_roles_users` (
  `id` char(36) NOT NULL,
  `role_id` char(36) DEFAULT NULL,
  `user_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_acluser_id` (`user_id`),
  KEY `idx_aclrole_user` (`role_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `activities`
--

CREATE TABLE `activities` (
  `id` char(36) NOT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `parent_id` char(36) DEFAULT NULL,
  `parent_type` varchar(100) DEFAULT NULL,
  `activity_type` varchar(100) DEFAULT NULL,
  `data` longtext,
  `comment_count` int(11) DEFAULT '0',
  `last_comment` longtext,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `idx_activities_skey` (`sync_key`),
  KEY `activitiesmod` (`date_modified`) USING BTREE,
  KEY `activity_records` (`parent_type`,`parent_id`) USING BTREE,
  KEY `idx_activities_id_del` (`id`,`deleted`) USING BTREE,
  KEY `idx_activities_date_entered` (`date_entered`) USING BTREE,
  KEY `idx_activities_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_activities_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `activity_type_date` (`activity_type`,`date_entered`),
  KEY `idx_activities_pt_de` (`parent_type`,`date_entered`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `activities_users`
--

CREATE TABLE `activities_users` (
  `id` char(36) NOT NULL,
  `activity_id` char(36) NOT NULL,
  `parent_type` varchar(100) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `fields` longtext,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `activities_records` (`parent_type`,`parent_id`) USING BTREE,
  KEY `activities_users_parent` (`activity_id`,`parent_id`,`parent_type`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `address_book`
--

CREATE TABLE `address_book` (
  `assigned_user_id` char(36) NOT NULL,
  `bean` varchar(50) DEFAULT NULL,
  `bean_id` char(36) NOT NULL,
  PRIMARY KEY (`assigned_user_id`,`bean_id`),
  KEY `ab_user_bean_idx` (`assigned_user_id`,`bean`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `address_book_list_items`
--

CREATE TABLE `address_book_list_items` (
  `list_id` char(36) NOT NULL,
  `bean_id` char(36) NOT NULL,
  PRIMARY KEY (`list_id`,`bean_id`),
  KEY `abli_list_id_bean_idx` (`list_id`,`bean_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `address_book_lists`
--

CREATE TABLE `address_book_lists` (
  `id` char(36) NOT NULL,
  `assigned_user_id` char(36) NOT NULL,
  `list_name` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `abml_user_bean_idx` (`assigned_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `archive_runs`
--

CREATE TABLE `archive_runs` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `archiver_id` char(36) DEFAULT NULL,
  `date_of_archive` datetime DEFAULT NULL,
  `source_module` varchar(255) DEFAULT NULL,
  `filter_def` text,
  `num_processed` int(11) DEFAULT NULL,
  `process_type` varchar(255) DEFAULT NULL,
  `ids_processed` longtext,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_archive_runs_skey` (`sync_key`),
  KEY `idx_archive_runs_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_archive_runs_id_del` (`id`,`deleted`),
  KEY `idx_archive_runs_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_archive_runs_name_del` (`name`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `audit_events`
--

CREATE TABLE `audit_events` (
  `id` char(36) NOT NULL,
  `type` char(10) DEFAULT NULL,
  `parent_id` char(36) NOT NULL,
  `module_name` varchar(100) DEFAULT NULL,
  `source` text,
  `data` text,
  `date_created` datetime DEFAULT NULL,
  `impersonated_by` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_aud_eve_ptd` (`parent_id`,`type`,`date_created`),
  KEY `idx_modulename` (`module_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `bugs`
--

CREATE TABLE `bugs` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `bug_number` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(255) DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL,
  `priority` varchar(100) DEFAULT NULL,
  `resolution` varchar(255) DEFAULT NULL,
  `system_id` int(11) DEFAULT NULL,
  `work_log` text,
  `found_in_release` varchar(255) DEFAULT NULL,
  `fixed_in_release` varchar(255) DEFAULT NULL,
  `source` varchar(255) DEFAULT NULL,
  `product_category` varchar(255) DEFAULT NULL,
  `portal_viewable` tinyint(1) DEFAULT '0',
  `acl_team_set_id` char(36) DEFAULT NULL,
  `follow_up_datetime` datetime DEFAULT NULL,
  `resolved_datetime` datetime DEFAULT NULL,
  `hours_to_resolution` decimal(12,2) DEFAULT NULL,
  `business_hours_to_resolution` decimal(12,2) DEFAULT NULL,
  `pending_processing` tinyint(1) DEFAULT '0',
  `sync_key` varchar(100) DEFAULT NULL,
  `is_escalated` tinyint(1) DEFAULT '0',
  `source_id` varchar(255) DEFAULT NULL,
  `source_type` varchar(255) DEFAULT NULL,
  `source_meta` text,
  PRIMARY KEY (`id`),
  UNIQUE KEY `bugsnumk` (`bug_number`),
  UNIQUE KEY `bug_number` (`bug_number`,`system_id`),
  UNIQUE KEY `idx_bugs_skey` (`sync_key`),
  KEY `bugsmod` (`date_modified`),
  KEY `idx_bugs_id_del` (`id`,`deleted`),
  KEY `idx_bugs_date_entered` (`date_entered`),
  KEY `idx_bugs_name_del` (`name`,`deleted`),
  KEY `idx_bugs_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_bugs_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_bugs_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_bugs_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_bugs_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `bugs_audit`
--

CREATE TABLE `bugs_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  `event_id` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_bugs_parent_id` (`parent_id`),
  KEY `idx_bugs_audit_event_id` (`event_id`),
  KEY `idx_bugs_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_bugs_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `business_centers`
--

CREATE TABLE `business_centers` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `timezone` varchar(255) DEFAULT NULL,
  `address_street` varchar(150) DEFAULT NULL,
  `address_city` varchar(100) DEFAULT NULL,
  `address_state` varchar(100) DEFAULT NULL,
  `address_postalcode` varchar(20) DEFAULT NULL,
  `address_country` varchar(255) DEFAULT NULL,
  `is_open_sunday` tinyint(1) DEFAULT '0',
  `sunday_open_hour` varchar(2) DEFAULT NULL,
  `sunday_open_minutes` varchar(2) DEFAULT NULL,
  `sunday_close_hour` varchar(2) DEFAULT NULL,
  `sunday_close_minutes` varchar(2) DEFAULT NULL,
  `is_open_monday` tinyint(1) DEFAULT '1',
  `monday_open_hour` varchar(2) DEFAULT NULL,
  `monday_open_minutes` varchar(2) DEFAULT NULL,
  `monday_close_hour` varchar(2) DEFAULT NULL,
  `monday_close_minutes` varchar(2) DEFAULT NULL,
  `is_open_tuesday` tinyint(1) DEFAULT '1',
  `tuesday_open_hour` varchar(2) DEFAULT NULL,
  `tuesday_open_minutes` varchar(2) DEFAULT NULL,
  `tuesday_close_hour` varchar(2) DEFAULT NULL,
  `tuesday_close_minutes` varchar(2) DEFAULT NULL,
  `is_open_wednesday` tinyint(1) DEFAULT '1',
  `wednesday_open_hour` varchar(2) DEFAULT NULL,
  `wednesday_open_minutes` varchar(2) DEFAULT NULL,
  `wednesday_close_hour` varchar(2) DEFAULT NULL,
  `wednesday_close_minutes` varchar(2) DEFAULT NULL,
  `is_open_thursday` tinyint(1) DEFAULT '1',
  `thursday_open_hour` varchar(2) DEFAULT NULL,
  `thursday_open_minutes` varchar(2) DEFAULT NULL,
  `thursday_close_hour` varchar(2) DEFAULT NULL,
  `thursday_close_minutes` varchar(2) DEFAULT NULL,
  `is_open_friday` tinyint(1) DEFAULT '1',
  `friday_open_hour` varchar(2) DEFAULT NULL,
  `friday_open_minutes` varchar(2) DEFAULT NULL,
  `friday_close_hour` varchar(2) DEFAULT NULL,
  `friday_close_minutes` varchar(2) DEFAULT NULL,
  `is_open_saturday` tinyint(1) DEFAULT '0',
  `saturday_open_hour` varchar(2) DEFAULT NULL,
  `saturday_open_minutes` varchar(2) DEFAULT NULL,
  `saturday_close_hour` varchar(2) DEFAULT NULL,
  `saturday_close_minutes` varchar(2) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `geocode_status` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_business_centers_skey` (`sync_key`),
  KEY `idx_business_centers_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_business_centers_id_del` (`id`,`deleted`),
  KEY `idx_business_centers_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_business_centers_name_del` (`name`,`deleted`),
  KEY `idx_business_centers_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_business_centers_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_business_centers_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `business_centers_audit`
--

CREATE TABLE `business_centers_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `event_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  PRIMARY KEY (`id`),
  KEY `idx_business_centers_audit_event_id` (`event_id`),
  KEY `idx_business_centers_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_business_centers_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `business_centers_holidays`
--

CREATE TABLE `business_centers_holidays` (
  `id` char(36) NOT NULL,
  `business_center_id` char(36) DEFAULT NULL,
  `holiday_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_business_center_holiday` (`business_center_id`,`holiday_id`),
  KEY `idx_bcid_del_holid` (`business_center_id`,`deleted`,`holiday_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `calendar`
--

CREATE TABLE `calendar` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `subject` varchar(100) DEFAULT '',
  `calendar_module` varchar(100) DEFAULT '',
  `event_start` varchar(100) DEFAULT '',
  `event_end` varchar(100) DEFAULT '',
  `duration_minutes` varchar(100) DEFAULT '',
  `duration_hours` varchar(100) DEFAULT '',
  `duration_days` varchar(100) DEFAULT '',
  `calendar_type` text,
  `color` varchar(255) DEFAULT NULL,
  `dblclick_event` varchar(100) DEFAULT '',
  `allow_create` tinyint(1) DEFAULT '0',
  `allow_update` tinyint(1) DEFAULT '0',
  `allow_delete` tinyint(1) DEFAULT '0',
  `event_tooltip_template` varchar(255) DEFAULT NULL,
  `day_event_template` varchar(255) DEFAULT NULL,
  `week_event_template` varchar(255) DEFAULT NULL,
  `month_event_template` varchar(255) DEFAULT NULL,
  `agenda_event_template` varchar(255) DEFAULT NULL,
  `timeline_event_template` varchar(255) DEFAULT NULL,
  `schedulermonth_event_template` varchar(255) DEFAULT NULL,
  `ical_event_template` varchar(255) DEFAULT NULL,
  `calendar_filter` text,
  `sync_key` varchar(100) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_calendar_skey` (`sync_key`),
  KEY `idx_calendar_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_calendar_id_del` (`id`,`deleted`),
  KEY `idx_calendar_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_calendar_name_del` (`name`,`deleted`),
  KEY `idx_calendar_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_calendar_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_calendar_assigned_del` (`assigned_user_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `calendar_ical_configs`
--

CREATE TABLE `calendar_ical_configs` (
  `id` char(36) NOT NULL,
  `date_entered` datetime DEFAULT NULL,
  `calendar_configurations` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `calls`
--

CREATE TABLE `calls` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `duration_hours` int(11) DEFAULT '0',
  `duration_minutes` int(2) DEFAULT NULL,
  `date_start` datetime DEFAULT NULL,
  `date_end` datetime DEFAULT NULL,
  `parent_type` varchar(255) DEFAULT NULL,
  `status` varchar(100) DEFAULT 'Planned',
  `direction` varchar(100) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `reminder_time` int(11) DEFAULT '300',
  `email_reminder_time` int(11) DEFAULT '-1',
  `email_reminder_sent` tinyint(1) DEFAULT '0',
  `outlook_id` varchar(255) DEFAULT NULL,
  `repeat_type` varchar(36) DEFAULT NULL,
  `repeat_interval` int(3) DEFAULT '1',
  `repeat_dow` varchar(7) DEFAULT NULL,
  `repeat_until` date DEFAULT NULL,
  `repeat_count` int(7) DEFAULT NULL,
  `repeat_parent_id` char(36) DEFAULT NULL,
  `recurring_source` varchar(36) DEFAULT NULL,
  `repeat_selector` varchar(36) DEFAULT NULL,
  `repeat_days` varchar(128) DEFAULT NULL,
  `repeat_ordinal` varchar(36) DEFAULT NULL,
  `repeat_unit` varchar(36) DEFAULT NULL,
  `recurrence_id` datetime DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `dri_workflow_sort_order` varchar(255) DEFAULT '1',
  `cj_actual_sort_order` varchar(255) DEFAULT NULL,
  `customer_journey_score` int(8) DEFAULT NULL,
  `cj_momentum_points` int(8) DEFAULT NULL,
  `cj_momentum_score` int(8) DEFAULT NULL,
  `customer_journey_progress` float DEFAULT '0',
  `cj_momentum_ratio` float DEFAULT '0',
  `customer_journey_points` int(3) DEFAULT '10',
  `cj_parent_activity_type` varchar(255) DEFAULT NULL,
  `customer_journey_blocked_by` text,
  `cj_parent_activity_id` char(36) DEFAULT NULL,
  `is_cj_parent_activity` tinyint(1) DEFAULT '0',
  `is_customer_journey_activity` tinyint(1) DEFAULT '0',
  `cj_momentum_start_date` datetime DEFAULT NULL,
  `cj_momentum_end_date` datetime DEFAULT NULL,
  `cj_url` varchar(255) DEFAULT NULL,
  `dri_workflow_template_id` char(36) DEFAULT NULL,
  `dri_subworkflow_template_id` char(36) DEFAULT NULL,
  `dri_workflow_task_template_id` char(36) DEFAULT NULL,
  `dri_subworkflow_id` char(36) DEFAULT NULL,
  `cj_allow_activity_by` text,
  `cj_blocked_by_stages` text,
  `start_next_journey_id` char(36) DEFAULT NULL,
  `transcript` longtext,
  `aws_contact_id` char(36) DEFAULT NULL,
  `call_recording_url` varchar(255) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `internal_notes` text,
  `aws_lens_data` text,
  `sentiment_score_agent` decimal(10,2) DEFAULT NULL,
  `sentiment_score_agent_string` varchar(255) DEFAULT NULL,
  `sentiment_score_customer` decimal(10,2) DEFAULT NULL,
  `sentiment_score_customer_string` varchar(255) DEFAULT NULL,
  `sentiment_score_agent_first_quarter` decimal(10,2) DEFAULT NULL,
  `sentiment_score_agent_second_quarter` decimal(10,2) DEFAULT NULL,
  `sentiment_score_agent_third_quarter` decimal(10,2) DEFAULT NULL,
  `sentiment_score_agent_fourth_quarter` decimal(10,2) DEFAULT NULL,
  `sentiment_score_customer_first_quarter` decimal(10,2) DEFAULT NULL,
  `sentiment_score_customer_second_quarter` decimal(10,2) DEFAULT NULL,
  `sentiment_score_customer_third_quarter` decimal(10,2) DEFAULT NULL,
  `sentiment_score_customer_fourth_quarter` decimal(10,2) DEFAULT NULL,
  `dri_workflow_id` char(36) DEFAULT NULL,
  `rset` text,
  `event_type` varchar(30) DEFAULT NULL,
  `ical_uid` varchar(255) DEFAULT NULL,
  `original_start_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_calls_skey` (`sync_key`),
  KEY `callsmod` (`date_modified`),
  KEY `idx_status` (`status`),
  KEY `idx_calls_date_start_reminder` (`date_start`,`reminder_time`),
  KEY `idx_calls_par_del` (`parent_id`,`parent_type`,`deleted`),
  KEY `idx_call_direction` (`direction`),
  KEY `idx_call_date_entered` (`date_entered`),
  KEY `idx_calls_id_del` (`id`,`deleted`),
  KEY `idx_calls_date_start_end_del` (`date_start`,`date_end`,`deleted`),
  KEY `idx_calls_repeat_parent_id` (`repeat_parent_id`,`deleted`),
  KEY `idx_calls_name_del` (`name`,`deleted`),
  KEY `idx_calls_recurrence_id` (`recurrence_id`),
  KEY `idx_calls_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_call_cj_journey_tpl_id` (`dri_workflow_template_id`),
  KEY `idx_call_cj_stage_tpl_id` (`dri_subworkflow_template_id`),
  KEY `idx_call_cj_activity_tpl_id` (`dri_workflow_task_template_id`),
  KEY `idx_call_cj_stage_id` (`dri_subworkflow_id`),
  KEY `idx_call_cj_parent_activity` (`deleted`,`cj_parent_activity_id`,`cj_parent_activity_type`),
  KEY `idx_calls_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_calls_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_calls_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_calls_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_call_name` (`deleted`,`name`,`date_modified`),
  KEY `idx_aws_calls_contact_id` (`aws_contact_id`,`deleted`),
  KEY `idx_call_cj_journey_id` (`dri_workflow_id`),
  KEY `idx_del_wf_tpl_sub_subtpl_call_name` (`deleted`,`dri_workflow_id`,`dri_workflow_template_id`,`dri_subworkflow_id`,`dri_subworkflow_template_id`,`dri_workflow_task_template_id`,`name`),
  KEY `idx_del_wf_tpl_sub_subtpl_call_status` (`deleted`,`dri_workflow_id`,`dri_workflow_template_id`,`dri_subworkflow_id`,`dri_subworkflow_template_id`,`dri_workflow_task_template_id`,`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `calls_audit`
--

CREATE TABLE `calls_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `event_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  PRIMARY KEY (`id`),
  KEY `idx_calls_audit_event_id` (`event_id`),
  KEY `idx_calls_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_calls_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `calls_contacts`
--

CREATE TABLE `calls_contacts` (
  `id` char(36) NOT NULL,
  `call_id` char(36) DEFAULT NULL,
  `contact_id` char(36) DEFAULT NULL,
  `required` varchar(1) DEFAULT '1',
  `accept_status` varchar(25) DEFAULT 'none',
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_con_call_con` (`contact_id`),
  KEY `idx_call_contact` (`call_id`,`contact_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `calls_cstm`
--

CREATE TABLE `calls_cstm` (
  `id_c` char(36) NOT NULL,
  `resolution_c` text,
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `calls_documents_1_c`
--

CREATE TABLE `calls_documents_1_c` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `calls_documents_1calls_ida` char(36) DEFAULT NULL,
  `calls_documents_1documents_idb` char(36) DEFAULT NULL,
  `document_revision_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_calls_documents_1_ida1_deleted` (`calls_documents_1calls_ida`,`deleted`),
  KEY `idx_calls_documents_1_idb2_deleted` (`calls_documents_1documents_idb`,`deleted`),
  KEY `calls_documents_1_alt` (`calls_documents_1documents_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `calls_leads`
--

CREATE TABLE `calls_leads` (
  `id` char(36) NOT NULL,
  `call_id` char(36) DEFAULT NULL,
  `lead_id` char(36) DEFAULT NULL,
  `required` varchar(1) DEFAULT '1',
  `accept_status` varchar(25) DEFAULT 'none',
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_lead_call_lead` (`lead_id`),
  KEY `idx_call_lead` (`call_id`,`lead_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `calls_users`
--

CREATE TABLE `calls_users` (
  `id` char(36) NOT NULL,
  `call_id` char(36) DEFAULT NULL,
  `user_id` char(36) DEFAULT NULL,
  `required` varchar(1) DEFAULT '1',
  `accept_status` varchar(25) DEFAULT 'none',
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_usr_call_usr` (`user_id`),
  KEY `idx_call_users_del` (`call_id`,`user_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `campaign_log`
--

CREATE TABLE `campaign_log` (
  `id` char(36) NOT NULL,
  `campaign_id` char(36) DEFAULT NULL,
  `target_tracker_key` varchar(36) DEFAULT NULL,
  `target_id` char(36) DEFAULT NULL,
  `target_type` varchar(100) DEFAULT NULL,
  `activity_type` varchar(100) DEFAULT NULL,
  `activity_date` datetime DEFAULT NULL,
  `related_id` char(36) DEFAULT NULL,
  `related_type` varchar(100) DEFAULT NULL,
  `archived` tinyint(1) DEFAULT '0',
  `hits` int(11) DEFAULT '0',
  `list_id` char(36) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `more_information` varchar(100) DEFAULT NULL,
  `marketing_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_camp_tracker` (`target_tracker_key`),
  KEY `idx_camp_campaign_id` (`campaign_id`),
  KEY `idx_camp_more_info` (`more_information`),
  KEY `idx_target_id_deleted` (`target_id`,`deleted`),
  KEY `idx_camplog_deleted` (`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `campaign_trkrs`
--

CREATE TABLE `campaign_trkrs` (
  `id` char(36) NOT NULL,
  `tracker_name` varchar(30) DEFAULT NULL,
  `tracker_url` varchar(255) DEFAULT 'http://',
  `tracker_key` int(11) NOT NULL AUTO_INCREMENT,
  `campaign_id` char(36) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `is_optout` tinyint(1) DEFAULT '0',
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `campaign_tracker_key_idx` (`tracker_key`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4;

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

CREATE TABLE `campaigns` (
  `id` char(36) NOT NULL,
  `name` varchar(50) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `tracker_key` int(11) NOT NULL AUTO_INCREMENT,
  `tracker_count` int(11) DEFAULT '0',
  `refer_url` varchar(255) DEFAULT 'http://',
  `tracker_text` varchar(255) DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL,
  `impressions` int(11) DEFAULT '0',
  `currency_id` char(36) DEFAULT '-99',
  `base_rate` decimal(26,6) DEFAULT NULL,
  `budget` decimal(26,6) DEFAULT NULL,
  `expected_cost` decimal(26,6) DEFAULT NULL,
  `actual_cost` decimal(26,6) DEFAULT NULL,
  `expected_revenue` decimal(26,6) DEFAULT NULL,
  `campaign_type` varchar(100) DEFAULT NULL,
  `objective` text,
  `content` text,
  `frequency` varchar(100) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_campaigns_skey` (`sync_key`),
  KEY `campaignsmod` (`date_modified`),
  KEY `camp_auto_tracker_key` (`tracker_key`),
  KEY `idx_campaign_status` (`status`),
  KEY `idx_campaign_campaign_type` (`campaign_type`),
  KEY `idx_campaign_end_date` (`end_date`),
  KEY `idx_campaign_date_entered` (`date_entered`),
  KEY `idx_campaigns_id_del` (`id`,`deleted`),
  KEY `idx_campaigns_name_del` (`name`,`deleted`),
  KEY `idx_campaigns_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_campaigns_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_campaigns_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_campaigns_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_campaigns_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `campaigns_audit`
--

CREATE TABLE `campaigns_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  `event_id` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_campaigns_parent_id` (`parent_id`),
  KEY `idx_campaigns_audit_event_id` (`event_id`),
  KEY `idx_campaigns_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_campaigns_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `cases`
--

CREATE TABLE `cases` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` longtext,
  `deleted` tinyint(1) DEFAULT '0',
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `case_number` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(255) DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL,
  `priority` varchar(100) DEFAULT NULL,
  `resolution` text,
  `system_id` int(11) DEFAULT NULL,
  `work_log` text,
  `account_id` char(36) DEFAULT NULL,
  `source` varchar(255) DEFAULT NULL,
  `portal_viewable` tinyint(1) DEFAULT '0',
  `acl_team_set_id` char(36) DEFAULT NULL,
  `dri_workflow_template_id` char(36) DEFAULT NULL,
  `follow_up_datetime` datetime DEFAULT NULL,
  `resolved_datetime` datetime DEFAULT NULL,
  `hours_to_resolution` decimal(12,2) DEFAULT NULL,
  `business_hours_to_resolution` decimal(12,2) DEFAULT NULL,
  `pending_processing` tinyint(1) DEFAULT '0',
  `business_center_id` char(36) DEFAULT NULL,
  `primary_contact_id` char(36) DEFAULT NULL,
  `first_response_target_datetime` datetime DEFAULT NULL,
  `first_response_actual_datetime` datetime DEFAULT NULL,
  `hours_to_first_response` decimal(12,2) DEFAULT NULL,
  `business_hrs_to_first_response` decimal(12,2) DEFAULT NULL,
  `first_response_var_from_target` decimal(12,2) DEFAULT NULL,
  `first_response_sla_met` varchar(100) DEFAULT NULL,
  `first_response_user_id` char(36) DEFAULT NULL,
  `first_response_sent` tinyint(1) DEFAULT '0',
  `request_close` tinyint(1) DEFAULT '0',
  `request_close_date` datetime DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `is_escalated` tinyint(1) DEFAULT '0',
  `denorm_account_name` varchar(255) DEFAULT NULL,
  `source_id` varchar(255) DEFAULT NULL,
  `source_type` varchar(255) DEFAULT NULL,
  `source_meta` text,
  `perform_sugar_action` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `casesnumk` (`case_number`),
  UNIQUE KEY `case_number` (`case_number`,`system_id`),
  UNIQUE KEY `idx_cases_skey` (`sync_key`),
  KEY `casesmod` (`date_modified`),
  KEY `idx_case_name` (`name`),
  KEY `idx_cases_stat_del` (`assigned_user_id`,`status`,`deleted`),
  KEY `idx_case_date_entered` (`date_entered`),
  KEY `idx_cases_id_del` (`id`,`deleted`),
  KEY `idx_cases_name_del` (`name`,`deleted`),
  KEY `idx_cases_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_cases_cjtpl_id` (`dri_workflow_template_id`),
  KEY `idx_cases_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_cases_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_cases_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_cases_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_case_del_nam_dm` (`deleted`,`name`,`date_modified`,`id`,`team_set_id`),
  KEY `idx_account_id` (`deleted`,`account_id`),
  KEY `idx_cases_del_prim_contact_id` (`primary_contact_id`,`deleted`),
  KEY `idx_cases_first_response_del` (`first_response_user_id`,`deleted`),
  KEY `idx_cases_del_businesscenter` (`deleted`,`business_center_id`),
  KEY `idx_cases_denorm_account_name` (`denorm_account_name`,`id`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `cases_audit`
--

CREATE TABLE `cases_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  `event_id` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_cases_parent_id` (`parent_id`),
  KEY `idx_cases_audit_event_id` (`event_id`),
  KEY `idx_cases_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_cases_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `cases_bugs`
--

CREATE TABLE `cases_bugs` (
  `id` char(36) NOT NULL,
  `case_id` char(36) DEFAULT NULL,
  `bug_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_cas_bug_bug` (`bug_id`),
  KEY `idx_case_bug` (`case_id`,`bug_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `cases_cstm`
--

CREATE TABLE `cases_cstm` (
  `id_c` char(36) NOT NULL,
  `email_count_c` int(2) DEFAULT NULL,
  `follow_up_date_c` date DEFAULT NULL,
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `cases_purchases`
--

CREATE TABLE `cases_purchases` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `case_id` char(36) DEFAULT NULL,
  `purchase_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cases_purchases_purchase_id` (`purchase_id`,`case_id`),
  KEY `cases_purchases_case_id` (`case_id`,`purchase_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `cases_temp`
--

CREATE TABLE `cases_temp` (
  `case_id` char(36) NOT NULL,
  `case_number` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `root` char(36) DEFAULT NULL,
  `lft` int(11) NOT NULL,
  `rgt` int(11) NOT NULL,
  `lvl` int(11) NOT NULL,
  `is_external` tinyint(1) DEFAULT '0',
  `source_id` varchar(255) DEFAULT NULL,
  `source_type` varchar(255) DEFAULT NULL,
  `source_meta` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_categories_skey` (`sync_key`),
  KEY `idx_categories_date_modfied` (`date_modified`),
  KEY `idx_categories_id_del` (`id`,`deleted`),
  KEY `idx_categories_date_entered` (`date_entered`),
  KEY `idx_categories_name_del` (`name`,`deleted`),
  KEY `idx_categories_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_categories_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `category_tree`
--

CREATE TABLE `category_tree` (
  `self_id` char(36) DEFAULT NULL,
  `node_id` int(11) NOT NULL AUTO_INCREMENT,
  `parent_node_id` int(11) DEFAULT '0',
  `type` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`node_id`),
  KEY `idx_categorytree` (`self_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `changetimers`
--

CREATE TABLE `changetimers` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `parent_type` varchar(255) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `value_string` varchar(255) DEFAULT NULL,
  `from_datetime` datetime DEFAULT NULL,
  `to_datetime` datetime DEFAULT NULL,
  `hours` decimal(12,2) DEFAULT NULL,
  `business_hours` decimal(12,2) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_changetimers_skey` (`sync_key`),
  KEY `idx_changetimers_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_changetimers_id_del` (`id`,`deleted`),
  KEY `idx_changetimers_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_changetimers_name_del` (`name`,`deleted`),
  KEY `idx_parent` (`parent_id`,`parent_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `cj_forms`
--

CREATE TABLE `cj_forms` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `trigger_event` varchar(255) DEFAULT NULL,
  `action_type` varchar(255) DEFAULT NULL,
  `relationship` text,
  `activity_module` varchar(255) DEFAULT NULL,
  `active` tinyint(1) DEFAULT '1',
  `dri_workflow_template_id` char(36) DEFAULT NULL,
  `action_trigger_type` varchar(255) DEFAULT NULL,
  `ignore_errors` tinyint(1) DEFAULT '0',
  `populate_fields` text,
  `parent_id` char(36) DEFAULT NULL,
  `parent_type` varchar(255) DEFAULT NULL,
  `email_templates_id` char(36) DEFAULT NULL,
  `select_to_email_address` text,
  `sync_key` varchar(100) DEFAULT NULL,
  `display_activity_rsa_icon` varchar(255) DEFAULT 'yes',
  `main_trigger_type` varchar(100) DEFAULT NULL,
  `module_trigger` varchar(100) DEFAULT NULL,
  `field_trigger` longtext,
  `smart_guide_template_id` char(36) DEFAULT NULL,
  `target_action` text,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_cj_forms_skey` (`sync_key`),
  KEY `idx_cj_forms_date_modfied` (`date_modified`),
  KEY `idx_cj_forms_id_del` (`id`,`deleted`),
  KEY `idx_cj_forms_date_entered` (`date_entered`),
  KEY `idx_cj_forms_name_del` (`name`,`deleted`),
  KEY `idx_cj_forms_jry_tpl_id` (`dri_workflow_template_id`),
  KEY `idx_cj_forms_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_cj_forms_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `cj_forms_parent_id` (`parent_id`),
  KEY `idx_cj_forms_em_tem_id` (`email_templates_id`),
  KEY `idx_cj_forms_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_cj_forms_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `cj_forms_audit`
--

CREATE TABLE `cj_forms_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `event_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  PRIMARY KEY (`id`),
  KEY `idx_cj_forms_audit_parent_id` (`parent_id`),
  KEY `idx_cj_forms_audit_event_id` (`event_id`),
  KEY `idx_cj_forms_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_cj_forms_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `cj_web_hooks`
--

CREATE TABLE `cj_web_hooks` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `url` varchar(255) DEFAULT NULL,
  `error_message_path` varchar(255) DEFAULT 'message',
  `sort_order` int(8) DEFAULT '1',
  `request_method` varchar(255) DEFAULT 'GET',
  `request_format` varchar(255) DEFAULT 'json',
  `response_format` varchar(255) DEFAULT 'json',
  `trigger_event` varchar(255) DEFAULT '',
  `headers` text,
  `ignore_errors` tinyint(1) DEFAULT '0',
  `active` tinyint(1) DEFAULT '1',
  `parent_id` char(36) NOT NULL,
  `parent_type` varchar(255) DEFAULT NULL,
  `request_body` varchar(255) DEFAULT 'journey_body',
  `custom_post_body` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_cj_web_hooks_skey` (`sync_key`),
  KEY `idx_cj_web_hooks_date_modfied` (`date_modified`),
  KEY `idx_cj_web_hooks_id_del` (`id`,`deleted`),
  KEY `idx_cj_web_hooks_date_entered` (`date_entered`),
  KEY `idx_cj_web_hooks_name_del` (`name`,`deleted`),
  KEY `idx_cj_web_hooks_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_cj_web_hooks_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `cj_webhooks_parent_id` (`parent_id`),
  KEY `idx_cj_web_hooks_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_cj_web_hooks_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `cj_web_hooks_audit`
--

CREATE TABLE `cj_web_hooks_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `event_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  PRIMARY KEY (`id`),
  KEY `idx_cj_web_hooks_audit_parent_id` (`parent_id`),
  KEY `idx_cj_web_hooks_audit_event_id` (`event_id`),
  KEY `idx_cj_web_hooks_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_cj_web_hooks_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `cloud_drive_paths`
--

CREATE TABLE `cloud_drive_paths` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `record_id` varchar(255) DEFAULT NULL,
  `path_module` varchar(255) DEFAULT NULL,
  `path` text,
  `type` varchar(255) DEFAULT NULL,
  `is_root` tinyint(1) DEFAULT '0',
  `is_shared` tinyint(1) DEFAULT '0',
  `folder_id` varchar(255) DEFAULT NULL,
  `drive_id` varchar(255) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `site_id` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_cloud_drive_paths_skey` (`sync_key`),
  KEY `idx_cloud_drive_paths_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_cloud_drive_paths_id_del` (`id`,`deleted`),
  KEY `idx_cloud_drive_paths_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_cloud_drive_paths_name_del` (`name`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `commentlog`
--

CREATE TABLE `commentlog` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `entry` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_commentlog_skey` (`sync_key`),
  KEY `idx_commentlog_date_modfied` (`date_modified`),
  KEY `idx_commentlog_id_del` (`id`,`deleted`),
  KEY `idx_commentlog_date_entered` (`date_entered`),
  KEY `idx_commentlog_name_del` (`name`,`deleted`),
  KEY `idx_commentlog_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_commentlog_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `commentlog_rel`
--

CREATE TABLE `commentlog_rel` (
  `id` char(36) NOT NULL,
  `record_id` char(36) NOT NULL,
  `commentlog_id` char(36) NOT NULL,
  `module` varchar(100) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `commentlog_record_relpk` (`record_id`),
  KEY `commentlog_commentlog_relpk` (`commentlog_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `comments`
--

CREATE TABLE `comments` (
  `id` char(36) NOT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `parent_id` char(36) NOT NULL,
  `data` longtext,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_comments_skey` (`sync_key`),
  KEY `commentsmod` (`date_modified`),
  KEY `comment_activities` (`parent_id`),
  KEY `idx_comments_id_del` (`id`,`deleted`),
  KEY `idx_comments_date_entered` (`date_entered`),
  KEY `idx_comments_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_comments_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `config`
--

CREATE TABLE `config` (
  `category` varchar(32) DEFAULT NULL,
  `name` varchar(32) DEFAULT NULL,
  `value` text,
  `platform` varchar(32) DEFAULT NULL,
  KEY `idx_config_cat` (`category`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `console_configuration`
--

CREATE TABLE `console_configuration` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `enabled_modules` varchar(255) DEFAULT NULL,
  `order_by_primary` varchar(255) DEFAULT NULL,
  `order_by_secondary` varchar(255) DEFAULT NULL,
  `filter_def` text,
  `sync_key` varchar(100) DEFAULT NULL,
  `freeze_first_column` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_console_configuration_skey` (`sync_key`),
  KEY `idx_console_configuration_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_console_configuration_id_del` (`id`,`deleted`),
  KEY `idx_console_configuration_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_console_configuration_name_del` (`name`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contacts`
--

CREATE TABLE `contacts` (
  `id` char(36) NOT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `salutation` varchar(255) DEFAULT NULL,
  `first_name` varchar(255) DEFAULT NULL,
  `last_name` varchar(255) DEFAULT NULL,
  `title` varchar(100) DEFAULT NULL,
  `facebook` varchar(100) DEFAULT NULL,
  `twitter` varchar(100) DEFAULT NULL,
  `googleplus` varchar(100) DEFAULT NULL,
  `department` varchar(255) DEFAULT NULL,
  `do_not_call` tinyint(1) DEFAULT '0',
  `phone_home` varchar(100) DEFAULT NULL,
  `phone_mobile` varchar(100) DEFAULT NULL,
  `phone_work` varchar(100) DEFAULT NULL,
  `phone_other` varchar(100) DEFAULT NULL,
  `phone_fax` varchar(100) DEFAULT NULL,
  `primary_address_street` varchar(150) DEFAULT NULL,
  `primary_address_city` varchar(100) DEFAULT NULL,
  `primary_address_state` varchar(100) DEFAULT NULL,
  `primary_address_postalcode` varchar(20) DEFAULT NULL,
  `primary_address_country` varchar(255) DEFAULT NULL,
  `alt_address_street` varchar(150) DEFAULT NULL,
  `alt_address_city` varchar(100) DEFAULT NULL,
  `alt_address_state` varchar(100) DEFAULT NULL,
  `alt_address_postalcode` varchar(20) DEFAULT NULL,
  `alt_address_country` varchar(255) DEFAULT NULL,
  `assistant` varchar(75) DEFAULT NULL,
  `assistant_phone` varchar(100) DEFAULT NULL,
  `picture` varchar(255) DEFAULT NULL,
  `lead_source` varchar(255) DEFAULT NULL,
  `dnb_principal_id` varchar(30) DEFAULT NULL,
  `reports_to_id` char(36) DEFAULT NULL,
  `birthdate` date DEFAULT NULL,
  `campaign_id` char(36) DEFAULT NULL,
  `mkto_sync` tinyint(1) DEFAULT '0',
  `mkto_id` int(11) DEFAULT NULL,
  `mkto_lead_score` int(11) DEFAULT NULL,
  `portal_name` varchar(255) DEFAULT NULL,
  `portal_active` tinyint(1) DEFAULT '0',
  `portal_password` varchar(255) DEFAULT NULL,
  `portal_app` varchar(255) DEFAULT NULL,
  `preferred_language` varchar(255) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `mailchimp_rating_c` int(3) DEFAULT '0',
  `dp_business_purpose` text,
  `dp_consent_last_updated` date DEFAULT NULL,
  `dri_workflow_template_id` char(36) DEFAULT NULL,
  `portal_user_company_name` varchar(255) DEFAULT NULL,
  `cookie_consent` tinyint(1) DEFAULT '0',
  `cookie_consent_received_on` datetime DEFAULT NULL,
  `business_center_id` char(36) DEFAULT NULL,
  `entry_source` varchar(255) DEFAULT 'internal',
  `site_user_id` varchar(64) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `hint_account_size` varchar(20) DEFAULT NULL,
  `hint_account_industry` varchar(120) DEFAULT NULL,
  `hint_account_location` varchar(255) DEFAULT NULL,
  `hint_account_description` varchar(255) DEFAULT NULL,
  `hint_job_2` varchar(255) DEFAULT NULL,
  `hint_education` varchar(225) DEFAULT NULL,
  `hint_education_2` varchar(225) DEFAULT NULL,
  `hint_facebook` varchar(120) DEFAULT NULL,
  `hint_twitter` varchar(120) DEFAULT NULL,
  `hint_industry_tags` varchar(225) DEFAULT NULL,
  `hint_account_founded_year` varchar(5) DEFAULT NULL,
  `hint_account_facebook_handle` varchar(120) DEFAULT NULL,
  `hint_account_twitter_handle` varchar(120) DEFAULT NULL,
  `hint_account_logo` varchar(255) DEFAULT NULL,
  `hint_contact_pic` text,
  `hint_photo` varchar(255) DEFAULT NULL,
  `hint_phone_1` varchar(15) DEFAULT NULL,
  `hint_phone_2` varchar(15) DEFAULT NULL,
  `hint_account_website` varchar(255) DEFAULT NULL,
  `hint_account_naics_code_lbl` varchar(170) DEFAULT NULL,
  `hint_account_sic_code_label` varchar(120) DEFAULT NULL,
  `hint_account_fiscal_year_end` varchar(5) DEFAULT NULL,
  `hint_account_annual_revenue` varchar(25) DEFAULT NULL,
  `market_interest_prediction_score` varchar(255) DEFAULT '',
  `market_score` int(11) DEFAULT NULL,
  `denorm_account_name` varchar(255) DEFAULT NULL,
  `geocode_status` varchar(255) DEFAULT NULL,
  `source_id` varchar(255) DEFAULT NULL,
  `source_type` varchar(255) DEFAULT NULL,
  `source_meta` text,
  `external_user_id` char(36) DEFAULT NULL,
  `perform_sugar_action` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_contacts_skey` (`sync_key`),
  KEY `contactsmod` (`date_modified`),
  KEY `idx_cont_last_first` (`last_name`,`first_name`,`deleted`),
  KEY `idx_contacts_del_last` (`deleted`,`last_name`),
  KEY `idx_cont_del_reports` (`deleted`,`reports_to_id`,`last_name`),
  KEY `idx_del_id_user` (`deleted`,`id`,`assigned_user_id`),
  KEY `idx_contact_title` (`title`),
  KEY `idx_contact_date_entered` (`date_entered`),
  KEY `idx_contact_mkto_id` (`mkto_id`),
  KEY `idx_contacts_id_del` (`id`,`deleted`),
  KEY `idx_contacts_first_last` (`first_name`,`last_name`,`deleted`),
  KEY `idx_contacts_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `contact_id` (`id`) USING BTREE,
  KEY `idx_contacts_cjtpl_id` (`dri_workflow_template_id`),
  KEY `idx_del_dateentered` (`deleted`,`date_entered`),
  KEY `idx_department` (`department`),
  KEY `idx_first_name` (`first_name`),
  KEY `idx_last_name` (`last_name`),
  KEY `idx_contacts_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_contacts_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_contacts_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_contacts_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_cont_del_last_dm` (`deleted`,`last_name`,`date_modified`),
  KEY `idx_reports_to_id` (`deleted`,`reports_to_id`,`id`),
  KEY `idx_cont_portal_active` (`portal_name`,`portal_active`,`deleted`),
  KEY `idx_contacts_del_businesscenter` (`deleted`,`business_center_id`),
  KEY `idx_contacts_denorm_account_name` (`denorm_account_name`,`id`,`deleted`),
  KEY `idx_contacts_external_user_id` (`external_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contacts_audit`
--

CREATE TABLE `contacts_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  `event_id` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_contacts_parent_id` (`parent_id`),
  KEY `idx_contacts_audit_event_id` (`event_id`),
  KEY `idx_contacts_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_contacts_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contacts_bugs`
--

CREATE TABLE `contacts_bugs` (
  `id` char(36) NOT NULL,
  `contact_id` char(36) DEFAULT NULL,
  `bug_id` char(36) DEFAULT NULL,
  `contact_role` varchar(50) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_con_bug_bug` (`bug_id`),
  KEY `idx_contact_bug` (`contact_id`,`bug_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contacts_cases`
--

CREATE TABLE `contacts_cases` (
  `id` char(36) NOT NULL,
  `contact_id` char(36) DEFAULT NULL,
  `case_id` char(36) DEFAULT NULL,
  `contact_role` varchar(50) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_con_case_case` (`case_id`),
  KEY `idx_contacts_cases` (`contact_id`,`case_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contacts_cstm`
--

CREATE TABLE `contacts_cstm` (
  `id_c` char(36) NOT NULL,
  `assets_total_super_c` decimal(26,6) DEFAULT NULL,
  `currency_id` char(36) DEFAULT NULL,
  `assets_total_non_super_c` decimal(26,6) DEFAULT NULL,
  `age_float_c` float(20,1) DEFAULT NULL,
  `age_months_c` int(4) DEFAULT NULL,
  `simulation_iterations_c` int(3) DEFAULT NULL,
  `investment_strategy_c` varchar(100) DEFAULT NULL,
  `income_current_c` decimal(26,6) DEFAULT NULL,
  `income_current_growth_c` int(2) DEFAULT NULL,
  `income_addl_contributions_c` int(2) DEFAULT NULL,
  `simulation_link_c` varchar(250) DEFAULT NULL,
  `income_retirement_desired_c` decimal(26,6) DEFAULT NULL,
  `income_retirement_required_c` decimal(26,6) DEFAULT NULL,
  `income_desired_p_c` int(255) DEFAULT NULL,
  `income_required_p_c` int(255) DEFAULT NULL,
  `age_retirement_c` int(2) DEFAULT NULL,
  `age_death_c` int(3) DEFAULT NULL,
  `income_expected_retirement_c` int(255) DEFAULT NULL,
  `gender_c` varchar(100) DEFAULT NULL,
  `segmentation_lifestage_c` varchar(100) DEFAULT NULL,
  `segmentation_engagement_c` varchar(100) DEFAULT '',
  `segmentation_situation_c` varchar(100) DEFAULT NULL,
  `income_frequency_c` varchar(100) DEFAULT 'weekly',
  `investment_risk_c` float(3,1) DEFAULT NULL,
  `investor_c` tinyint(1) DEFAULT '0',
  `simulation_engine_c` varchar(100) DEFAULT 'v01',
  `income_expected_retire_high_c` int(255) DEFAULT NULL,
  `base_rate` decimal(26,8) DEFAULT NULL,
  `linkedin_c` varchar(255) DEFAULT NULL,
  `home_ownership_c` varchar(100) DEFAULT 'rent',
  `income_addl_contrib_c` decimal(26,6) DEFAULT NULL,
  `maritalstatus_c` varchar(100) DEFAULT '',
  `income_type_c` varchar(100) DEFAULT NULL,
  `lsw_type_c` varchar(100) DEFAULT NULL,
  `per_salary_yearly_total_c` decimal(26,6) DEFAULT NULL,
  `repeat_no_of_years_c` int(255) DEFAULT NULL,
  `adnl_super_contributioions_c` decimal(26,6) DEFAULT NULL,
  `income_start_date_c` date DEFAULT NULL,
  `assets_total_super_other_c` decimal(26,6) DEFAULT NULL,
  `est_date_load_paid_off_c` date DEFAULT NULL,
  `income_end_date_c` date DEFAULT NULL,
  `investment_current_value_c` decimal(26,6) DEFAULT NULL,
  `debt_current_value_c` decimal(26,6) DEFAULT NULL,
  `lsw_amount_c` decimal(26,6) DEFAULT NULL,
  `lsw_first_year_c` int(4) DEFAULT NULL,
  `income_amount_per_year_c` decimal(26,6) DEFAULT NULL,
  `debt_type_c` varchar(100) DEFAULT NULL,
  `investment_type_c` varchar(100) DEFAULT NULL,
  `soa_flag_c` tinyint(1) DEFAULT '0',
  `assets_total_primary_super_c` decimal(26,6) DEFAULT NULL,
  `simulation_link_text_c` varchar(255) DEFAULT NULL,
  `total_profile_completion_c` decimal(6,2) DEFAULT NULL,
  `profile_prompts_count_c` longtext,
  `assets_total_addl_income_c` decimal(26,6) DEFAULT NULL,
  `assets_total_inv_assets_c` decimal(26,6) DEFAULT NULL,
  `liab_total_home_other_loans_c` decimal(26,6) DEFAULT NULL,
  `liab_total_inv_loans_c` decimal(26,6) DEFAULT NULL,
  `member_id_c` varchar(255) DEFAULT '',
  `member_hash_c` varchar(255) DEFAULT NULL,
  `steps_c` longtext,
  `optimisation_flag_c` tinyint(1) DEFAULT '0',
  `show_splash_next_c` tinyint(1) DEFAULT '1',
  `ttr_flag_c` tinyint(1) DEFAULT '0',
  `employment_status_c` varchar(100) DEFAULT 'Employed',
  `last_login_c` datetime DEFAULT NULL,
  `member_password_c` varchar(255) DEFAULT '',
  `steps_c_defauls_c` longtext,
  `steps_c_default_c` longtext,
  `ars_data_c` tinyint(1) DEFAULT NULL,
  `ars_outcome_c` tinyint(1) DEFAULT NULL,
  `ars_finances_c` tinyint(1) DEFAULT NULL,
  `ars_overall_c` tinyint(1) DEFAULT NULL,
  `ars_engagement_c` tinyint(1) DEFAULT NULL,
  `ars_data_value_c` int(255) DEFAULT NULL,
  `ars_outcome_value_c` int(255) DEFAULT NULL,
  `ars_finances_value_c` int(255) DEFAULT NULL,
  `ars_engagement_value_c` int(255) DEFAULT NULL,
  `ars_overall_value_c` int(255) DEFAULT NULL,
  `count_articles_c` int(255) DEFAULT NULL,
  `count_badges_c` int(255) DEFAULT NULL,
  `dashboard_tile_1_c` varchar(255) DEFAULT '',
  `dashboard_tile_2_c` varchar(255) DEFAULT NULL,
  `dashboard_tile_3_c` varchar(255) DEFAULT NULL,
  `ri_strong_c` decimal(26,6) DEFAULT '0.000000',
  `ri_weak_c` decimal(26,6) DEFAULT '0.000000',
  `ri_verystrong_c` decimal(26,6) DEFAULT '0.000000',
  `ri_veryweak_c` decimal(26,6) DEFAULT '0.000000',
  `advice_status_c` varchar(100) DEFAULT NULL,
  `ri_date_created_c` datetime DEFAULT NULL,
  `display_next_action_1_c` tinyint(1) DEFAULT NULL,
  `display_next_action_2_c` tinyint(1) DEFAULT '0',
  `display_rif_sidebar_msg_c` tinyint(1) DEFAULT NULL,
  `optrif_advice_status_c` varchar(100) DEFAULT NULL,
  `optrif_date_created_c` datetime DEFAULT NULL,
  `optrif_weak_c` decimal(26,6) DEFAULT '0.000000',
  `optrif_strong_c` decimal(26,6) DEFAULT '0.000000',
  `optrif_veryweak_c` decimal(26,6) DEFAULT '0.000000',
  `uic_retirement_age_c` tinyint(1) DEFAULT '0',
  `uic_contribution_c` tinyint(1) DEFAULT '0',
  `uic_runout_age_c` tinyint(1) DEFAULT '0',
  `uic_required_income_c` tinyint(1) DEFAULT '0',
  `uic_desired_income_c` tinyint(1) DEFAULT '0',
  `uic_personal_investment_str_c` tinyint(1) DEFAULT '0',
  `optrif_verystrong_c` decimal(26,6) DEFAULT '0.000000',
  `ars_data_income_c` int(255) DEFAULT NULL,
  `ars_data_other_super_c` int(255) DEFAULT NULL,
  `ars_data_contribution_c` int(255) DEFAULT NULL,
  `ars_data_retirement_age_high_c` int(255) DEFAULT NULL,
  `ars_data_retirement_age_low_c` int(255) DEFAULT NULL,
  `ars_data_total_c` int(255) DEFAULT NULL,
  `feature_switches_c` longtext,
  `atps_proxy_c` decimal(26,6) DEFAULT '0.000000',
  `pension_flag_c` tinyint(1) DEFAULT '1',
  `uic_system_c` int(255) DEFAULT NULL,
  `defaultprofile_prompts_count_c` longtext,
  `is_guest_c` tinyint(1) DEFAULT '0',
  `preferred_article_type_c` varchar(100) DEFAULT '',
  `resetpw_token_c` varchar(255) DEFAULT '',
  `resetpw_trigger_c` tinyint(1) DEFAULT '0',
  `tpd_weekly_premium_c` decimal(26,6) DEFAULT '0.000000',
  `death_cover_c` decimal(26,6) DEFAULT '0.000000',
  `ars_competencies_value_c` int(255) DEFAULT '0',
  `tpd_cover_c` decimal(26,6) DEFAULT '0.000000',
  `ip_cover_c` decimal(26,6) DEFAULT '0.000000',
  `ip_weekly_premium_c` decimal(26,6) DEFAULT '0.000000',
  `start_date_with_fund_c` date DEFAULT NULL,
  `external_member_id_c` varchar(255) DEFAULT '',
  `death_weekly_premium_c` decimal(26,6) DEFAULT '0.000000',
  `retirement_vs_current_age_c` decimal(18,8) DEFAULT NULL,
  `userincomefrequency_c` varchar(100) DEFAULT '',
  `userincometype_c` varchar(100) DEFAULT '',
  `usersalsacavailable_c` tinyint(1) DEFAULT '0',
  `asset_annuitisation_c` decimal(8,4) DEFAULT '0.0000',
  `annuity_income_c` decimal(26,6) DEFAULT '0.000000',
  `referrer_c` varchar(100) DEFAULT '',
  `process_1_completed_c` tinyint(1) DEFAULT '0',
  `process_2_completed_c` tinyint(1) DEFAULT '0',
  `process_3_completed_c` tinyint(1) DEFAULT '0',
  `understanding_c` decimal(18,2) DEFAULT NULL,
  `motivation_c` decimal(18,2) DEFAULT NULL,
  `involvement_c` decimal(18,2) DEFAULT NULL,
  `confidence_c` decimal(18,2) DEFAULT NULL,
  `life_journey_c` varchar(255) DEFAULT '',
  `pilot_status_c` varchar(100) DEFAULT 'Not_Included',
  `conts_instructions_c` mediumtext,
  `total_interactions_count_c` int(255) DEFAULT NULL,
  `count_competencies_c` int(5) DEFAULT NULL,
  `count_profile_completion_c` int(255) DEFAULT NULL,
  `feature_switches_account_c` longtext,
  `feature_switches_segment_c` longtext,
  `ap_application_type_c` varchar(100) DEFAULT '',
  `ap_assessable_income_c` decimal(26,6) DEFAULT NULL,
  `ap_assessable_assets_c` decimal(26,6) DEFAULT NULL,
  `ap_test_income_amount_c` decimal(26,6) DEFAULT NULL,
  `ap_test_assets_amount_c` decimal(26,6) DEFAULT NULL,
  `ap_amount_c` decimal(26,6) DEFAULT NULL,
  `chargebee_customer_id_c` varchar(255) DEFAULT '',
  `ap_amount_type_c` varchar(100) DEFAULT '',
  `re_one_off_expenses_amount_c` decimal(26,6) DEFAULT '0.000000',
  `re_one_off_expenses_list_c` text,
  `health_check_c` varchar(100) DEFAULT '',
  `main_retirement_concerns_c` text,
  `expenses_current_c` decimal(26,6) DEFAULT '0.000000',
  `ap_age_eligibility_c` varchar(100) DEFAULT '',
  `ap_residency_eligibility_c` varchar(100) DEFAULT '',
  `ap_completed_sections_count_c` int(255) DEFAULT NULL,
  `ap_test_assets_amount_type_c` varchar(100) DEFAULT '',
  `ap_test_income_amount_type_c` varchar(100) DEFAULT '',
  `email_verified_c` tinyint(1) DEFAULT '0',
  `process_trigger_c` text,
  `process_attributes_c` text,
  `last_logout_c` datetime DEFAULT NULL,
  `trigger_email_verification_c` tinyint(1) DEFAULT '0',
  `check_ap_application_type_c` varchar(100) DEFAULT '',
  `ap_combined_amount_type_c` varchar(100) DEFAULT '',
  `splash_page_c` varchar(255) DEFAULT NULL,
  `ap_centrelink_receipt_number_c` varchar(10) DEFAULT '',
  `ap_centrelink_receipt_date_c` date DEFAULT NULL,
  `ap_australia_post_tracking_c` varchar(255) DEFAULT NULL,
  `ab_test_id_c` varchar(255) DEFAULT NULL,
  `ap_australia_post_sent_date_c` date DEFAULT NULL,
  `ap_test_assets_amt_type_t1_c` varchar(100) DEFAULT '',
  `ap_amount_type_t2_c` varchar(100) DEFAULT '',
  `ap_eligibility_date_text_c` varchar(255) DEFAULT NULL,
  `ap_eligibility_date_c` date DEFAULT NULL,
  `ap_amount_t2_c` decimal(26,6) DEFAULT '0.000000',
  `ap_date_text_t1_c` varchar(255) DEFAULT NULL,
  `ap_assessable_assets_t1_c` decimal(26,6) DEFAULT '0.000000',
  `ap_test_assets_amt_type_t2_c` varchar(100) DEFAULT '',
  `ap_eligibility_date_text_t2_c` varchar(255) DEFAULT NULL,
  `ap_date_text_t2_c` varchar(255) DEFAULT NULL,
  `ap_eligibility_date_text_t1_c` varchar(255) DEFAULT NULL,
  `tfn_c` varchar(255) DEFAULT '',
  `ap_test_income_amt_type_t1_c` varchar(100) DEFAULT '',
  `ap_test_assets_amount_t2_c` decimal(26,6) DEFAULT '0.000000',
  `ap_test_income_amount_t1_c` decimal(26,6) DEFAULT '0.000000',
  `ap_deemed_income_c` decimal(26,6) DEFAULT '0.000000',
  `ap_eligibility_date_t1_c` date DEFAULT NULL,
  `ap_date_c` date DEFAULT NULL,
  `ap_assessable_income_t2_c` decimal(26,6) DEFAULT '0.000000',
  `ap_combined_amount_type_t1_c` varchar(100) DEFAULT '',
  `ap_test_income_amount_t2_c` decimal(26,6) DEFAULT '0.000000',
  `ap_test_assets_amount_t1_c` decimal(26,6) DEFAULT '0.000000',
  `ap_deemed_income_t2_c` decimal(26,6) DEFAULT '0.000000',
  `ap_deemed_income_t1_c` decimal(26,6) DEFAULT '0.000000',
  `ap_combined_amount_type_t2_c` varchar(100) DEFAULT '',
  `ap_amount_type_t1_c` varchar(100) DEFAULT '',
  `ap_date_text_c` varchar(255) DEFAULT NULL,
  `ap_test_income_amt_type_t2_c` varchar(100) DEFAULT '',
  `ap_date_t2_c` date DEFAULT NULL,
  `ap_date_t1_c` date DEFAULT NULL,
  `ap_amount_t1_c` decimal(26,6) DEFAULT '0.000000',
  `ap_eligibility_date_t2_c` date DEFAULT NULL,
  `ap_assessable_income_t1_c` decimal(26,6) DEFAULT '0.000000',
  `ap_assessable_assets_t2_c` decimal(26,6) DEFAULT '0.000000',
  `trigger_account_activation_c` tinyint(1) DEFAULT '0',
  `apc_age_eligibility_c` varchar(100) DEFAULT '',
  `apc_amount_c` decimal(26,6) DEFAULT '0.000000',
  `apc_amount_type_c` varchar(100) DEFAULT '',
  `apc_apec_mongo_id_c` varchar(255) DEFAULT NULL,
  `apc_assessable_assets_c` decimal(26,6) DEFAULT '0.000000',
  `apc_assessable_income_c` decimal(26,6) DEFAULT '0.000000',
  `apc_combined_amount_c` decimal(26,6) DEFAULT '0.000000',
  `apc_combined_amount_type_c` varchar(100) DEFAULT '',
  `apc_mongo_id_c` varchar(255) DEFAULT '',
  `apc_residency_eligibility_c` varchar(100) DEFAULT '',
  `apc_test_assets_amount_c` decimal(26,6) DEFAULT '0.000000',
  `apc_test_assets_amount_type_c` varchar(100) DEFAULT '',
  `apc_test_income_amount_c` decimal(26,6) DEFAULT '0.000000',
  `apc_test_income_amount_type_c` varchar(100) DEFAULT '',
  `ap_apec_mongo_id_c` varchar(255) DEFAULT '',
  `ap_apec_mongo_id_t1_c` varchar(255) DEFAULT NULL,
  `ap_apec_mongo_id_t2_c` varchar(255) DEFAULT NULL,
  `ap_combined_amount_c` decimal(26,6) DEFAULT '0.000000',
  `ap_combined_amount_t1_c` decimal(26,6) DEFAULT '0.000000',
  `ap_combined_amount_t2_c` decimal(26,6) DEFAULT '0.000000',
  `ap_person2_app_date_text_c` varchar(255) DEFAULT NULL,
  `ap_person1_app_date_c` date DEFAULT NULL,
  `ap_application_date_t2_c` date DEFAULT NULL,
  `ap_application_date_c` date DEFAULT NULL,
  `ap_application_date_text_c` varchar(255) DEFAULT NULL,
  `ap_application_date_text_t2_c` varchar(255) DEFAULT NULL,
  `ap_person2_app_date_c` date DEFAULT NULL,
  `apc_application_eligibility_c` varchar(100) DEFAULT '',
  `ap_person1_app_date_text_c` varchar(255) DEFAULT NULL,
  `ap_application_date_t1_c` date DEFAULT NULL,
  `ap_application_date_text_t1_c` varchar(255) DEFAULT NULL,
  `advice_ready_to_proceed_c` tinyint(1) DEFAULT '0',
  `fund_data_date_c` date DEFAULT NULL,
  `generate_handover_report_c` tinyint(1) DEFAULT '0',
  `middle_name_c` varchar(255) DEFAULT '',
  `email1_c` varchar(255) DEFAULT '',
  `deceased_c` tinyint(1) DEFAULT '0',
  `deceased_date_c` date DEFAULT NULL,
  PRIMARY KEY (`id_c`),
  KEY `contact_id` (`id_c`) USING BTREE,
  KEY `idx_external_memberid` (`external_member_id_c`),
  KEY `idx_last_login` (`last_login_c`),
  KEY `idx_resettoken` (`resetpw_token_c`),
  KEY `idx_memberid` (`member_id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contacts_dataprivacy`
--

CREATE TABLE `contacts_dataprivacy` (
  `id` char(36) NOT NULL,
  `contact_id` char(36) DEFAULT NULL,
  `dataprivacy_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_con_dataprivacy_dataprivacy` (`dataprivacy_id`),
  KEY `idx_contacts_dataprivacy` (`contact_id`,`dataprivacy_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contacts_escalations`
--

CREATE TABLE `contacts_escalations` (
  `id` char(36) NOT NULL,
  `contact_id` char(36) DEFAULT NULL,
  `escalation_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_con_escalation_escalation` (`escalation_id`),
  KEY `idx_contacts_escalations` (`contact_id`,`escalation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contacts_purchases`
--

CREATE TABLE `contacts_purchases` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `contact_id` char(36) DEFAULT NULL,
  `purchase_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `contacts_purchases_purchase_id` (`purchase_id`,`contact_id`),
  KEY `contacts_purchases_contact_id` (`contact_id`,`purchase_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contacts_se_extendedcontactvalues_1_c`
--

CREATE TABLE `contacts_se_extendedcontactvalues_1_c` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `contacts_se_extendedcontactvalues_1contacts_ida` char(36) DEFAULT NULL,
  `contacts_se_extendedcontactvalues_1se_extendedcontactvalues_idb` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_contacts_se_extendedcontactvalues_1_ida1_deleted` (`contacts_se_extendedcontactvalues_1contacts_ida`,`deleted`),
  KEY `idx_contacts_se_extendedcontactvalues_1_idb2_deleted` (`contacts_se_extendedcontactvalues_1se_extendedcontactvalues_idb`,`deleted`),
  KEY `contacts_se_extendedcontactvalues_1_alt` (`contacts_se_extendedcontactvalues_1se_extendedcontactvalues_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contacts_se_instructions_1_c`
--

CREATE TABLE `contacts_se_instructions_1_c` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `contacts_se_instructions_1contacts_ida` char(36) DEFAULT NULL,
  `contacts_se_instructions_1se_instructions_idb` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_contacts_se_instructions_1_ida1_deleted` (`contacts_se_instructions_1contacts_ida`,`deleted`),
  KEY `idx_contacts_se_instructions_1_idb2_deleted` (`contacts_se_instructions_1se_instructions_idb`,`deleted`),
  KEY `contacts_se_instructions_1_alt` (`contacts_se_instructions_1se_instructions_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contacts_se_memberadvicetopics_1_c`
--

CREATE TABLE `contacts_se_memberadvicetopics_1_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `contacts_se_memberadvicetopics_1contacts_ida` varchar(36) DEFAULT NULL,
  `contacts_se_memberadvicetopics_1se_memberadvicetopics_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `contacts_se_memberadvicetopics_1_ida1` (`contacts_se_memberadvicetopics_1contacts_ida`),
  KEY `contacts_se_memberadvicetopics_1_alt` (`contacts_se_memberadvicetopics_1se_memberadvicetopics_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contacts_se_relationships_1_c`
--

CREATE TABLE `contacts_se_relationships_1_c` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `contacts_se_relationships_1contacts_ida` char(36) DEFAULT NULL,
  `contacts_se_relationships_1se_relationships_idb` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_contacts_se_relationships_1_ida1_deleted` (`contacts_se_relationships_1contacts_ida`,`deleted`),
  KEY `idx_contacts_se_relationships_1_idb2_deleted` (`contacts_se_relationships_1se_relationships_idb`,`deleted`),
  KEY `contacts_se_relationships_1_alt` (`contacts_se_relationships_1se_relationships_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contacts_se_relationships_2_c`
--

CREATE TABLE `contacts_se_relationships_2_c` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `contacts_se_relationships_2contacts_ida` char(36) DEFAULT NULL,
  `contacts_se_relationships_2se_relationships_idb` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_contacts_se_relationships_2_ida1_deleted` (`contacts_se_relationships_2contacts_ida`,`deleted`),
  KEY `idx_contacts_se_relationships_2_idb2_deleted` (`contacts_se_relationships_2se_relationships_idb`,`deleted`),
  KEY `contacts_se_relationships_2_alt` (`contacts_se_relationships_2se_relationships_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contacts_users`
--

CREATE TABLE `contacts_users` (
  `id` char(36) NOT NULL,
  `contact_id` char(36) DEFAULT NULL,
  `user_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_con_users_user` (`user_id`),
  KEY `idx_contacts_users` (`contact_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contract_types`
--

CREATE TABLE `contract_types` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `list_order` int(4) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `description` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_contract_types_skey` (`sync_key`),
  KEY `idx_contracttype_name` (`name`),
  KEY `idx_contract_types_date_modfied` (`date_modified`),
  KEY `idx_contract_types_id_del` (`id`,`deleted`),
  KEY `idx_contract_types_date_entered` (`date_entered`),
  KEY `idx_contract_types_name_del` (`name`,`deleted`),
  KEY `idx_contract_types_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_contract_types_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contracts`
--

CREATE TABLE `contracts` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `reference_code` varchar(255) DEFAULT NULL,
  `account_id` char(36) DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `currency_id` char(36) DEFAULT '-99',
  `base_rate` decimal(26,6) DEFAULT NULL,
  `total_contract_value` decimal(26,6) DEFAULT NULL,
  `total_contract_value_usdollar` decimal(26,6) DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL,
  `customer_signed_date` date DEFAULT NULL,
  `company_signed_date` date DEFAULT NULL,
  `expiration_notice` datetime DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_contracts_skey` (`sync_key`),
  KEY `contractsmod` (`date_modified`),
  KEY `idx_contract_status` (`status`),
  KEY `idx_contract_start_date` (`start_date`),
  KEY `idx_contract_end_date` (`end_date`),
  KEY `idx_contracts_id_del` (`id`,`deleted`),
  KEY `idx_contracts_date_entered` (`date_entered`),
  KEY `idx_contracts_name_del` (`name`,`deleted`),
  KEY `idx_contracts_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_contracts_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_contracts_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_contracts_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_contracts_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contracts_audit`
--

CREATE TABLE `contracts_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  `event_id` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_contracts_parent_id` (`parent_id`),
  KEY `idx_contracts_audit_event_id` (`event_id`),
  KEY `idx_contracts_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_contracts_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contracts_contacts`
--

CREATE TABLE `contracts_contacts` (
  `id` char(36) NOT NULL,
  `contact_id` char(36) DEFAULT NULL,
  `contract_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `contracts_contacts_alt` (`contact_id`,`contract_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contracts_opportunities`
--

CREATE TABLE `contracts_opportunities` (
  `id` char(36) NOT NULL,
  `opportunity_id` char(36) DEFAULT NULL,
  `contract_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `contracts_opp_alt` (`contract_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contracts_products`
--

CREATE TABLE `contracts_products` (
  `id` char(36) NOT NULL,
  `product_id` char(36) DEFAULT NULL,
  `contract_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `contracts_prod_alt` (`contract_id`,`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `contracts_quotes`
--

CREATE TABLE `contracts_quotes` (
  `id` char(36) NOT NULL,
  `quote_id` char(36) DEFAULT NULL,
  `contract_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `contracts_quot_alt` (`contract_id`,`quote_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `currencies`
--

CREATE TABLE `currencies` (
  `id` char(36) NOT NULL,
  `name` varchar(36) DEFAULT NULL,
  `symbol` varchar(36) DEFAULT NULL,
  `iso4217` varchar(3) DEFAULT NULL,
  `conversion_rate` decimal(26,6) DEFAULT '0.000000',
  `status` varchar(100) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `created_by` char(36) NOT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_currencies_skey` (`sync_key`),
  KEY `idx_currency_name` (`name`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

CREATE TABLE `custom_fields` (
  `bean_id` char(36) DEFAULT NULL,
  `set_num` int(11) DEFAULT '0',
  `field0` varchar(255) DEFAULT NULL,
  `field1` varchar(255) DEFAULT NULL,
  `field2` varchar(255) DEFAULT NULL,
  `field3` varchar(255) DEFAULT NULL,
  `field4` varchar(255) DEFAULT NULL,
  `field5` varchar(255) DEFAULT NULL,
  `field6` varchar(255) DEFAULT NULL,
  `field7` varchar(255) DEFAULT NULL,
  `field8` varchar(255) DEFAULT NULL,
  `field9` varchar(255) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  KEY `idx_beanid_set_num` (`bean_id`,`set_num`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `custom_queries`
--

CREATE TABLE `custom_queries` (
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `id` char(36) NOT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `name` varchar(50) DEFAULT NULL,
  `description` text,
  `custom_query` text,
  `query_type` varchar(50) DEFAULT NULL,
  `list_order` int(4) DEFAULT NULL,
  `query_locked` varchar(3) DEFAULT '0',
  `acl_team_set_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_customqueries` (`name`,`deleted`),
  KEY `idx_custom_queries_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_custom_queries_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `dashboards`
--

CREATE TABLE `dashboards` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `assigned_user_id` char(36) DEFAULT NULL,
  `dashboard_module` varchar(100) DEFAULT NULL,
  `view_name` varchar(100) DEFAULT NULL,
  `metadata` longtext,
  `default_dashboard` tinyint(1) DEFAULT '0',
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `is_template` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_dashboards_skey` (`sync_key`),
  KEY `dashboardsmod` (`date_modified`),
  KEY `user_module_view` (`assigned_user_id`,`dashboard_module`,`view_name`),
  KEY `idx_dashboards_id_del` (`id`,`deleted`),
  KEY `idx_dashboards_date_entered` (`date_entered`),
  KEY `idx_dashboards_name_del` (`name`,`deleted`),
  KEY `idx_dashboards_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_dashboards_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_dashboards_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_dashboards_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_dashboards_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `data_archivers`
--

CREATE TABLE `data_archivers` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `filter_module_name` varchar(255) DEFAULT NULL,
  `filter_def` text,
  `process_type` varchar(255) DEFAULT NULL,
  `active` tinyint(1) DEFAULT '1',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_data_archivers_skey` (`sync_key`),
  KEY `idx_data_archivers_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_data_archivers_id_del` (`id`,`deleted`),
  KEY `idx_data_archivers_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_data_archivers_name_del` (`name`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `data_privacy`
--

CREATE TABLE `data_privacy` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `dataprivacy_number` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(255) DEFAULT NULL,
  `status` varchar(100) DEFAULT 'Open',
  `priority` varchar(100) DEFAULT NULL,
  `resolution` text,
  `work_log` text,
  `business_purpose` text,
  `source` varchar(255) DEFAULT NULL,
  `requested_by` varchar(255) DEFAULT NULL,
  `date_opened` date DEFAULT NULL,
  `date_due` date DEFAULT NULL,
  `date_closed` date DEFAULT NULL,
  `fields_to_erase` text,
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `follow_up_datetime` datetime DEFAULT NULL,
  `resolved_datetime` datetime DEFAULT NULL,
  `hours_to_resolution` decimal(12,2) DEFAULT NULL,
  `business_hours_to_resolution` decimal(12,2) DEFAULT NULL,
  `pending_processing` tinyint(1) DEFAULT '0',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `dataprivacynumk` (`dataprivacy_number`),
  UNIQUE KEY `idx_data_privacy_skey` (`sync_key`),
  KEY `idx_data_privacy_date_modfied` (`date_modified`),
  KEY `idx_data_privacy_id_del` (`id`,`deleted`),
  KEY `idx_data_privacy_date_entered` (`date_entered`),
  KEY `idx_data_privacy_name_del` (`name`,`deleted`),
  KEY `idx_data_privacy_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_data_privacy_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_data_privacy_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_data_privacy_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_data_privacy_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `data_privacy_audit`
--

CREATE TABLE `data_privacy_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `event_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  PRIMARY KEY (`id`),
  KEY `idx_data_privacy_audit_event_id` (`event_id`),
  KEY `idx_data_privacy_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_data_privacy_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `data_privacy_cstm`
--

CREATE TABLE `data_privacy_cstm` (
  `id_c` char(36) NOT NULL,
  `dp_type_request_c` varchar(100) DEFAULT 'Request for Data Privacy Policy',
  `type_clone_2_c` varchar(100) DEFAULT 'Delete PII Doc',
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `data_sets`
--

CREATE TABLE `data_sets` (
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `id` char(36) NOT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `report_id` char(36) DEFAULT NULL,
  `query_id` char(36) NOT NULL,
  `name` varchar(50) DEFAULT NULL,
  `list_order_y` int(3) DEFAULT '0',
  `exportable` varchar(3) DEFAULT '0',
  `header` varchar(3) DEFAULT '0',
  `description` text,
  `table_width` varchar(3) DEFAULT '0',
  `font_size` varchar(8) DEFAULT '0',
  `output_default` varchar(100) DEFAULT NULL,
  `prespace_y` varchar(3) DEFAULT '0',
  `use_prev_header` varchar(3) DEFAULT '0',
  `header_back_color` varchar(100) DEFAULT NULL,
  `body_back_color` varchar(100) DEFAULT NULL,
  `header_text_color` varchar(100) DEFAULT NULL,
  `body_text_color` varchar(100) DEFAULT NULL,
  `table_width_type` varchar(3) DEFAULT NULL,
  `custom_layout` varchar(10) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_dataset` (`name`,`deleted`),
  KEY `idx_data_sets_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_data_sets_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `dataprivacy_se_extendedcontactvalues_1_c`
--

CREATE TABLE `dataprivacy_se_extendedcontactvalues_1_c` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `dataprivacy_se_extendedcontactvalues_1dataprivacy_ida` char(36) DEFAULT NULL,
  `dataprivacf727tvalues_idb` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_dataprivacy_se_extendedcontactvalues_1_ida1_deleted` (`dataprivacy_se_extendedcontactvalues_1dataprivacy_ida`,`deleted`),
  KEY `idx_dataprivacy_se_extendedcontactvalues_1_idb2_deleted` (`dataprivacf727tvalues_idb`,`deleted`),
  KEY `dataprivacy_se_extendedcontactvalues_1_alt` (`dataprivacy_se_extendedcontactvalues_1dataprivacy_ida`,`dataprivacf727tvalues_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `dataset_attributes`
--

CREATE TABLE `dataset_attributes` (
  `id` char(36) NOT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `display_type` varchar(25) DEFAULT NULL,
  `display_name` varchar(50) DEFAULT NULL,
  `attribute_type` varchar(8) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `font_size` varchar(8) DEFAULT '0',
  `cell_size` varchar(3) DEFAULT NULL,
  `size_type` varchar(3) DEFAULT NULL,
  `bg_color` varchar(25) DEFAULT NULL,
  `font_color` varchar(25) DEFAULT NULL,
  `wrap` varchar(3) DEFAULT NULL,
  `style` varchar(25) DEFAULT NULL,
  `format_type` varchar(25) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_datasetatt` (`parent_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `dataset_layouts`
--

CREATE TABLE `dataset_layouts` (
  `id` char(36) NOT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `parent_value` varchar(50) DEFAULT NULL,
  `layout_type` varchar(25) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `list_order_x` int(4) DEFAULT NULL,
  `list_order_z` int(4) DEFAULT NULL,
  `row_header_id` char(36) DEFAULT NULL,
  `hide_column` varchar(3) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_datasetlayout` (`parent_value`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `denorm_tmp`
--

CREATE TABLE `denorm_tmp` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `target_id` char(36) DEFAULT NULL,
  `value` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `denorm_tmp_Quotes`
--

CREATE TABLE `denorm_tmp_Quotes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `target_id` char(36) DEFAULT NULL,
  `value` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `document_merges`
--

CREATE TABLE `document_merges` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `parent_type` varchar(255) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `template_id` char(36) DEFAULT NULL,
  `generated_document_id` char(36) DEFAULT NULL,
  `status` varchar(100) DEFAULT 'processing',
  `merge_type` varchar(100) DEFAULT 'merge',
  `file_type` varchar(100) DEFAULT 'DOC',
  `message` varchar(255) DEFAULT NULL,
  `seen` tinyint(1) DEFAULT '0',
  `dismissed` tinyint(1) DEFAULT '0',
  `record_ids` text,
  `sync_key` varchar(100) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `flow_data` longtext,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_document_merges_skey` (`sync_key`),
  KEY `idx_document_merges_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_document_merges_id_del` (`id`,`deleted`),
  KEY `idx_document_merges_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_document_merges_name_del` (`name`,`deleted`),
  KEY `idx_document_merges_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_document_merges_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_document_merges_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `document_merges_audit`
--

CREATE TABLE `document_merges_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `event_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  PRIMARY KEY (`id`),
  KEY `idx_document_merges_audit_event_id` (`event_id`),
  KEY `idx_document_merges_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_document_merges_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `document_revisions`
--

CREATE TABLE `document_revisions` (
  `id` char(36) NOT NULL,
  `change_log` varchar(255) DEFAULT NULL,
  `document_id` char(36) DEFAULT NULL,
  `doc_id` varchar(100) DEFAULT NULL,
  `doc_type` varchar(100) DEFAULT NULL,
  `doc_url` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `filename` varchar(255) DEFAULT NULL,
  `file_ext` varchar(100) DEFAULT NULL,
  `file_mime_type` varchar(100) DEFAULT NULL,
  `revision` varchar(100) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_modified` datetime DEFAULT NULL,
  `file_size` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `documentrevision_mimetype` (`file_mime_type`),
  KEY `documentrevision_document_id` (`document_id`),
  KEY `idx_document_revisions_document_id_deleted` (`document_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `document_templates`
--

CREATE TABLE `document_templates` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `filename` varchar(255) DEFAULT NULL,
  `file_ext` varchar(100) DEFAULT NULL,
  `file_mime_type` varchar(100) DEFAULT NULL,
  `file_size` int(11) DEFAULT NULL,
  `template_module` varchar(100) DEFAULT 'Accounts',
  `use_revisions` tinyint(1) DEFAULT '1',
  `label_merging` tinyint(1) DEFAULT '0',
  `prefix` varchar(120) DEFAULT NULL,
  `postfix` varchar(120) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_document_templates_skey` (`sync_key`),
  KEY `idx_document_templates_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_document_templates_id_del` (`id`,`deleted`),
  KEY `idx_document_templates_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_document_templates_name_del` (`name`,`deleted`),
  KEY `idx_document_templates_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_document_templates_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_document_templates_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `document_templates_audit`
--

CREATE TABLE `document_templates_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `event_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  PRIMARY KEY (`id`),
  KEY `idx_document_templates_audit_event_id` (`event_id`),
  KEY `idx_document_templates_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_document_templates_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `documents`
--

CREATE TABLE `documents` (
  `id` char(36) NOT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `document_name` varchar(255) DEFAULT NULL,
  `doc_id` varchar(100) DEFAULT NULL,
  `doc_type` varchar(100) DEFAULT 'Sugar',
  `doc_url` varchar(255) DEFAULT NULL,
  `active_date` date DEFAULT NULL,
  `exp_date` date DEFAULT NULL,
  `category_id` varchar(100) DEFAULT NULL,
  `subcategory_id` varchar(100) DEFAULT NULL,
  `status_id` varchar(100) DEFAULT NULL,
  `document_revision_id` char(36) DEFAULT NULL,
  `related_doc_id` char(36) DEFAULT NULL,
  `related_doc_rev_id` char(36) DEFAULT NULL,
  `is_template` tinyint(1) DEFAULT '0',
  `template_type` varchar(100) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `is_shared` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `idx_documents_skey` (`sync_key`),
  KEY `documentsmod` (`date_modified`) USING BTREE,
  KEY `idx_doc_cat` (`category_id`,`subcategory_id`) USING BTREE,
  KEY `idx_document_doc_type` (`doc_type`) USING BTREE,
  KEY `idx_document_exp_date` (`exp_date`) USING BTREE,
  KEY `idx_document_date_entered` (`date_entered`) USING BTREE,
  KEY `idx_documents_id_del` (`id`,`deleted`) USING BTREE,
  KEY `idx_documents_related_doc_id_deleted` (`related_doc_id`,`deleted`) USING BTREE,
  KEY `idx_documents_assigned_del` (`assigned_user_id`,`deleted`) USING BTREE,
  KEY `idx_documents_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_documents_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_documents_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_documents_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_documents_status_id` (`status_id`),
  KEY `idx_documents_status_template_type` (`status_id`,`template_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `documents_accounts`
--

CREATE TABLE `documents_accounts` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `document_id` char(36) DEFAULT NULL,
  `account_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `documents_accounts_account_id` (`account_id`,`document_id`),
  KEY `documents_accounts_document_id` (`document_id`,`account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `documents_audit`
--

CREATE TABLE `documents_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `event_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  PRIMARY KEY (`id`),
  KEY `idx_documents_audit_event_id` (`event_id`),
  KEY `idx_documents_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_documents_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `documents_bugs`
--

CREATE TABLE `documents_bugs` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `document_id` char(36) DEFAULT NULL,
  `bug_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `documents_bugs_bug_id` (`bug_id`,`document_id`),
  KEY `documents_bugs_document_id` (`document_id`,`bug_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `documents_cases`
--

CREATE TABLE `documents_cases` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `document_id` char(36) DEFAULT NULL,
  `case_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `documents_cases_case_id` (`case_id`,`document_id`),
  KEY `documents_cases_document_id` (`document_id`,`case_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `documents_contacts`
--

CREATE TABLE `documents_contacts` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `document_id` char(36) DEFAULT NULL,
  `contact_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `documents_contacts_contact_id` (`contact_id`,`document_id`),
  KEY `documents_contacts_document_id` (`document_id`,`contact_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `documents_cstm`
--

CREATE TABLE `documents_cstm` (
  `id_c` char(36) NOT NULL,
  `article_id_c` int(255) DEFAULT '0',
  `topic_c` text,
  `iconurl_c` varchar(255) DEFAULT NULL,
  `posterimageurl_c` varchar(255) DEFAULT NULL,
  `mediaisvideo_c` tinyint(1) DEFAULT '0',
  `switch_optimise_c` tinyint(1) DEFAULT '0',
  `mediaurl_c` varchar(255) DEFAULT NULL,
  `slider_age_r_c` tinyint(1) DEFAULT '0',
  `slider_conts_c` tinyint(1) DEFAULT '0',
  `slider_requiredincome_c` tinyint(1) DEFAULT '0',
  `switch_ttr_c` tinyint(1) DEFAULT '0',
  `slider_desiredincome_c` tinyint(1) DEFAULT '0',
  `bodytext_c` text,
  `lead_c` text,
  `switch_run_out_c` tinyint(1) DEFAULT '0',
  `bodyhtml_c` longtext,
  `iconfile_c` varchar(255) DEFAULT NULL,
  `posterimagefile_c` varchar(255) DEFAULT NULL,
  `topic_tmp_c` mediumtext,
  `attributes_c` text,
  `bodyhtml2_c` longtext,
  `switch_pension_c` tinyint(1) DEFAULT '0',
  `article_profile_field_c` varchar(100) DEFAULT '',
  `account_id_c` char(36) DEFAULT NULL,
  `article_type_c` varchar(100) DEFAULT '',
  `user_id_c` char(36) DEFAULT NULL,
  `displaycalcsalsac_c` tinyint(1) DEFAULT '0',
  `cta_text_c` varchar(255) DEFAULT '',
  `cta_description_c` varchar(255) DEFAULT '',
  `tile_title_c` varchar(255) DEFAULT '',
  `tile_icon_c` varchar(255) DEFAULT '',
  `annuity_slider_c` tinyint(1) DEFAULT '0',
  `annuity_income_slider_c` tinyint(1) DEFAULT '0',
  `save_revisions_c` tinyint(1) DEFAULT '1',
  `motivation_slider_c` tinyint(1) DEFAULT '0',
  `understanding_slider_c` tinyint(1) DEFAULT '0',
  `confidence_slider_c` tinyint(1) DEFAULT '0',
  `involvement_slider_c` tinyint(1) DEFAULT '0',
  `custom_stylesheet_url_c` varchar(255) DEFAULT '',
  `pdf_field_map_c` text,
  `pdf_appendix_c` text,
  `document_id_c` char(36) DEFAULT NULL,
  PRIMARY KEY (`id_c`) USING BTREE,
  KEY `idx_doc_cstm_article_id_c` (`article_id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `documents_escalations`
--

CREATE TABLE `documents_escalations` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `document_id` char(36) DEFAULT NULL,
  `escalation_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `documents_escalations_escalation_id` (`escalation_id`,`document_id`),
  KEY `documents_escalations_document_id` (`document_id`,`escalation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `documents_flc_fl_competencies_1_c`
--

CREATE TABLE `documents_flc_fl_competencies_1_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `documents_flc_fl_competencies_1documents_ida` varchar(36) DEFAULT NULL,
  `documents_flc_fl_competencies_1flc_fl_competencies_idb` varchar(36) DEFAULT NULL,
  `document_revision_id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `documents_flc_fl_competencies_1_ida1` (`documents_flc_fl_competencies_1documents_ida`),
  KEY `documents_flc_fl_competencies_1_alt` (`documents_flc_fl_competencies_1flc_fl_competencies_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `documents_opportunities`
--

CREATE TABLE `documents_opportunities` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `document_id` char(36) DEFAULT NULL,
  `opportunity_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_docu_opps_oppo_id` (`opportunity_id`,`document_id`),
  KEY `idx_docu_oppo_docu_id` (`document_id`,`opportunity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `documents_products`
--

CREATE TABLE `documents_products` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `document_id` char(36) DEFAULT NULL,
  `product_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `documents_products_product_id` (`product_id`,`document_id`),
  KEY `documents_products_document_id` (`document_id`,`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `documents_purchasedlineitems`
--

CREATE TABLE `documents_purchasedlineitems` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `document_id` char(36) DEFAULT NULL,
  `purchasedlineitem_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `documents_purchasedlineitems_purchasedlineitem_id` (`purchasedlineitem_id`,`document_id`),
  KEY `documents_purchasedlineitems_document_id` (`document_id`,`purchasedlineitem_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `documents_purchases`
--

CREATE TABLE `documents_purchases` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `document_id` char(36) DEFAULT NULL,
  `purchase_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `documents_purchases_purchase_id` (`purchase_id`,`document_id`),
  KEY `documents_purchases_document_id` (`document_id`,`purchase_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `documents_quotes`
--

CREATE TABLE `documents_quotes` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `document_id` char(36) DEFAULT NULL,
  `quote_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `documents_quotes_quote_id` (`quote_id`,`document_id`),
  KEY `documents_quotes_document_id` (`document_id`,`quote_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `documents_revenuelineitems`
--

CREATE TABLE `documents_revenuelineitems` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `document_id` char(36) DEFAULT NULL,
  `rli_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `documents_revenuelineitems_revenuelineitem_id` (`rli_id`,`document_id`),
  KEY `documents_revenuelineitems_document_id` (`document_id`,`rli_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `documents_se_competencycontribution_1_c`
--

CREATE TABLE `documents_se_competencycontribution_1_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `documents_se_competencycontribution_1documents_ida` varchar(36) DEFAULT NULL,
  `documents_37edibution_idb` varchar(36) DEFAULT NULL,
  `document_revision_id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `documents_se_competencycontribution_1_ida1` (`documents_se_competencycontribution_1documents_ida`),
  KEY `documents_se_competencycontribution_1_alt` (`documents_37edibution_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `documents_se_fl_competency_1_c`
--

CREATE TABLE `documents_se_fl_competency_1_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `documents_se_fl_competency_1documents_ida` varchar(36) DEFAULT NULL,
  `documents_se_fl_competency_1se_fl_competency_idb` varchar(36) DEFAULT NULL,
  `document_revision_id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `documents_se_fl_competency_1_alt` (`documents_se_fl_competency_1documents_ida`,`documents_se_fl_competency_1se_fl_competency_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `documents_se_flcompetencyresult_1_c`
--

CREATE TABLE `documents_se_flcompetencyresult_1_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `documents_se_flcompetencyresult_1documents_ida` varchar(36) DEFAULT NULL,
  `documents_se_flcompetencyresult_1se_flcompetencyresult_idb` varchar(36) DEFAULT NULL,
  `document_revision_id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `documents_se_flcompetencyresult_1_ida1` (`documents_se_flcompetencyresult_1documents_ida`),
  KEY `documents_se_flcompetencyresult_1_alt` (`documents_se_flcompetencyresult_1se_flcompetencyresult_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `docusign_envelopes`
--

CREATE TABLE `docusign_envelopes` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `status` varchar(100) DEFAULT NULL,
  `envelope_id` varchar(36) DEFAULT '',
  `document_id` char(36) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `parent_type` varchar(255) DEFAULT NULL,
  `last_audit` datetime DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `cloud_service_type` varchar(36) DEFAULT '',
  `cloud_path` varchar(400) DEFAULT '',
  `driveId` varchar(400) DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_docusign_envelopes_skey` (`sync_key`),
  KEY `idx_docusign_envelopes_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_docusign_envelopes_id_del` (`id`,`deleted`),
  KEY `idx_docusign_envelopes_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_docusign_envelopes_name_del` (`name`,`deleted`),
  KEY `idx_envelope_id` (`envelope_id`),
  KEY `idx_parent_record` (`parent_id`,`parent_type`),
  KEY `idx_docusign_envelopes_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_docusign_envelopes_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_docusign_envelopes_assigned_del` (`assigned_user_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `docusign_envelopes_audit`
--

CREATE TABLE `docusign_envelopes_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `event_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  PRIMARY KEY (`id`),
  KEY `idx_docusign_envelopes_audit_event_id` (`event_id`),
  KEY `idx_docusign_envelopes_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_docusign_envelopes_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `dri_subworkflow_templates`
--

CREATE TABLE `dri_subworkflow_templates` (
  `id` char(36) NOT NULL,
  `name` varchar(30) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `label` varchar(255) DEFAULT NULL,
  `sort_order` int(8) DEFAULT NULL,
  `points` int(8) DEFAULT NULL,
  `related_activities` int(8) DEFAULT NULL,
  `dri_workflow_template_id` char(36) DEFAULT NULL,
  `start_next_journey_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_dri_subworkflow_templates_skey` (`sync_key`),
  KEY `idx_dri_subworkflow_templates_date_modfied` (`date_modified`),
  KEY `idx_dri_subworkflow_templates_id_del` (`id`,`deleted`),
  KEY `idx_dri_subworkflow_templates_date_entered` (`date_entered`),
  KEY `idx_dri_subworkflow_templates_name_del` (`name`,`deleted`),
  KEY `idx_cj_stage_tpl_jry_tpl_id` (`dri_workflow_template_id`),
  KEY `idx_dri_subworkflow_templates_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_dri_subworkflow_templates_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_cj_stg_tpl_nxt_jry_tpl_id` (`start_next_journey_id`),
  KEY `idx_dri_subworkflow_templates_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_dri_subworkflow_templates_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `dri_subworkflows`
--

CREATE TABLE `dri_subworkflows` (
  `id` char(36) NOT NULL,
  `name` varchar(30) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `label` varchar(255) DEFAULT NULL,
  `state` varchar(255) DEFAULT 'not_started',
  `progress` float DEFAULT '0',
  `momentum_ratio` float DEFAULT '1',
  `score` int(8) DEFAULT '0',
  `points` int(8) DEFAULT '0',
  `momentum_points` int(8) DEFAULT '0',
  `momentum_score` int(8) DEFAULT '0',
  `sort_order` int(8) DEFAULT '1',
  `date_started` datetime DEFAULT NULL,
  `date_completed` datetime DEFAULT NULL,
  `dri_subworkflow_template_id` char(36) DEFAULT NULL,
  `dri_workflow_id` char(36) DEFAULT NULL,
  `start_next_journey_id` char(36) DEFAULT NULL,
  `is_journey_saved` tinyint(1) DEFAULT '0',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_dri_subworkflows_skey` (`sync_key`),
  KEY `idx_dri_subworkflows_date_modfied` (`date_modified`),
  KEY `idx_dri_subworkflows_id_del` (`id`,`deleted`),
  KEY `idx_dri_subworkflows_date_entered` (`date_entered`),
  KEY `idx_dri_subworkflows_name_del` (`name`,`deleted`),
  KEY `idx_dri_subworkflows_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_cj_stage_org_tpl_id` (`dri_subworkflow_template_id`),
  KEY `idx_cj_stage_parent_journey_id` (`dri_workflow_id`),
  KEY `idx_dri_subworkflows_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_dri_subworkflows_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_dri_subworkflows_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_dri_subworkflows_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `dri_subworkflows_audit`
--

CREATE TABLE `dri_subworkflows_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `event_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  PRIMARY KEY (`id`),
  KEY `idx_dri_subworkflows_audit_parent_id` (`parent_id`),
  KEY `idx_dri_subworkflows_audit_event_id` (`event_id`),
  KEY `idx_dri_subworkflows_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_dri_subworkflows_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `dri_workflow_task_templates`
--

CREATE TABLE `dri_workflow_task_templates` (
  `id` char(36) NOT NULL,
  `name` varchar(50) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `task_due_date_type` varchar(255) DEFAULT NULL,
  `momentum_start_type` varchar(255) DEFAULT NULL,
  `due_date_module` varchar(255) DEFAULT NULL,
  `due_date_field` varchar(255) DEFAULT NULL,
  `momentum_start_module` varchar(255) DEFAULT NULL,
  `momentum_start_field` varchar(255) DEFAULT NULL,
  `priority` varchar(100) DEFAULT 'Medium',
  `type` varchar(255) DEFAULT 'customer_task',
  `activity_type` varchar(255) DEFAULT 'Tasks',
  `duration_minutes` varchar(2) DEFAULT '0',
  `direction` varchar(100) DEFAULT 'Outbound',
  `points` int(3) DEFAULT '10',
  `momentum_points` int(8) DEFAULT '100',
  `send_invites` varchar(255) DEFAULT 'none',
  `target_assignee` varchar(255) DEFAULT 'inherit',
  `assignee_rule` varchar(255) DEFAULT 'inherit',
  `time_of_day` varchar(255) DEFAULT '12:00',
  `sort_order` varchar(255) DEFAULT NULL,
  `task_due_days` int(8) DEFAULT NULL,
  `momentum_due_days` int(8) DEFAULT NULL,
  `momentum_due_hours` int(8) DEFAULT NULL,
  `duration_hours` int(3) DEFAULT '1',
  `is_parent` tinyint(1) DEFAULT '0',
  `blocked_by` text,
  `url` varchar(255) DEFAULT NULL,
  `dri_subworkflow_template_id` char(36) DEFAULT NULL,
  `dri_workflow_template_id` char(36) DEFAULT NULL,
  `target_assignee_user_id` char(36) DEFAULT NULL,
  `target_assignee_team_id` char(36) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `task_start_date_type` varchar(255) DEFAULT NULL,
  `start_date_module` varchar(255) DEFAULT NULL,
  `start_date_field` varchar(255) DEFAULT NULL,
  `send_invite_type` varchar(255) DEFAULT 'none',
  `populate_fields` text,
  `select_to_guests` text,
  `allow_activity_by` text,
  `task_start_days` int(8) DEFAULT NULL,
  `blocked_by_stages` text,
  `start_next_journey_id` char(36) DEFAULT NULL,
  `assignee_rule_activity_id` char(36) DEFAULT NULL,
  `start_date_activity_id` char(36) DEFAULT NULL,
  `due_date_activity_id` char(36) DEFAULT NULL,
  `momentum_start_activity_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `due_date_criteria` varchar(255) DEFAULT 'Absolute',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_dri_workflow_task_templates_skey` (`sync_key`),
  KEY `idx_dri_workflow_task_templates_date_modfied` (`date_modified`),
  KEY `idx_dri_workflow_task_templates_id_del` (`id`,`deleted`),
  KEY `idx_dri_workflow_task_templates_date_entered` (`date_entered`),
  KEY `idx_dri_workflow_task_templates_name_del` (`name`,`deleted`),
  KEY `idx_cj_act_tpl_stage_tpl_id` (`dri_subworkflow_template_id`),
  KEY `idx_cj_act_tpl_jry_tpl_id` (`dri_workflow_template_id`),
  KEY `idx_cj_act_tpl_trgt_asgn_us_id` (`target_assignee_user_id`),
  KEY `idx_cj_act_tpl_trgt_asgn_te_id` (`target_assignee_team_id`),
  KEY `idx_cj_act_tpl_parent_id` (`parent_id`),
  KEY `idx_dri_workflow_task_templates_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_dri_workflow_task_templates_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_cj_act_tpl_nxt_jry_tpl_id` (`start_next_journey_id`),
  KEY `idx_cj_act_tpl_ass_rl_act_id` (`assignee_rule_activity_id`),
  KEY `idx_cj_act_tpl_start_dt_act_id` (`start_date_activity_id`),
  KEY `idx_cj_act_tpl_due_dt_act_id` (`due_date_activity_id`),
  KEY `idx_cj_act_tpl_mmt_strt_act_id` (`momentum_start_activity_id`),
  KEY `idx_dri_workflow_task_templates_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_dri_workflow_task_templates_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `dri_workflow_templates`
--

CREATE TABLE `dri_workflow_templates` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `available_modules` text,
  `disabled_stage_actions` text,
  `disabled_activity_actions` text,
  `points` int(8) DEFAULT NULL,
  `related_activities` int(8) DEFAULT NULL,
  `active` tinyint(1) DEFAULT '1',
  `assignee_rule` varchar(255) DEFAULT 'stage_start',
  `target_assignee` varchar(255) DEFAULT 'current_user',
  `copied_template_id` char(36) DEFAULT NULL,
  `active_limit` int(8) DEFAULT NULL,
  `update_assignees` tinyint(1) DEFAULT '0',
  `cancel_action` varchar(255) DEFAULT 'set_not_applicable',
  `sync_key` varchar(100) DEFAULT NULL,
  `not_applicable_action` varchar(255) DEFAULT 'default',
  `stage_numbering` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_dri_workflow_templates_skey` (`sync_key`),
  KEY `idx_dri_workflow_templates_date_modfied` (`date_modified`),
  KEY `idx_dri_workflow_templates_id_del` (`id`,`deleted`),
  KEY `idx_dri_workflow_templates_date_entered` (`date_entered`),
  KEY `idx_dri_workflow_templates_name_del` (`name`,`deleted`),
  KEY `idx_cj_jry_tpl_copied_tpl_id` (`copied_template_id`),
  KEY `idx_dri_workflow_templates_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_dri_workflow_templates_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_dri_workflow_templates_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_dri_workflow_templates_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `dri_workflows`
--

CREATE TABLE `dri_workflows` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `account_id` char(36) DEFAULT NULL,
  `contact_id` char(36) DEFAULT NULL,
  `lead_id` char(36) DEFAULT NULL,
  `opportunity_id` char(36) DEFAULT NULL,
  `case_id` char(36) DEFAULT NULL,
  `available_modules` text,
  `state` varchar(255) DEFAULT 'not_started',
  `assignee_rule` varchar(255) DEFAULT 'stage_start',
  `target_assignee` varchar(255) DEFAULT 'current_user',
  `progress` float DEFAULT '0',
  `momentum_ratio` float DEFAULT '1',
  `score` int(8) DEFAULT NULL,
  `points` int(8) DEFAULT NULL,
  `momentum_points` int(8) DEFAULT '0',
  `momentum_score` int(8) DEFAULT '0',
  `parent_id` char(36) DEFAULT NULL,
  `parent_type` varchar(255) DEFAULT NULL,
  `date_started` datetime DEFAULT NULL,
  `date_completed` datetime DEFAULT NULL,
  `archived` tinyint(1) DEFAULT '0',
  `dri_workflow_template_id` char(36) DEFAULT NULL,
  `current_stage_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `is_cancelled` tinyint(1) DEFAULT '0',
  `is_deleted` tinyint(1) DEFAULT '0',
  `stage_numbering` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_dri_workflows_skey` (`sync_key`),
  KEY `idx_dri_workflows_date_modfied` (`date_modified`),
  KEY `idx_dri_workflows_id_del` (`id`,`deleted`),
  KEY `idx_dri_workflows_date_entered` (`date_entered`),
  KEY `idx_dri_workflows_name_del` (`name`,`deleted`),
  KEY `idx_dri_workflows_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_cj_jry_account_id` (`account_id`),
  KEY `idx_cj_jry_contact_id` (`contact_id`),
  KEY `idx_cj_jry_lead_id` (`lead_id`),
  KEY `idx_cj_jry_opportunity_id` (`opportunity_id`),
  KEY `idx_cj_jry_case_id` (`case_id`),
  KEY `idx_cj_journey_tpl_id` (`dri_workflow_template_id`),
  KEY `idx_cj_jry_current_stage_id` (`current_stage_id`),
  KEY `idx_cj_jry_parent_id` (`parent_id`),
  KEY `idx_dri_workflows_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_dri_workflows_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_dri_workflows_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_dri_workflows_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `dri_workflows_audit`
--

CREATE TABLE `dri_workflows_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `event_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  PRIMARY KEY (`id`),
  KEY `idx_dri_workflows_audit_parent_id` (`parent_id`),
  KEY `idx_dri_workflows_audit_event_id` (`event_id`),
  KEY `idx_dri_workflows_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_dri_workflows_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `eapm`
--

CREATE TABLE `eapm` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `assigned_user_id` char(36) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `url` varchar(255) DEFAULT NULL,
  `application` varchar(100) DEFAULT 'webex',
  `api_data` text,
  `consumer_key` varchar(255) DEFAULT NULL,
  `consumer_secret` varchar(255) DEFAULT NULL,
  `oauth_token` varchar(255) DEFAULT NULL,
  `oauth_secret` varchar(255) DEFAULT NULL,
  `validated` tinyint(1) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_eapm_skey` (`sync_key`),
  KEY `eapmmod` (`date_modified`),
  KEY `idx_app_active` (`assigned_user_id`,`application`,`validated`),
  KEY `idx_eapm_id_del` (`id`,`deleted`),
  KEY `idx_eapm_date_entered` (`date_entered`),
  KEY `idx_eapm_name_del` (`name`,`deleted`),
  KEY `idx_eapm_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_eapm_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_eapm_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `email_addr_bean_rel`
--

CREATE TABLE `email_addr_bean_rel` (
  `id` char(36) NOT NULL,
  `email_address_id` char(36) NOT NULL,
  `bean_id` char(36) NOT NULL,
  `bean_module` varchar(100) DEFAULT NULL,
  `primary_address` tinyint(1) DEFAULT '0',
  `reply_to_address` tinyint(1) DEFAULT '0',
  `date_created` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_bean_id` (`bean_id`,`bean_module`),
  KEY `idx_email_address_bean` (`email_address_id`,`bean_module`,`bean_id`),
  KEY `idx_primary_address_bean` (`primary_address`,`deleted`,`bean_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `email_addresses`
--

CREATE TABLE `email_addresses` (
  `id` char(36) NOT NULL,
  `email_address` varchar(255) DEFAULT NULL,
  `email_address_caps` varchar(255) DEFAULT NULL,
  `invalid_email` tinyint(1) DEFAULT '0',
  `opt_out` tinyint(1) DEFAULT '0',
  `date_created` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `confirmation_requested_on` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_ea_caps_opt_out_invalid` (`email_address_caps`,`opt_out`,`invalid_email`),
  KEY `idx_ea_opt_out_invalid` (`email_address`,`opt_out`,`invalid_email`),
  KEY `idx_ea_del_ea_id` (`deleted`,`email_address`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `email_addresses_audit`
--

CREATE TABLE `email_addresses_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `event_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  PRIMARY KEY (`id`),
  KEY `idx_email_addresses_audit_event_id` (`event_id`),
  KEY `idx_email_addresses_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_email_addresses_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `email_cache`
--

CREATE TABLE `email_cache` (
  `ie_id` char(36) DEFAULT NULL,
  `mbox` varchar(60) DEFAULT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `fromaddr` varchar(100) DEFAULT NULL,
  `toaddr` varchar(255) DEFAULT NULL,
  `senddate` datetime DEFAULT NULL,
  `message_id` varchar(255) DEFAULT NULL,
  `mailsize` int(10) unsigned DEFAULT NULL,
  `imap_uid` int(10) unsigned DEFAULT NULL,
  `msgno` int(10) unsigned DEFAULT NULL,
  `recent` tinyint(4) DEFAULT NULL,
  `flagged` tinyint(4) DEFAULT NULL,
  `answered` tinyint(4) DEFAULT NULL,
  `deleted` tinyint(4) DEFAULT NULL,
  `seen` tinyint(4) DEFAULT NULL,
  `draft` tinyint(4) DEFAULT NULL,
  KEY `idx_mail_date` (`ie_id`,`mbox`,`senddate`),
  KEY `idx_mail_from` (`ie_id`,`mbox`,`fromaddr`),
  KEY `idx_mail_subj` (`subject`),
  KEY `idx_mail_to` (`toaddr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `email_marketing`
--

CREATE TABLE `email_marketing` (
  `id` char(36) NOT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `from_name` varchar(100) DEFAULT NULL,
  `from_addr` varchar(100) DEFAULT NULL,
  `reply_to_name` varchar(100) DEFAULT NULL,
  `reply_to_addr` varchar(100) DEFAULT NULL,
  `inbound_email_id` char(36) DEFAULT NULL,
  `date_start` datetime DEFAULT NULL,
  `template_id` char(36) NOT NULL,
  `status` varchar(100) DEFAULT NULL,
  `campaign_id` char(36) DEFAULT NULL,
  `all_prospect_lists` tinyint(1) DEFAULT '0',
  `delay_num` varchar(255) DEFAULT NULL,
  `delay_type` varchar(255) DEFAULT NULL,
  `from_addr_type` varchar(255) DEFAULT NULL,
  `delay_seconds` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_emmkt_name` (`name`),
  KEY `idx_emmkit_del` (`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `email_marketing_prospect_lists`
--

CREATE TABLE `email_marketing_prospect_lists` (
  `id` char(36) NOT NULL,
  `prospect_list_id` char(36) DEFAULT NULL,
  `email_marketing_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `email_mp_prospects` (`email_marketing_id`,`prospect_list_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `email_templates`
--

CREATE TABLE `email_templates` (
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `id` char(36) NOT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `published` varchar(3) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `subject` varchar(255) DEFAULT NULL,
  `body` text,
  `body_html` text,
  `deleted` tinyint(1) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `base_module` varchar(50) DEFAULT NULL,
  `from_name` varchar(255) DEFAULT NULL,
  `from_address` varchar(255) DEFAULT NULL,
  `text_only` tinyint(1) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `has_variables` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_email_template_name` (`name`),
  KEY `idx_emailtemplate_type` (`type`),
  KEY `idx_emailtemplate_date_modified` (`date_modified`),
  KEY `idx_emailtemplate_date_entered` (`date_entered`),
  KEY `idx_email_templates_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_email_templates_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_email_templates_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `emailman`
--

CREATE TABLE `emailman` (
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `user_id` char(36) DEFAULT NULL,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `campaign_id` char(36) DEFAULT NULL,
  `marketing_id` char(36) DEFAULT NULL,
  `list_id` char(36) DEFAULT NULL,
  `send_date_time` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `in_queue` tinyint(1) DEFAULT '0',
  `in_queue_date` datetime DEFAULT NULL,
  `send_attempts` int(11) DEFAULT '0',
  `deleted` tinyint(1) DEFAULT '0',
  `related_id` char(36) DEFAULT NULL,
  `related_type` varchar(100) DEFAULT NULL,
  `id_c` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_eman_list` (`list_id`,`user_id`,`deleted`),
  KEY `idx_eman_campaign_id` (`campaign_id`),
  KEY `idx_emailman_send_date_time` (`send_date_time`),
  KEY `idx_emailman_send_attempts` (`send_attempts`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `emails`
--

CREATE TABLE `emails` (
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `id` char(36) NOT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  `date_sent` datetime DEFAULT NULL,
  `message_id` varchar(255) DEFAULT NULL,
  `message_uid` varchar(64) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `type` varchar(100) DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL,
  `flagged` tinyint(1) DEFAULT NULL,
  `reply_to_status` tinyint(1) DEFAULT NULL,
  `intent` varchar(100) DEFAULT 'pick',
  `mailbox_id` char(36) DEFAULT NULL,
  `parent_type` varchar(255) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `state` varchar(100) NOT NULL DEFAULT 'Archived',
  `reply_to_id` char(36) DEFAULT NULL,
  `total_attachments` int(11) DEFAULT NULL,
  `outbound_email_id` char(36) DEFAULT NULL,
  `direction` varchar(20) NOT NULL DEFAULT 'Unknown',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_emails_skey` (`sync_key`),
  KEY `idx_email_name` (`name`),
  KEY `idx_message_id` (`message_id`),
  KEY `idx_email_parent_id` (`parent_id`),
  KEY `idx_email_assigned` (`assigned_user_id`,`type`,`status`),
  KEY `idx_date_modified` (`date_modified`),
  KEY `idx_state` (`state`,`id`),
  KEY `idx_mailbox_id` (`mailbox_id`),
  KEY `idx_emails_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_emails_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `emails_beans`
--

CREATE TABLE `emails_beans` (
  `id` char(36) NOT NULL,
  `email_id` char(36) DEFAULT NULL,
  `bean_id` char(36) DEFAULT NULL,
  `bean_module` varchar(100) DEFAULT NULL,
  `campaign_data` text,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_emails_beans_bean_id` (`bean_id`),
  KEY `idx_emails_beans_email_bean` (`email_id`,`bean_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `emails_email_addr_rel`
--

CREATE TABLE `emails_email_addr_rel` (
  `id` char(36) NOT NULL,
  `email_id` char(36) DEFAULT NULL,
  `address_type` varchar(4) DEFAULT NULL,
  `email_address_id` char(36) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `parent_type` varchar(255) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_eearl_email_id` (`email_id`,`address_type`),
  KEY `idx_eearl_address_id` (`email_address_id`),
  KEY `idx_eearl_email_address_deleted` (`email_address_id`,`deleted`),
  KEY `idx_eearl_email_address_role` (`email_address_id`,`address_type`,`deleted`),
  KEY `idx_eearl_parent` (`parent_type`,`parent_id`,`deleted`),
  KEY `idx_eearl_parent_role` (`parent_type`,`parent_id`,`address_type`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `emails_text`
--

CREATE TABLE `emails_text` (
  `email_id` char(36) NOT NULL,
  `from_addr` varchar(255) DEFAULT NULL,
  `reply_to_addr` varchar(255) DEFAULT NULL,
  `to_addrs` text,
  `cc_addrs` text,
  `bcc_addrs` text,
  `description` longtext,
  `description_html` longtext,
  `raw_source` longtext,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`email_id`),
  KEY `emails_textfromaddr` (`from_addr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `embedded_files`
--

CREATE TABLE `embedded_files` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `filename` varchar(255) DEFAULT NULL,
  `file_mime_type` varchar(100) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_embedded_files_skey` (`sync_key`),
  KEY `idx_embedded_files_date_modfied` (`date_modified`),
  KEY `idx_embedded_files_id_del` (`id`,`deleted`),
  KEY `idx_embedded_files_date_entered` (`date_entered`),
  KEY `idx_embedded_files_name_del` (`name`,`deleted`),
  KEY `idx_embedded_files_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_embedded_files_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `erased_fields`
--

CREATE TABLE `erased_fields` (
  `bean_id` char(36) NOT NULL,
  `table_name` varchar(128) NOT NULL,
  `data` text,
  PRIMARY KEY (`bean_id`,`table_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `escalations`
--

CREATE TABLE `escalations` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `escalation_number` int(11) NOT NULL AUTO_INCREMENT,
  `status` varchar(100) DEFAULT NULL,
  `reason` varchar(100) DEFAULT NULL,
  `source` varchar(100) DEFAULT NULL,
  `parent_type` varchar(255) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `escalationnumk` (`escalation_number`),
  UNIQUE KEY `idx_escalations_skey` (`sync_key`),
  KEY `idx_escalations_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_escalations_id_del` (`id`,`deleted`),
  KEY `idx_escalations_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_escalations_name_del` (`name`,`deleted`),
  KEY `idx_parent_escalation` (`parent_id`,`parent_type`),
  KEY `idx_escalations_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_escalations_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_escalations_assigned_del` (`assigned_user_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `escalations_audit`
--

CREATE TABLE `escalations_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `event_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  PRIMARY KEY (`id`),
  KEY `idx_escalations_audit_event_id` (`event_id`),
  KEY `idx_escalations_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_escalations_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `expressions`
--

CREATE TABLE `expressions` (
  `id` char(36) NOT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `lhs_type` varchar(15) DEFAULT NULL,
  `lhs_field` varchar(50) DEFAULT NULL,
  `lhs_module` varchar(50) DEFAULT NULL,
  `lhs_value` varchar(100) DEFAULT NULL,
  `lhs_group_type` varchar(10) DEFAULT NULL,
  `operator` varchar(15) DEFAULT NULL,
  `rhs_group_type` varchar(10) DEFAULT NULL,
  `rhs_type` varchar(15) DEFAULT NULL,
  `rhs_field` varchar(50) DEFAULT NULL,
  `rhs_module` varchar(50) DEFAULT NULL,
  `rhs_value` varchar(255) DEFAULT NULL,
  `parent_id` char(36) NOT NULL,
  `exp_type` varchar(100) DEFAULT NULL,
  `exp_order` int(4) DEFAULT NULL,
  `parent_type` varchar(255) DEFAULT NULL,
  `parent_exp_id` char(36) DEFAULT NULL,
  `parent_exp_side` int(8) DEFAULT NULL,
  `ext1` varchar(50) DEFAULT NULL,
  `ext2` varchar(50) DEFAULT NULL,
  `ext3` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_exp` (`parent_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `external_users`
--

CREATE TABLE `external_users` (
  `salutation` varchar(255) DEFAULT NULL,
  `first_name` varchar(255) DEFAULT NULL,
  `last_name` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `title` varchar(100) DEFAULT NULL,
  `facebook` varchar(100) DEFAULT NULL,
  `twitter` varchar(100) DEFAULT NULL,
  `googleplus` varchar(100) DEFAULT NULL,
  `department` varchar(255) DEFAULT NULL,
  `do_not_call` tinyint(1) DEFAULT '0',
  `phone_home` varchar(100) DEFAULT NULL,
  `phone_mobile` varchar(100) DEFAULT NULL,
  `phone_work` varchar(100) DEFAULT NULL,
  `phone_other` varchar(100) DEFAULT NULL,
  `phone_fax` varchar(100) DEFAULT NULL,
  `primary_address_street` varchar(150) DEFAULT NULL,
  `primary_address_city` varchar(100) DEFAULT NULL,
  `primary_address_state` varchar(100) DEFAULT NULL,
  `primary_address_postalcode` varchar(20) DEFAULT NULL,
  `primary_address_country` varchar(255) DEFAULT NULL,
  `alt_address_street` varchar(150) DEFAULT NULL,
  `alt_address_city` varchar(100) DEFAULT NULL,
  `alt_address_state` varchar(100) DEFAULT NULL,
  `alt_address_postalcode` varchar(20) DEFAULT NULL,
  `alt_address_country` varchar(255) DEFAULT NULL,
  `assistant` varchar(75) DEFAULT NULL,
  `assistant_phone` varchar(100) DEFAULT NULL,
  `picture` varchar(255) DEFAULT NULL,
  `id` char(36) NOT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `user_name` varchar(255) DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL,
  `external_app` varchar(255) DEFAULT NULL,
  `external_id` varchar(255) DEFAULT NULL,
  `source_id` varchar(255) DEFAULT NULL,
  `source_type` varchar(255) DEFAULT NULL,
  `source_meta` text,
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `parent_type` varchar(255) DEFAULT NULL,
  `parent_id` char(36) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_external_users_skey` (`sync_key`),
  KEY `idx_externalusers_last_first` (`last_name`,`first_name`,`deleted`),
  KEY `idx_externalusers_first_last` (`first_name`,`last_name`,`deleted`),
  KEY `idx_external_users_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_external_users_id_del` (`id`,`deleted`),
  KEY `idx_external_users_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_external_users_name_del` (`name`,`deleted`),
  KEY `idx_external_users_user_name` (`user_name`),
  KEY `idx_external_users_external_id` (`external_id`),
  KEY `idx_external_users_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_external_users_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_external_users_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `external_users_accounts`
--

CREATE TABLE `external_users_accounts` (
  `id` char(36) NOT NULL,
  `external_user_id` char(36) DEFAULT NULL,
  `account_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_ext_user_acc_user` (`external_user_id`,`account_id`),
  KEY `idx_ext_user_acc_acc` (`account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `external_users_bugs`
--

CREATE TABLE `external_users_bugs` (
  `id` char(36) NOT NULL,
  `external_user_id` char(36) DEFAULT NULL,
  `bug_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_ext_user_bug_user` (`external_user_id`,`bug_id`),
  KEY `idx_ext_user_bug_bug` (`bug_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `external_users_cases`
--

CREATE TABLE `external_users_cases` (
  `id` char(36) NOT NULL,
  `external_user_id` char(36) DEFAULT NULL,
  `case_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_ext_user_case_user` (`external_user_id`,`case_id`),
  KEY `idx_ext_user_case_case` (`case_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `external_users_opportunities`
--

CREATE TABLE `external_users_opportunities` (
  `id` char(36) NOT NULL,
  `external_user_id` char(36) DEFAULT NULL,
  `opportunity_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_ext_user_opp_user` (`external_user_id`,`opportunity_id`),
  KEY `idx_ext_user_opp_opp` (`opportunity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `external_users_quotes`
--

CREATE TABLE `external_users_quotes` (
  `id` char(36) NOT NULL,
  `external_user_id` char(36) DEFAULT NULL,
  `quote_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_ext_user_qt_user` (`external_user_id`,`quote_id`),
  KEY `idx_ext_user_qt_qt` (`quote_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `fields_meta_data`
--

CREATE TABLE `fields_meta_data` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `vname` varchar(255) DEFAULT NULL,
  `comments` varchar(255) DEFAULT NULL,
  `help` varchar(255) DEFAULT NULL,
  `custom_module` varchar(255) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `len` int(11) DEFAULT NULL,
  `required` tinyint(1) DEFAULT '0',
  `default_value` varchar(2000) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `audited` tinyint(1) DEFAULT '0',
  `massupdate` tinyint(1) DEFAULT '0',
  `duplicate_merge` smallint(6) DEFAULT '0',
  `reportable` tinyint(1) DEFAULT '1',
  `importable` varchar(255) DEFAULT NULL,
  `ext1` varchar(255) DEFAULT NULL,
  `ext2` varchar(255) DEFAULT NULL,
  `ext3` varchar(255) DEFAULT NULL,
  `ext4` text,
  `autoinc_next` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_fields_meta_data_custom_module_name` (`custom_module`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `filters`
--

CREATE TABLE `filters` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `filter_definition` longtext,
  `module_name` varchar(100) DEFAULT NULL,
  `filter_template` longtext,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `app` varchar(36) DEFAULT 'base',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_filters_skey` (`sync_key`),
  KEY `filtersmod` (`date_modified`),
  KEY `idx_filters_id_del` (`id`,`deleted`),
  KEY `idx_filters_date_entered` (`date_entered`),
  KEY `idx_filters_name_del` (`name`,`deleted`),
  KEY `idx_filters_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_filters_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_filters_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_filters_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_filters_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `flc_fl_competencies`
--

CREATE TABLE `flc_fl_competencies` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` mediumtext,
  `deleted` tinyint(1) DEFAULT '0',
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `article_id` int(255) DEFAULT NULL,
  `competency_id` int(255) DEFAULT NULL,
  `behavioural_indicators` varchar(100) DEFAULT NULL,
  `competency_areas` varchar(100) DEFAULT NULL,
  `points` int(15) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `flc_fl_competenciesmod` (`date_modified`),
  KEY `idx_flc_fl_competencies_tmst_id` (`team_set_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `flc_fl_competencies_audit`
--

CREATE TABLE `flc_fl_competencies_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` mediumtext,
  `after_value_text` mediumtext,
  PRIMARY KEY (`id`),
  KEY `idx_flc_fl_competencies_parent_id` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

CREATE TABLE `folders` (
  `id` char(36) NOT NULL,
  `name` varchar(25) DEFAULT NULL,
  `folder_type` varchar(25) DEFAULT NULL,
  `parent_folder` char(36) DEFAULT NULL,
  `has_child` tinyint(1) DEFAULT '0',
  `is_group` tinyint(1) DEFAULT '0',
  `is_dynamic` tinyint(1) DEFAULT '0',
  `dynamic_query` text,
  `assign_to_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `created_by` char(36) NOT NULL,
  `modified_by` char(36) NOT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `acl_team_set_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_parent_folder` (`parent_folder`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `folders_rel`
--

CREATE TABLE `folders_rel` (
  `id` char(36) NOT NULL,
  `folder_id` char(36) NOT NULL,
  `polymorphic_module` varchar(25) DEFAULT NULL,
  `polymorphic_id` char(36) NOT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_poly_module_poly_id` (`polymorphic_module`,`polymorphic_id`),
  KEY `idx_fr_id_deleted_poly` (`folder_id`,`deleted`,`polymorphic_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `folders_subscriptions`
--

CREATE TABLE `folders_subscriptions` (
  `id` char(36) NOT NULL,
  `folder_id` char(36) NOT NULL,
  `assigned_user_id` char(36) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_folder_id_assigned_user_id` (`folder_id`,`assigned_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `forecast_manager_worksheets`
--

CREATE TABLE `forecast_manager_worksheets` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `quota` decimal(26,6) DEFAULT NULL,
  `best_case` decimal(26,6) DEFAULT NULL,
  `best_case_adjusted` decimal(26,6) DEFAULT NULL,
  `likely_case` decimal(26,6) DEFAULT NULL,
  `likely_case_adjusted` decimal(26,6) DEFAULT NULL,
  `worst_case` decimal(26,6) DEFAULT NULL,
  `worst_case_adjusted` decimal(26,6) DEFAULT NULL,
  `currency_id` char(36) DEFAULT NULL,
  `base_rate` decimal(26,6) DEFAULT NULL,
  `timeperiod_id` char(36) DEFAULT NULL,
  `draft` tinyint(1) DEFAULT '0',
  `user_id` char(36) DEFAULT NULL,
  `opp_count` int(5) DEFAULT NULL,
  `pipeline_opp_count` int(5) DEFAULT '0',
  `pipeline_amount` decimal(26,6) DEFAULT '0.000000',
  `closed_amount` decimal(26,6) DEFAULT '0.000000',
  `manager_saved` tinyint(1) DEFAULT '0',
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_forecast_manager_worksheets_skey` (`sync_key`),
  KEY `forecast_manager_worksheetsmod` (`date_modified`),
  KEY `idx_manager_worksheets_user_timestamp_assigned_user` (`assigned_user_id`,`user_id`,`timeperiod_id`,`draft`,`deleted`),
  KEY `idx_forecast_manager_worksheets_id_del` (`id`,`deleted`),
  KEY `idx_forecast_manager_worksheets_date_entered` (`date_entered`),
  KEY `idx_forecast_manager_worksheets_name_del` (`name`,`deleted`),
  KEY `idx_forecast_manager_worksheets_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_forecast_manager_worksheets_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_forecast_manager_worksheets_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_forecast_manager_worksheets_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_forecast_manager_worksheets_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `forecast_manager_worksheets_audit`
--

CREATE TABLE `forecast_manager_worksheets_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  `event_id` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_forecast_manager_worksheets_parent_id` (`parent_id`),
  KEY `idx_forecast_manager_worksheets_audit_event_id` (`event_id`),
  KEY `idx_forecast_manager_worksheets_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_forecast_manager_worksheets_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `forecast_schedule`
--

CREATE TABLE `forecast_schedule` (
  `id` char(36) NOT NULL,
  `timeperiod_id` char(36) DEFAULT NULL,
  `user_id` char(36) DEFAULT NULL,
  `cascade_hierarchy` tinyint(1) DEFAULT NULL,
  `forecast_start_date` date DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `forecast_tree`
--

CREATE TABLE `forecast_tree` (
  `id` char(36) NOT NULL,
  `name` varchar(50) DEFAULT NULL,
  `hierarchy_type` varchar(25) DEFAULT NULL,
  `user_id` char(36) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `forecast_tree_idx_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `forecast_worksheets`
--

CREATE TABLE `forecast_worksheets` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `parent_type` varchar(255) DEFAULT NULL,
  `opportunity_id` char(36) DEFAULT NULL,
  `opportunity_name` varchar(255) DEFAULT NULL,
  `account_name` varchar(255) DEFAULT NULL,
  `account_id` char(36) DEFAULT NULL,
  `campaign_id` char(36) DEFAULT NULL,
  `campaign_name` varchar(255) DEFAULT NULL,
  `product_template_id` char(36) DEFAULT NULL,
  `product_template_name` varchar(255) DEFAULT NULL,
  `category_id` char(36) DEFAULT NULL,
  `category_name` varchar(255) DEFAULT NULL,
  `sales_status` varchar(255) DEFAULT NULL,
  `likely_case` decimal(26,6) DEFAULT NULL,
  `best_case` decimal(26,6) DEFAULT NULL,
  `worst_case` decimal(26,6) DEFAULT NULL,
  `base_rate` decimal(26,6) DEFAULT NULL,
  `currency_id` char(36) DEFAULT NULL,
  `date_closed` date DEFAULT NULL,
  `date_closed_timestamp` bigint(20) unsigned DEFAULT NULL,
  `sales_stage` varchar(255) DEFAULT NULL,
  `probability` double DEFAULT NULL,
  `commit_stage` varchar(50) DEFAULT NULL,
  `draft` int(11) DEFAULT '0',
  `next_step` varchar(100) DEFAULT NULL,
  `lead_source` varchar(50) DEFAULT NULL,
  `product_type` varchar(255) DEFAULT NULL,
  `list_price` decimal(26,6) DEFAULT NULL,
  `cost_price` decimal(26,6) DEFAULT NULL,
  `discount_price` decimal(26,6) DEFAULT NULL,
  `discount_amount` decimal(26,6) DEFAULT NULL,
  `quantity` int(5) DEFAULT '1',
  `total_amount` decimal(26,6) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_forecast_worksheets_skey` (`sync_key`),
  KEY `forecast_worksheetsmod` (`date_modified`),
  KEY `idx_worksheets_parent` (`parent_id`,`parent_type`),
  KEY `idx_worksheets_assigned_del` (`deleted`,`assigned_user_id`),
  KEY `idx_worksheets_assigned_del_time_draft_parent_type` (`deleted`,`assigned_user_id`,`draft`,`date_closed_timestamp`,`parent_type`),
  KEY `idx_forecastworksheet_commit_stage` (`commit_stage`),
  KEY `idx_forecastworksheet_sales_stage` (`sales_stage`),
  KEY `idx_forecast_worksheets_id_del` (`id`,`deleted`),
  KEY `idx_forecast_worksheets_date_entered` (`date_entered`),
  KEY `idx_forecast_worksheets_name_del` (`name`,`deleted`),
  KEY `idx_forecast_worksheets_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_forecastworksheet_aid_del_id` (`account_id`,`deleted`,`id`),
  KEY `idx_forecastworksheet_oppid_del_id` (`opportunity_id`,`deleted`,`id`),
  KEY `idx_forecast_worksheets_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_forecast_worksheets_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_forecast_worksheets_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_forecast_worksheets_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `forecasts`
--

CREATE TABLE `forecasts` (
  `id` char(36) NOT NULL,
  `timeperiod_id` char(36) DEFAULT NULL,
  `forecast_type` varchar(100) DEFAULT NULL,
  `opp_count` int(5) DEFAULT NULL,
  `pipeline_opp_count` int(5) DEFAULT '0',
  `pipeline_amount` decimal(26,6) DEFAULT '0.000000',
  `closed_amount` decimal(26,6) DEFAULT '0.000000',
  `opp_weigh_value` int(11) DEFAULT NULL,
  `currency_id` char(36) DEFAULT '-99',
  `base_rate` decimal(26,6) DEFAULT NULL,
  `best_case` decimal(26,6) DEFAULT NULL,
  `likely_case` decimal(26,6) DEFAULT NULL,
  `worst_case` decimal(26,6) DEFAULT NULL,
  `user_id` char(36) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_forecast_user_tp` (`user_id`,`timeperiod_id`,`date_modified`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `fts_queue`
--

CREATE TABLE `fts_queue` (
  `bean_id` char(36) DEFAULT NULL,
  `bean_module` varchar(100) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `processed` tinyint(1) DEFAULT '0',
  `id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_beanid` (`bean_id`),
  KEY `idx_beanmodule_processed` (`bean_module`,`processed`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `geocode`
--

CREATE TABLE `geocode` (
  `id` char(36) NOT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `parent_id` varchar(36) DEFAULT '',
  `parent_type` varchar(64) DEFAULT '',
  `parent_name` varchar(256) DEFAULT '',
  `parent_user_name` varchar(256) DEFAULT '',
  `address` text,
  `status` varchar(100) DEFAULT '',
  `postalcode` varchar(64) DEFAULT '',
  `country` varchar(64) DEFAULT '',
  `latitude` decimal(18,10) DEFAULT '0.0000000000',
  `longitude` decimal(18,10) DEFAULT '0.0000000000',
  `geocoded` tinyint(1) DEFAULT '0',
  `error_message` text,
  PRIMARY KEY (`id`),
  KEY `idx_geocode_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_geocode_id_del` (`id`,`deleted`),
  KEY `idx_geocode_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_geocode_geocoded` (`geocoded`,`id`),
  KEY `idx_geocode_p_i_id` (`parent_id`,`id`),
  KEY `idx_geocode_p_t_id` (`parent_type`,`id`),
  KEY `idx_geocode_country` (`country`),
  KEY `idx_geocode_postal_code` (`postalcode`),
  KEY `idx_geocode_status` (`status`),
  KEY `idx_coords_from_zip` (`postalcode`,`country`,`geocoded`,`status`),
  KEY `idx_coords_from_record` (`parent_type`,`parent_id`,`geocoded`,`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `geocode_job`
--

CREATE TABLE `geocode_job` (
  `id` char(36) NOT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `status` varchar(64) DEFAULT '',
  `processed_entity_success_count` varchar(64) DEFAULT '',
  `processed_entity_failed_count` varchar(64) DEFAULT '',
  `addresses_data` longtext,
  `geocode_result` longtext,
  PRIMARY KEY (`id`),
  KEY `idx_geocode_job_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_geocode_job_id_del` (`id`,`deleted`),
  KEY `idx_geocode_job_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_geocode_job_status` (`status`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `geocode_queue`
--

CREATE TABLE `geocode_queue` (
  `id` char(36) NOT NULL,
  `bean_id` char(36) DEFAULT NULL,
  `geocode_id` char(36) DEFAULT NULL,
  `bean_module` varchar(100) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `date_created` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_geocode_queue_bean_id` (`bean_id`),
  KEY `idx_beans_bean_id` (`bean_module`,`bean_id`),
  KEY `idx_geocode_id` (`geocode_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `healthcheck`
--

CREATE TABLE `healthcheck` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` mediumtext,
  `deleted` tinyint(1) DEFAULT '0',
  `logfile` varchar(255) DEFAULT NULL,
  `bucket` char(1) DEFAULT NULL,
  `flag` int(1) DEFAULT NULL,
  `logmeta` longblob,
  `error` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_healthcheck_date_modfied` (`date_modified`),
  KEY `idx_healthcheck_id_del` (`id`,`deleted`),
  KEY `idx_healthcheck_date_entered` (`date_entered`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `hint_accountsets`
--

CREATE TABLE `hint_accountsets` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `type` varchar(20) DEFAULT NULL,
  `category` varchar(128) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `assigned_user_id` char(36) NOT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_hint_accountsets_skey` (`sync_key`),
  KEY `idx_hint_accountsets_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_hint_accountsets_id_del` (`id`,`deleted`),
  KEY `idx_hint_accountsets_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_hint_accountsets_name_del` (`name`,`deleted`),
  KEY `idx_hint_accountsets_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_hint_accountsets_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_hint_accountsets_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `hint_accountsets_targets`
--

CREATE TABLE `hint_accountsets_targets` (
  `id` char(36) NOT NULL,
  `accountset_id` char(36) DEFAULT NULL,
  `target_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `accountsets_targets_acc_idk` (`accountset_id`),
  KEY `accountsets_targets_trg_idk` (`target_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `hint_enrich_field_config`
--

CREATE TABLE `hint_enrich_field_config` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `config_data` text,
  `created` datetime DEFAULT NULL,
  `synced` tinyint(1) DEFAULT '0',
  `sync_key` varchar(100) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_hint_enrich_field_config_skey` (`sync_key`),
  KEY `idx_hint_enrich_field_config_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_hint_enrich_field_config_id_del` (`id`,`deleted`),
  KEY `idx_hint_enrich_field_config_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_hint_enrich_field_config_name_del` (`name`,`deleted`),
  KEY `idx_hint_enrich_field_config_assigned_del` (`assigned_user_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `hint_events_queue`
--

CREATE TABLE `hint_events_queue` (
  `id` char(36) NOT NULL,
  `type` varchar(32) DEFAULT NULL,
  `data` longtext,
  `user_id` char(36) DEFAULT NULL,
  `processing_instance` varchar(32) DEFAULT NULL,
  `processing_start_time` datetime DEFAULT NULL,
  `group_ms` decimal(26,4) DEFAULT '0.0000',
  `event_number` int(11) NOT NULL AUTO_INCREMENT,
  `created` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `event_number_uk` (`event_number`),
  KEY `hint_events_queue_instance_ordered_idk` (`processing_instance`,`group_ms`,`event_number`),
  KEY `hint_events_queue_start_time_idk` (`processing_start_time`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `hint_news_notifications`
--

CREATE TABLE `hint_news_notifications` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `category` varchar(32) DEFAULT NULL,
  `title` varchar(256) DEFAULT NULL,
  `article_date` datetime DEFAULT NULL,
  `photo_url` text,
  `source_url` text,
  `publisher` varchar(64) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `assigned_user_id` char(36) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_hint_news_notifications_skey` (`sync_key`),
  KEY `idx_hint_news_notifications_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_hint_news_notifications_id_del` (`id`,`deleted`),
  KEY `idx_hint_news_notifications_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_hint_news_notifications_name_del` (`name`,`deleted`),
  KEY `idx_hint_news_notifications_assigned_del` (`assigned_user_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `hint_notification_targets`
--

CREATE TABLE `hint_notification_targets` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `type` varchar(32) DEFAULT NULL,
  `credentials` longtext,
  `sync_key` varchar(100) DEFAULT NULL,
  `assigned_user_id` char(36) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_hint_notification_targets_skey` (`sync_key`),
  KEY `idx_hint_notification_targets_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_hint_notification_targets_id_del` (`id`,`deleted`),
  KEY `idx_hint_notification_targets_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_hint_notification_targets_name_del` (`name`,`deleted`),
  KEY `idx_hint_notification_targets_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_hint_notification_targets_assigned_type_del` (`assigned_user_id`,`type`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `holidays`
--

CREATE TABLE `holidays` (
  `id` char(36) NOT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `holiday_date` date DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT NULL,
  `person_id` char(36) DEFAULT NULL,
  `person_type` varchar(255) DEFAULT NULL,
  `related_module` varchar(255) DEFAULT NULL,
  `related_module_id` char(36) DEFAULT NULL,
  `resource_name` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_holiday_id_del` (`id`,`deleted`),
  KEY `idx_holiday_id_rel` (`related_module_id`,`related_module`),
  KEY `idx_holiday_holiday_date` (`holiday_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `import_maps`
--

CREATE TABLE `import_maps` (
  `id` char(36) NOT NULL,
  `name` varchar(254) DEFAULT NULL,
  `source` varchar(36) DEFAULT NULL,
  `enclosure` varchar(1) DEFAULT ' ',
  `delimiter` varchar(1) DEFAULT ',',
  `module` varchar(36) DEFAULT NULL,
  `content` text,
  `default_values` text,
  `has_header` tinyint(1) DEFAULT '1',
  `deleted` tinyint(1) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `is_published` varchar(3) DEFAULT 'no',
  PRIMARY KEY (`id`),
  KEY `idx_owner_module_name` (`assigned_user_id`,`module`,`name`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `inbound_email`
--

CREATE TABLE `inbound_email` (
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `id` varchar(255) NOT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `status` varchar(100) DEFAULT 'Active',
  `server_url` varchar(100) DEFAULT NULL,
  `email_user` varchar(100) DEFAULT NULL,
  `email_password` varchar(255) DEFAULT NULL,
  `port` int(5) DEFAULT NULL,
  `service` varchar(50) DEFAULT NULL,
  `mailbox` text,
  `delete_seen` tinyint(1) DEFAULT '0',
  `mailbox_type` varchar(10) DEFAULT NULL,
  `template_id` char(36) DEFAULT NULL,
  `stored_options` text,
  `group_id` char(36) DEFAULT NULL,
  `is_personal` tinyint(1) DEFAULT '0',
  `groupfolder_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `eapm_id` char(36) DEFAULT NULL,
  `authorized_account` varchar(255) DEFAULT NULL,
  `auth_type` varchar(10) DEFAULT NULL,
  `email_provider` varchar(20) DEFAULT 'other',
  PRIMARY KEY (`id`),
  KEY `idx_deleted` (`deleted`),
  KEY `idx_inbound_email_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_inbound_email_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `inbound_email_autoreply`
--

CREATE TABLE `inbound_email_autoreply` (
  `id` char(36) NOT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `autoreplied_to` varchar(100) DEFAULT NULL,
  `ie_id` char(36) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_ie_autoreplied_to` (`autoreplied_to`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `inbound_email_cache_ts`
--

CREATE TABLE `inbound_email_cache_ts` (
  `id` varchar(255) NOT NULL,
  `ie_timestamp` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `job_queue`
--

CREATE TABLE `job_queue` (
  `assigned_user_id` char(36) DEFAULT NULL,
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `scheduler_id` char(36) DEFAULT NULL,
  `execute_time` datetime DEFAULT NULL,
  `status` varchar(20) DEFAULT NULL,
  `resolution` varchar(20) DEFAULT NULL,
  `message` text,
  `target` varchar(255) DEFAULT NULL,
  `data` longtext,
  `requeue` tinyint(1) DEFAULT '0',
  `retry_count` tinyint(4) DEFAULT NULL,
  `failure_count` tinyint(4) DEFAULT NULL,
  `job_delay` int(11) DEFAULT NULL,
  `client` varchar(255) DEFAULT NULL,
  `percent_complete` int(11) DEFAULT NULL,
  `job_group` varchar(255) DEFAULT NULL,
  `module` varchar(255) DEFAULT NULL,
  `fallible` tinyint(1) DEFAULT '0',
  `rerun` tinyint(1) DEFAULT '0',
  `interface` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_job_queue_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_resolution_executetime` (`resolution`,`execute_time`),
  KEY `idx_target_jobgroup` (`target`,`job_group`,`resolution`),
  KEY `idx_status_sched_id` (`status`,`scheduler_id`),
  KEY `idx_del_time_status` (`deleted`,`execute_time`,`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `job_queue_audit`
--

CREATE TABLE `job_queue_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` mediumtext,
  `after_value_text` mediumtext,
  `event_id` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_job_queue_audit_parent_id` (`parent_id`),
  KEY `idx_job_queue_audit_event_id` (`event_id`),
  KEY `idx_job_queue_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_job_queue_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `kbarticles`
--

CREATE TABLE `kbarticles` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `kbdocument_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_kbarticles_skey` (`sync_key`),
  KEY `idx_kbarticles_date_modfied` (`date_modified`),
  KEY `idx_kbarticles_id_del` (`id`,`deleted`),
  KEY `idx_kbarticles_date_entered` (`date_entered`),
  KEY `idx_kbarticles_name_del` (`name`,`deleted`),
  KEY `idx_kbarticles_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_kbarticles_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_kbarticles_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_kbarticles_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_kbarticles_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `kbcontent_templates`
--

CREATE TABLE `kbcontent_templates` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `body` longtext,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_kbcontent_templates_skey` (`sync_key`),
  KEY `idx_kbcontent_templates_date_modfied` (`date_modified`),
  KEY `idx_kbcontent_templates_id_del` (`id`,`deleted`),
  KEY `idx_kbcontent_templates_date_entered` (`date_entered`),
  KEY `idx_kbcontent_templates_name_del` (`name`,`deleted`),
  KEY `idx_kbcontent_templates_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_kbcontent_templates_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_kbcontent_templates_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_kbcontent_templates_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `kbcontent_templates_audit`
--

CREATE TABLE `kbcontent_templates_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  `event_id` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_kbcontent_templates_audit_event_id` (`event_id`),
  KEY `idx_kbcontent_templates_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_kbcontent_templates_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `kbcontents`
--

CREATE TABLE `kbcontents` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `kbdocument_body` longtext,
  `language` varchar(2) DEFAULT NULL,
  `active_date` date DEFAULT NULL,
  `exp_date` date DEFAULT NULL,
  `approved` tinyint(1) DEFAULT '0',
  `status` varchar(100) DEFAULT 'draft',
  `viewcount` int(11) DEFAULT '0',
  `revision` int(11) DEFAULT '0',
  `useful` int(11) DEFAULT '0',
  `notuseful` int(11) DEFAULT '0',
  `kbdocument_id` char(36) DEFAULT NULL,
  `active_rev` tinyint(4) DEFAULT '0',
  `is_external` tinyint(1) DEFAULT '0',
  `kbarticle_id` char(36) DEFAULT NULL,
  `kbsapprover_id` char(36) DEFAULT NULL,
  `kbscase_id` char(36) DEFAULT NULL,
  `category_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_kbcontents_skey` (`sync_key`),
  KEY `idx_kbcontents_date_modfied` (`date_modified`),
  KEY `idx_kbcontents_id_del` (`id`,`deleted`),
  KEY `idx_kbcontents_date_entered` (`date_entered`),
  KEY `idx_kbcontents_name_del` (`name`,`deleted`),
  KEY `idx_kbcontent_del_doc_id` (`kbdocument_id`,`deleted`),
  KEY `idx_kbcontents_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_kbcontents_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_kbcontents_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_kbcontents_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_kbcontents_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `kbcontents_audit`
--

CREATE TABLE `kbcontents_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  `event_id` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_kbcontents_audit_event_id` (`event_id`),
  KEY `idx_kbcontents_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_kbcontents_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `kbdocument_revisions`
--

CREATE TABLE `kbdocument_revisions` (
  `id` char(36) NOT NULL,
  `change_log` varchar(255) DEFAULT NULL,
  `kbdocument_id` char(36) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `filename` varchar(255) DEFAULT NULL,
  `file_ext` varchar(100) DEFAULT NULL,
  `file_mime_type` varchar(100) DEFAULT NULL,
  `revision` varchar(100) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `latest` tinyint(1) DEFAULT '0',
  `kbcontent_id` char(36) DEFAULT NULL,
  `document_revision_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_del_latest_kbcontent_id` (`deleted`,`latest`,`kbcontent_id`),
  KEY `idx_cont_id_doc_id` (`kbcontent_id`,`kbdocument_id`),
  KEY `idx_name_rev_id_del` (`document_revision_id`,`kbdocument_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `kbdocuments`
--

CREATE TABLE `kbdocuments` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_kbdocuments_skey` (`sync_key`),
  KEY `idx_kbdocuments_date_modfied` (`date_modified`),
  KEY `idx_kbdocuments_id_del` (`id`,`deleted`),
  KEY `idx_kbdocuments_date_entered` (`date_entered`),
  KEY `idx_kbdocuments_name_del` (`name`,`deleted`),
  KEY `idx_kbdocuments_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_kbdocuments_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_kbdocuments_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_kbdocuments_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_kbdocuments_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `kbdocuments_kbtags`
--

CREATE TABLE `kbdocuments_kbtags` (
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `id` char(36) NOT NULL,
  `kbdocument_id` char(36) DEFAULT NULL,
  `kbtag_id` char(36) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `revision` varchar(100) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_modified` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_kbdocuments_kbtags_tmst_id` (`team_set_id`),
  KEY `idx_doc_id_tag_id` (`kbdocument_id`,`kbtag_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `kbdocuments_views_ratings`
--

CREATE TABLE `kbdocuments_views_ratings` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `kbdocument_id` varchar(36) DEFAULT NULL,
  `views_number` int(11) DEFAULT '0',
  `ratings_number` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_kbvr_kbdoc` (`kbdocument_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `kbtags`
--

CREATE TABLE `kbtags` (
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `id` char(36) NOT NULL,
  `parent_tag_id` char(36) DEFAULT NULL,
  `tag_name` varchar(255) DEFAULT NULL,
  `root_tag` tinyint(1) DEFAULT '0',
  `date_entered` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `revision` varchar(100) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_modified` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_kbtags_tmst_id` (`team_set_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `kbusefulness`
--

CREATE TABLE `kbusefulness` (
  `id` char(36) NOT NULL,
  `kbarticle_id` char(36) NOT NULL,
  `user_id` char(36) NOT NULL,
  `contact_id` char(36) DEFAULT NULL,
  `vote` smallint(6) DEFAULT NULL,
  `zeroflag` tinyint(4) DEFAULT NULL,
  `ssid` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `kbusefulness_user` (`kbarticle_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `key_value_cache`
--

CREATE TABLE `key_value_cache` (
  `id` char(32) NOT NULL,
  `date_expires` datetime DEFAULT NULL,
  `value` longtext,
  PRIMARY KEY (`id`),
  KEY `key_value_cache_date_expires` (`date_expires`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

CREATE TABLE `leads` (
  `id` char(36) NOT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `salutation` varchar(255) DEFAULT NULL,
  `first_name` varchar(255) DEFAULT NULL,
  `last_name` varchar(255) DEFAULT NULL,
  `title` varchar(100) DEFAULT NULL,
  `facebook` varchar(100) DEFAULT NULL,
  `twitter` varchar(100) DEFAULT NULL,
  `googleplus` varchar(100) DEFAULT NULL,
  `department` varchar(100) DEFAULT NULL,
  `do_not_call` tinyint(1) DEFAULT '0',
  `phone_home` varchar(100) DEFAULT NULL,
  `phone_mobile` varchar(100) DEFAULT NULL,
  `phone_work` varchar(100) DEFAULT NULL,
  `phone_other` varchar(100) DEFAULT NULL,
  `phone_fax` varchar(100) DEFAULT NULL,
  `primary_address_street` varchar(150) DEFAULT NULL,
  `primary_address_city` varchar(100) DEFAULT NULL,
  `primary_address_state` varchar(100) DEFAULT NULL,
  `primary_address_postalcode` varchar(20) DEFAULT NULL,
  `primary_address_country` varchar(255) DEFAULT NULL,
  `alt_address_street` varchar(150) DEFAULT NULL,
  `alt_address_city` varchar(100) DEFAULT NULL,
  `alt_address_state` varchar(100) DEFAULT NULL,
  `alt_address_postalcode` varchar(20) DEFAULT NULL,
  `alt_address_country` varchar(255) DEFAULT NULL,
  `assistant` varchar(75) DEFAULT NULL,
  `assistant_phone` varchar(100) DEFAULT NULL,
  `picture` varchar(255) DEFAULT NULL,
  `converted` tinyint(1) DEFAULT '0',
  `refered_by` varchar(100) DEFAULT NULL,
  `lead_source` varchar(100) DEFAULT NULL,
  `lead_source_description` text,
  `status` varchar(100) DEFAULT NULL,
  `status_description` text,
  `reports_to_id` char(36) DEFAULT NULL,
  `account_name` varchar(255) DEFAULT NULL,
  `account_description` text,
  `contact_id` char(36) DEFAULT NULL,
  `account_id` char(36) DEFAULT NULL,
  `opportunity_id` char(36) DEFAULT NULL,
  `opportunity_name` varchar(255) DEFAULT NULL,
  `opportunity_amount` varchar(50) DEFAULT NULL,
  `campaign_id` char(36) DEFAULT NULL,
  `birthdate` date DEFAULT NULL,
  `portal_name` varchar(255) DEFAULT NULL,
  `portal_app` varchar(255) DEFAULT NULL,
  `website` varchar(255) DEFAULT NULL,
  `preferred_language` varchar(255) DEFAULT NULL,
  `mkto_sync` tinyint(1) DEFAULT '0',
  `mkto_id` int(11) DEFAULT NULL,
  `mkto_lead_score` int(11) DEFAULT NULL,
  `dnb_principal_id` varchar(30) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `mailchimp_rating_c` int(3) DEFAULT '0',
  `dp_business_purpose` text,
  `dp_consent_last_updated` date DEFAULT NULL,
  `dri_workflow_template_id` char(36) DEFAULT NULL,
  `business_center_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `ai_conv_score_classification` varchar(255) DEFAULT NULL,
  `ai_icp_fit_score_classification` varchar(255) DEFAULT NULL,
  `market_interest_prediction_score` varchar(255) DEFAULT '',
  `market_score` int(11) DEFAULT NULL,
  `hint_account_size` varchar(20) DEFAULT NULL,
  `hint_account_industry` varchar(120) DEFAULT NULL,
  `hint_account_location` varchar(255) DEFAULT NULL,
  `hint_account_description` varchar(255) DEFAULT NULL,
  `hint_job_2` varchar(255) DEFAULT NULL,
  `hint_education` varchar(225) DEFAULT NULL,
  `hint_education_2` varchar(225) DEFAULT NULL,
  `hint_facebook` varchar(120) DEFAULT NULL,
  `hint_twitter` varchar(120) DEFAULT NULL,
  `hint_industry_tags` varchar(225) DEFAULT NULL,
  `hint_account_founded_year` varchar(5) DEFAULT NULL,
  `hint_account_facebook_handle` varchar(120) DEFAULT NULL,
  `hint_account_twitter_handle` varchar(120) DEFAULT NULL,
  `hint_account_logo` varchar(255) DEFAULT NULL,
  `hint_contact_pic` text,
  `hint_photo` varchar(255) DEFAULT NULL,
  `hint_phone_1` varchar(15) DEFAULT NULL,
  `hint_phone_2` varchar(15) DEFAULT NULL,
  `hint_account_naics_code_lbl` varchar(170) DEFAULT NULL,
  `hint_account_sic_code_label` varchar(120) DEFAULT NULL,
  `hint_account_fiscal_year_end` varchar(5) DEFAULT NULL,
  `hint_account_annual_revenue` varchar(25) DEFAULT NULL,
  `hint_account_website` varchar(255) DEFAULT NULL,
  `ai_conv_score_absolute` decimal(10,8) DEFAULT NULL,
  `ai_conv_bin_accuracy` decimal(10,8) DEFAULT NULL,
  `ai_conv_multiplier` decimal(10,8) DEFAULT NULL,
  `ai_icp_fit_score_absolute` decimal(10,8) DEFAULT NULL,
  `ai_icp_fit_bin_accuracy` decimal(10,8) DEFAULT NULL,
  `ai_icp_fit_multiplier` decimal(10,8) DEFAULT NULL,
  `geocode_status` varchar(255) DEFAULT NULL,
  `external_user_id` char(36) DEFAULT NULL,
  `perform_sugar_action` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_leads_skey` (`sync_key`),
  KEY `leadsmod` (`date_modified`),
  KEY `idx_lead_last_first` (`last_name`,`first_name`,`deleted`),
  KEY `idx_leads_acct_del` (`account_id`,`deleted`),
  KEY `idx_del_user` (`deleted`,`assigned_user_id`),
  KEY `idx_lead_contact` (`contact_id`),
  KEY `idx_lead_phone_work` (`phone_work`),
  KEY `idx_leads_id_del` (`id`,`deleted`),
  KEY `idx_lead_date_entered` (`date_entered`),
  KEY `idx_lead_mkto_id` (`mkto_id`),
  KEY `idx_leads_first_last` (`first_name`,`last_name`,`deleted`),
  KEY `idx_leads_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_leads_cjtpl_id` (`dri_workflow_template_id`),
  KEY `idx_leads_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_leads_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_leads_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_leads_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_lead_acct_name_first` (`deleted`,`account_name`,`date_modified`,`id`,`team_set_id`),
  KEY `idx_lead_idx_del_last_name` (`deleted`,`last_name`),
  KEY `idx_leads_status` (`deleted`,`status`),
  KEY `idx_lead_opp_del` (`deleted`,`opportunity_id`,`id`),
  KEY `idx_reports_to` (`deleted`,`reports_to_id`,`id`),
  KEY `idx_leads_del_businesscenter` (`deleted`,`business_center_id`),
  KEY `idx_leads_external_user_id` (`external_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `leads_audit`
--

CREATE TABLE `leads_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  `event_id` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_leads_parent_id` (`parent_id`),
  KEY `idx_leads_audit_event_id` (`event_id`),
  KEY `idx_leads_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_leads_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `leads_cstm`
--

CREATE TABLE `leads_cstm` (
  `id_c` char(36) NOT NULL,
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `leads_dataprivacy`
--

CREATE TABLE `leads_dataprivacy` (
  `id` char(36) NOT NULL,
  `lead_id` char(36) DEFAULT NULL,
  `dataprivacy_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_lead_dataprivacy_dataprivacy` (`dataprivacy_id`),
  KEY `idx_leads_dataprivacy` (`lead_id`,`dataprivacy_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `linked_documents`
--

CREATE TABLE `linked_documents` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `parent_type` varchar(25) DEFAULT NULL,
  `document_id` char(36) DEFAULT NULL,
  `document_revision_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_parent_document` (`parent_type`,`parent_id`,`document_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `locked_field_bean_rel`
--

CREATE TABLE `locked_field_bean_rel` (
  `id` char(36) NOT NULL,
  `pd_id` char(36) NOT NULL,
  `bean_id` char(36) NOT NULL,
  `bean_module` varchar(100) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_locked_fields_rel_pdid_beanid` (`pd_id`,`bean_id`),
  KEY `idx_locked_field_bean_rel_del_bean_module_beanid` (`bean_module`,`deleted`),
  KEY `idx_locked_field_bean_rel_beanid_del_bean_module` (`bean_id`,`deleted`,`bean_module`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `lt_funds`
--

CREATE TABLE `lt_funds` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `abn` int(255) DEFAULT NULL,
  `fees_mgt` int(255) DEFAULT NULL,
  `fees_admin` int(255) DEFAULT NULL,
  `fees_actuary` int(255) DEFAULT NULL,
  `fees_director` int(255) DEFAULT NULL,
  `fees_audit` int(255) DEFAULT NULL,
  `fees_other` int(255) DEFAULT NULL,
  `fees_total` int(255) DEFAULT NULL,
  `num_members` int(255) DEFAULT NULL,
  `num_pension_members` int(255) DEFAULT NULL,
  `percent_pension_members` int(3) DEFAULT NULL,
  `account_id_c` char(36) DEFAULT NULL,
  `num_inv_options` int(255) DEFAULT NULL,
  `mix_aust_equities` int(255) DEFAULT NULL,
  `mix_intl_equities` int(255) DEFAULT NULL,
  `mix_listed_propert` int(255) DEFAULT NULL,
  `mix_unlisted_property` int(255) DEFAULT NULL,
  `mix_aust_fi` int(255) DEFAULT NULL,
  `mix_intl_fi` int(255) DEFAULT NULL,
  `mix_cash` int(255) DEFAULT NULL,
  `mix_other` int(255) DEFAULT NULL,
  `assets_default` int(255) DEFAULT NULL,
  `assets_total` int(255) DEFAULT NULL,
  `assets_per_member` int(255) DEFAULT NULL,
  `benefit_structure` varchar(100) DEFAULT NULL,
  `public_offer_status` varchar(100) DEFAULT NULL,
  `investment_offer` text,
  `current_default` text,
  `fund_pricing` text,
  `online_planning` text,
  `current_suppliers` text,
  `other_online_tools` text,
  `fp_services` text,
  `fp_planners_num` int(6) DEFAULT NULL,
  `fp_planner_type` varchar(100) DEFAULT NULL,
  `fp_planning_price` text,
  `ifs_link` tinyint(1) DEFAULT '0',
  `fund_type` varchar(100) DEFAULT NULL,
  `net_assets` int(255) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_lt_funds_skey` (`sync_key`),
  KEY `lt_fundsmod` (`date_modified`),
  KEY `idx_lt_funds_id_del` (`id`,`deleted`),
  KEY `idx_lt_funds_date_entered` (`date_entered`),
  KEY `idx_lt_funds_name_del` (`name`,`deleted`),
  KEY `idx_lt_funds_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_lt_funds_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_lt_funds_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_lt_funds_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_lt_funds_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `lt_funds_accounts_c`
--

CREATE TABLE `lt_funds_accounts_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `lt_funds_accountsaccounts_ida` varchar(36) DEFAULT NULL,
  `lt_funds_accountslt_funds_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `lt_funds_accounts_ida1` (`lt_funds_accountsaccounts_ida`),
  KEY `lt_funds_accounts_alt` (`lt_funds_accountslt_funds_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `lt_funds_audit`
--

CREATE TABLE `lt_funds_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `data_type` varchar(100) DEFAULT NULL,
  `before_value_string` varchar(255) DEFAULT NULL,
  `after_value_string` varchar(255) DEFAULT NULL,
  `before_value_text` text,
  `after_value_text` text,
  `event_id` char(36) DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_lt_funds_parent_id` (`parent_id`),
  KEY `idx_lt_funds_audit_event_id` (`event_id`),
  KEY `idx_lt_funds_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_lt_funds_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `lt_funds_contacts_c`
--

CREATE TABLE `lt_funds_contacts_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `lt_funds_contactslt_funds_ida` varchar(36) DEFAULT NULL,
  `lt_funds_contactscontacts_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `lt_funds_contacts_alt` (`lt_funds_contactslt_funds_ida`,`lt_funds_contactscontacts_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `lt_funds_opportunities_c`
--

CREATE TABLE `lt_funds_opportunities_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `lt_funds_opportunitieslt_funds_ida` varchar(36) DEFAULT NULL,
  `lt_funds_opportunitiesopportunities_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `lt_funds_opportunities_alt` (`lt_funds_opportunitieslt_funds_ida`,`lt_funds_opportunitiesopportunities_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `manufacturers`
--

CREATE TABLE `manufacturers` (
  `id` char(36) NOT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `list_order` int(4) DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL,
  `description` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_manufacturers_skey` (`sync_key`),
  KEY `idx_manufacturers` (`name`,`deleted`),
  KEY `idx_manufacturers_date_modfied` (`date_modified`),
  KEY `idx_manufacturers_id_del` (`id`,`deleted`),
  KEY `idx_manufacturers_date_entered` (`date_entered`),
  KEY `idx_manufacturers_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_manufacturers_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `meetings`
--

CREATE TABLE `meetings` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `location` varchar(50) DEFAULT NULL,
  `password` varchar(50) DEFAULT NULL,
  `join_url` varchar(600) DEFAULT NULL,
  `host_url` varchar(600) DEFAULT NULL,
  `displayed_url` varchar(400) DEFAULT NULL,
  `creator` varchar(50) DEFAULT NULL,
  `external_id` varchar(50) DEFAULT NULL,
  `duration_hours` int(11) DEFAULT '0',
  `duration_minutes` int(2) DEFAULT '0',
  `date_start` datetime DEFAULT NULL,
  `date_end` datetime DEFAULT NULL,
  `parent_type` varchar(100) DEFAULT NULL,
  `status` varchar(100) DEFAULT 'Planned',
  `type` varchar(255) DEFAULT 'Sugar',
  `parent_id` char(36) DEFAULT NULL,
  `reminder_time` int(11) DEFAULT '-1',
  `email_reminder_time` int(11) DEFAULT '-1',
  `email_reminder_sent` tinyint(1) DEFAULT '0',
  `outlook_id` varchar(255) DEFAULT NULL,
  `sequence` int(11) DEFAULT '0',
  `repeat_type` varchar(36) DEFAULT NULL,
  `repeat_interval` int(3) DEFAULT '1',
  `repeat_dow` varchar(7) DEFAULT NULL,
  `repeat_until` date DEFAULT NULL,
  `repeat_count` int(7) DEFAULT NULL,
  `repeat_parent_id` char(36) DEFAULT NULL,
  `recurring_source` varchar(36) DEFAULT NULL,
  `repeat_selector` varchar(36) DEFAULT NULL,
  `repeat_days` varchar(128) DEFAULT NULL,
  `repeat_ordinal` varchar(36) DEFAULT NULL,
  `repeat_unit` varchar(36) DEFAULT NULL,
  `recurrence_id` datetime DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `dri_workflow_sort_order` varchar(255) DEFAULT '1',
  `cj_actual_sort_order` varchar(255) DEFAULT NULL,
  `customer_journey_score` int(8) DEFAULT NULL,
  `cj_momentum_points` int(8) DEFAULT NULL,
  `cj_momentum_score` int(8) DEFAULT NULL,
  `customer_journey_progress` float DEFAULT '0',
  `cj_momentum_ratio` float DEFAULT '0',
  `customer_journey_points` int(3) DEFAULT '10',
  `cj_parent_activity_type` varchar(255) DEFAULT NULL,
  `customer_journey_blocked_by` text,
  `cj_parent_activity_id` char(36) DEFAULT NULL,
  `is_cj_parent_activity` tinyint(1) DEFAULT '0',
  `is_customer_journey_activity` tinyint(1) DEFAULT '0',
  `cj_momentum_start_date` datetime DEFAULT NULL,
  `cj_momentum_end_date` datetime DEFAULT NULL,
  `cj_url` varchar(255) DEFAULT NULL,
  `dri_workflow_template_id` char(36) DEFAULT NULL,
  `dri_subworkflow_template_id` char(36) DEFAULT NULL,
  `dri_workflow_task_template_id` char(36) DEFAULT NULL,
  `dri_subworkflow_id` char(36) DEFAULT NULL,
  `cj_allow_activity_by` text,
  `cj_blocked_by_stages` text,
  `start_next_journey_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `internal_notes` text,
  `dri_workflow_id` char(36) DEFAULT NULL,
  `rset` text,
  `event_type` varchar(30) DEFAULT NULL,
  `ical_uid` varchar(255) DEFAULT NULL,
  `original_start_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_meetings_skey` (`sync_key`),
  KEY `meetingsmod` (`date_modified`),
  KEY `idx_meet_par_del` (`parent_id`,`parent_type`,`deleted`),
  KEY `idx_meet_stat_del` (`assigned_user_id`,`status`,`deleted`),
  KEY `idx_meet_date_start_reminder` (`date_start`,`reminder_time`),
  KEY `idx_meeting_date_entered` (`date_entered`),
  KEY `idx_meetings_id_del` (`id`,`deleted`),
  KEY `idx_meet_date_start_end_del` (`date_start`,`date_end`,`deleted`),
  KEY `idx_meet_repeat_parent_id` (`repeat_parent_id`,`deleted`),
  KEY `idx_meetings_name_del` (`name`,`deleted`),
  KEY `idx_meetings_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_meeting_cj_journey_tpl_id` (`dri_workflow_template_id`),
  KEY `idx_meeting_cj_stage_tpl_id` (`dri_subworkflow_template_id`),
  KEY `idx_meeting_cj_activity_tpl_id` (`dri_workflow_task_template_id`),
  KEY `idx_meeting_cj_stage_id` (`dri_subworkflow_id`),
  KEY `idx_meeting_cj_parent_activity` (`deleted`,`cj_parent_activity_id`,`cj_parent_activity_type`),
  KEY `idx_meetings_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_meetings_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_meetings_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_meetings_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_meeting_cj_journey_id` (`dri_workflow_id`),
  KEY `idx_del_wf_tpl_sub_subtpl_meeting_name` (`deleted`,`dri_workflow_id`,`dri_workflow_template_id`,`dri_subworkflow_id`,`dri_subworkflow_template_id`,`dri_workflow_task_template_id`,`name`),
  KEY `idx_del_wf_tpl_sub_subtpl_meeting_status` (`deleted`,`dri_workflow_id`,`dri_workflow_template_id`,`dri_subworkflow_id`,`dri_subworkflow_template_id`,`dri_workflow_task_template_id`,`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
