-- Table structure for table `notes_audit`
--

CREATE TABLE `notes_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_notes_audit_event_id` (`event_id`),
  KEY `idx_notes_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_notes_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `notes_cstm`
--

CREATE TABLE `notes_cstm` (
  `id_c` char(36) NOT NULL,
  `notify_management_c` tinyint(1) DEFAULT '0',
  `full_description_c` text,
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

CREATE TABLE `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',
  `assigned_user_id` char(36) DEFAULT NULL,
  `is_read` tinyint(1) DEFAULT '0',
  `severity` varchar(15) DEFAULT NULL,
  `parent_type` varchar(100) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_notifications_skey` (`sync_key`),
  KEY `notificationsmod` (`date_modified`),
  KEY `idx_notifications_my_unread_items` (`assigned_user_id`,`is_read`,`deleted`),
  KEY `idx_notifications_id_del` (`id`,`deleted`),
  KEY `idx_notifications_date_entered` (`date_entered`),
  KEY `idx_notifications_name_del` (`name`,`deleted`),
  KEY `idx_notifications_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_notifications_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_notifications_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `notifications_audit`
--

CREATE TABLE `notifications_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_notifications_parent_id` (`parent_id`),
  KEY `idx_notifications_audit_event_id` (`event_id`),
  KEY `idx_notifications_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_notifications_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `oauth_consumer`
--

CREATE TABLE `oauth_consumer` (
  `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,
  `c_key` varchar(255) DEFAULT NULL,
  `c_secret` varchar(255) DEFAULT NULL,
  `oauth_type` varchar(50) DEFAULT 'oauth1',
  `client_type` varchar(50) DEFAULT 'user',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ckey` (`c_key`),
  UNIQUE KEY `idx_oauth_consumer_skey` (`sync_key`),
  KEY `oauth_consumermod` (`date_modified`),
  KEY `idx_oauthkey_client_type` (`client_type`),
  KEY `idx_oauth_consumer_id_del` (`id`,`deleted`),
  KEY `idx_oauth_consumer_date_entered` (`date_entered`),
  KEY `idx_oauth_consumer_name_del` (`name`,`deleted`),
  KEY `idx_oauth_consumer_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_oauth_consumer_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_oauth_consumer_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `oauth_nonce`
--

CREATE TABLE `oauth_nonce` (
  `conskey` varchar(32) NOT NULL,
  `nonce` varchar(32) NOT NULL,
  `nonce_ts` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`conskey`,`nonce`),
  KEY `oauth_nonce_keyts` (`conskey`,`nonce_ts`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `oauth_tokens`
--

CREATE TABLE `oauth_tokens` (
  `id` char(36) NOT NULL,
  `secret` varchar(32) DEFAULT NULL,
  `tstate` varchar(1) DEFAULT NULL,
  `consumer` char(36) NOT NULL,
  `token_ts` bigint(20) DEFAULT NULL,
  `expire_ts` bigint(20) DEFAULT '-1',
  `verify` varchar(32) DEFAULT NULL,
  `download_token` varchar(36) DEFAULT NULL,
  `platform` varchar(255) DEFAULT 'base',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `callback_url` varchar(255) DEFAULT NULL,
  `contact_id` char(36) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`,`deleted`),
  KEY `oauth_state_ts` (`tstate`,`token_ts`),
  KEY `constoken_key` (`consumer`),
  KEY `idx_platform_assigned_tstate` (`platform`,`assigned_user_id`,`tstate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `opportunities`
--

CREATE TABLE `opportunities` (
  `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,
  `opportunity_type` varchar(255) DEFAULT NULL,
  `campaign_id` char(36) DEFAULT NULL,
  `lead_source` varchar(50) DEFAULT NULL,
  `amount` decimal(26,6) DEFAULT NULL,
  `base_rate` decimal(26,6) DEFAULT NULL,
  `amount_usdollar` decimal(26,6) DEFAULT NULL,
  `currency_id` char(36) DEFAULT '-99',
  `date_closed` date DEFAULT NULL,
  `date_closed_timestamp` bigint(20) unsigned DEFAULT NULL,
  `next_step` varchar(100) DEFAULT NULL,
  `sales_stage` varchar(255) DEFAULT 'Prospecting',
  `sales_status` varchar(255) DEFAULT NULL,
  `probability` double DEFAULT NULL,
  `best_case` decimal(26,6) DEFAULT NULL,
  `worst_case` decimal(26,6) DEFAULT NULL,
  `commit_stage` varchar(50) DEFAULT NULL,
  `mkto_sync` tinyint(1) DEFAULT '0',
  `mkto_id` int(11) DEFAULT NULL,
  `total_revenue_line_items` int(11) DEFAULT NULL,
  `closed_revenue_line_items` int(11) DEFAULT NULL,
  `included_revenue_line_items` int(11) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `dri_workflow_template_id` char(36) DEFAULT NULL,
  `renewal_parent_id` char(36) DEFAULT NULL,
  `renewal` tinyint(1) DEFAULT '0',
  `service_start_date` date DEFAULT NULL,
  `service_open_revenue_line_items` int(11) DEFAULT NULL,
  `service_duration_value` int(5) DEFAULT NULL,
  `service_duration_unit` varchar(50) DEFAULT NULL,
  `service_open_flex_duration_rlis` int(11) DEFAULT '0',
  `sync_key` varchar(100) DEFAULT NULL,
  `forecasted_likely` decimal(26,6) DEFAULT NULL,
  `closed_won_revenue_line_items` int(11) DEFAULT NULL,
  `ai_opp_conv_score_enum` varchar(255) DEFAULT NULL,
  `is_escalated` tinyint(1) DEFAULT '0',
  `denorm_account_name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_opportunities_skey` (`sync_key`),
  KEY `opportunitiesmod` (`date_modified`),
  KEY `idx_opp_id_deleted` (`id`,`deleted`),
  KEY `idx_opportunity_date_entered` (`date_entered`),
  KEY `idx_opportunities_name_del` (`name`,`deleted`),
  KEY `idx_opportunities_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_opportunities_cjtpl_id` (`dri_workflow_template_id`),
  KEY `idx_opportunities_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_opportunities_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_opportunities_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_opportunities_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_opp_name` (`deleted`,`name`,`date_modified`),
  KEY `idx_opportunity_next_step` (`deleted`,`next_step`,`date_modified`),
  KEY `idx_opportunities_denorm_account_name` (`denorm_account_name`,`id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `opportunities_audit`
--

CREATE TABLE `opportunities_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_opportunities_parent_id` (`parent_id`),
  KEY `idx_opportunities_audit_event_id` (`event_id`),
  KEY `idx_opportunities_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_opportunities_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `opportunities_cases_1_c`
--

CREATE TABLE `opportunities_cases_1_c` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `opportunities_cases_1opportunities_ida` char(36) DEFAULT NULL,
  `opportunities_cases_1cases_idb` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_opportunities_cases_1_ida1_deleted` (`opportunities_cases_1opportunities_ida`,`deleted`),
  KEY `idx_opportunities_cases_1_idb2_deleted` (`opportunities_cases_1cases_idb`,`deleted`),
  KEY `opportunities_cases_1_alt` (`opportunities_cases_1cases_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `opportunities_contacts`
--

CREATE TABLE `opportunities_contacts` (
  `id` char(36) NOT NULL,
  `contact_id` char(36) DEFAULT NULL,
  `opportunity_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_opp_con` (`contact_id`),
  KEY `idx_opportunities_contacts` (`opportunity_id`,`contact_id`),
  KEY `idx_del_opp_con` (`deleted`,`opportunity_id`,`contact_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `opportunities_cstm`
--

CREATE TABLE `opportunities_cstm` (
  `id_c` char(36) NOT NULL,
  `expected_amount_c` decimal(26,6) DEFAULT NULL,
  `rating_c` varchar(100) DEFAULT NULL,
  `risks_c` text,
  `strategy_c` text,
  `authority_c` text,
  `timeframe_c` text,
  `budget_c` text,
  `needs_c` text,
  `close_plan_c` varchar(255) DEFAULT NULL,
  `process_trigger_c` text,
  `process_attributes_c` text,
  `charge_amount_c` decimal(26,6) DEFAULT '0.000000',
  `amount_charged_c` decimal(26,6) DEFAULT '0.000000',
  `amount_remaining_c` decimal(26,6) DEFAULT NULL,
  `amount_credited_c` decimal(26,6) DEFAULT '0.000000',
  `progress_pc_c` decimal(18,2) DEFAULT NULL,
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `outbound_email`
--

CREATE TABLE `outbound_email` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `type` varchar(15) DEFAULT 'user',
  `user_id` char(36) NOT NULL,
  `mail_sendtype` varchar(8) DEFAULT 'SMTP',
  `mail_smtptype` varchar(20) DEFAULT 'other',
  `mail_smtpserver` varchar(100) DEFAULT NULL,
  `mail_smtpport` int(5) DEFAULT '0',
  `mail_smtpuser` varchar(100) DEFAULT NULL,
  `mail_smtppass` varchar(255) DEFAULT NULL,
  `mail_smtpauth_req` tinyint(1) DEFAULT '0',
  `mail_smtpssl` int(1) DEFAULT '0',
  `email_address_id` char(36) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `reply_to_email_address_id` char(36) DEFAULT NULL,
  `reply_to_name` varchar(255) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_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,
  `mail_authtype` varchar(36) DEFAULT NULL,
  `preferred_sending_account` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_outbound_email_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_outbound_email_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `oe_type_idx` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pd_pardot`
--

CREATE TABLE `pd_pardot` (
  `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',
  `assigned_user_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pd_pardotmod` (`date_modified`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pd_pardot_audit`
--

CREATE TABLE `pd_pardot_audit` (
  `id` char(36) NOT NULL,
  `parent_id` char(36) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `created_by` varchar(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_pd_pardot_parent_id` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pdfmanager`
--

CREATE TABLE `pdfmanager` (
  `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,
  `base_module` varchar(100) DEFAULT NULL,
  `published` varchar(100) DEFAULT 'yes',
  `field` varchar(100) DEFAULT '0',
  `body_html` text,
  `template_name` varchar(255) DEFAULT NULL,
  `author` varchar(255) DEFAULT 'SugarCRM',
  `title` varchar(255) DEFAULT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `keywords` varchar(255) DEFAULT NULL,
  `header_title` varchar(255) DEFAULT NULL,
  `header_text` varchar(255) DEFAULT NULL,
  `footer_text` varchar(255) DEFAULT NULL,
  `header_logo` varchar(255) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pdfmanager_skey` (`sync_key`),
  KEY `pdfmanagermod` (`date_modified`),
  KEY `idx_pdfmanager_base_module` (`base_module`),
  KEY `idx_pdfmanager_date_entered` (`date_entered`),
  KEY `idx_pdfmanager_id_del` (`id`,`deleted`),
  KEY `idx_pdfmanager_name_del` (`name`,`deleted`),
  KEY `idx_pdfmanager_published` (`published`),
  KEY `idx_pdfmanager_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pdfmanager_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_pdfmanager_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_pdfmanager_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pdfmanager_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_process_completed_process`
--

CREATE TABLE `pm_process_completed_process` (
  `id` varchar(36) NOT NULL,
  `object_id` varchar(36) DEFAULT NULL,
  `object_type` varchar(100) DEFAULT NULL,
  `process_id` varchar(36) DEFAULT NULL,
  `stage_id` varchar(36) DEFAULT NULL,
  `task_id` varchar(36) DEFAULT NULL,
  `process_complete` tinyint(4) DEFAULT NULL,
  `process_complete_date` datetime DEFAULT NULL,
  KEY `idx_object_id` (`object_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_process_defs`
--

CREATE TABLE `pm_process_defs` (
  `id` varchar(36) NOT NULL,
  `process_id` varchar(36) DEFAULT NULL,
  `ignore_process_prev_run_check` int(10) DEFAULT NULL,
  `process_query_value` mediumtext,
  `process_frequency` varchar(36) DEFAULT NULL,
  `process_start_time_day` varchar(25) DEFAULT NULL,
  `process_start_day_of_week` varchar(25) DEFAULT NULL,
  `process_day_of_month` varchar(25) DEFAULT NULL,
  `process_month` varchar(25) DEFAULT NULL,
  `process_last_run_date` datetime DEFAULT NULL,
  `route_object` int(10) DEFAULT NULL,
  `routing_type` varchar(25) DEFAULT NULL,
  `route_to_user` varchar(25) DEFAULT NULL,
  `check_login_status` int(10) DEFAULT NULL,
  `find_logged_in_user` int(10) DEFAULT NULL,
  `route_to_role` varchar(100) DEFAULT NULL,
  `route_to_team` varchar(100) DEFAULT NULL,
  KEY `idx_object_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_process_filter_table`
--

CREATE TABLE `pm_process_filter_table` (
  `id` varchar(36) NOT NULL,
  `process_id` varchar(36) DEFAULT NULL,
  `status` varchar(35) DEFAULT NULL,
  `field_name` varchar(45) DEFAULT NULL,
  `field_value` varchar(100) DEFAULT NULL,
  `field_operator` varchar(45) DEFAULT NULL,
  `sequence` int(10) DEFAULT NULL,
  `andorfilterfields` varchar(10) DEFAULT NULL,
  `group_number` int(3) DEFAULT NULL,
  `group_andor` varchar(10) DEFAULT NULL,
  `field_value_to` varchar(100) DEFAULT NULL,
  KEY `idx_object_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_process_project_task_defs`
--

CREATE TABLE `pm_process_project_task_defs` (
  `id` varchar(36) NOT NULL,
  `project_id` varchar(36) DEFAULT NULL,
  `project_task_id` varchar(11) DEFAULT NULL,
  `project_task_subject` varchar(45) DEFAULT NULL,
  `project_task_status` varchar(255) DEFAULT NULL,
  `project_task_priority` varchar(255) DEFAULT NULL,
  `project_task_start_date` int(11) DEFAULT NULL,
  `project_task_end_date` int(11) DEFAULT NULL,
  `assigned_user_id_project_task` varchar(36) DEFAULT NULL,
  `project_task_milestone` tinyint(4) DEFAULT NULL,
  `project_task_task_number` int(11) DEFAULT NULL,
  `project_task_order` int(11) DEFAULT NULL,
  `project_task_description` mediumtext
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_process_related_filter_table`
--

CREATE TABLE `pm_process_related_filter_table` (
  `id` varchar(36) NOT NULL,
  `process_id` varchar(36) DEFAULT NULL,
  `status` varchar(35) DEFAULT NULL,
  `related_module` varchar(100) DEFAULT NULL,
  `related_field_name` varchar(100) DEFAULT NULL,
  `related_field_value` varchar(100) DEFAULT NULL,
  `related_field_operator` varchar(45) DEFAULT NULL,
  `sequence` int(10) DEFAULT NULL,
  `relatedandorfilterfields` varchar(10) DEFAULT NULL,
  KEY `idx_object_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_process_stage_waiting_todo`
--

CREATE TABLE `pm_process_stage_waiting_todo` (
  `id` varchar(36) NOT NULL,
  `object_id` varchar(36) DEFAULT NULL,
  `object_type` varchar(45) DEFAULT NULL,
  `process_id` varchar(36) DEFAULT NULL,
  `stage_id` varchar(36) DEFAULT NULL,
  `start_delay_type` varchar(45) DEFAULT NULL,
  `start_time` datetime DEFAULT NULL,
  KEY `idx_object_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_process_task_call_defs`
--

CREATE TABLE `pm_process_task_call_defs` (
  `id` varchar(36) NOT NULL,
  `task_id` varchar(36) DEFAULT NULL,
  `call_subject` varchar(45) DEFAULT NULL,
  `start_delay_minutes` int(11) DEFAULT NULL,
  `start_delay_hours` int(11) DEFAULT NULL,
  `start_delay_days` int(11) DEFAULT NULL,
  `reminder_time` int(11) DEFAULT NULL,
  `call_description` mediumtext,
  `start_delay_type` varchar(45) DEFAULT NULL,
  `start_delay_months` int(11) DEFAULT NULL,
  `start_delay_years` int(11) DEFAULT NULL,
  `assigned_user_id_call` varchar(36) DEFAULT NULL,
  `is_escalatable_call` tinyint(4) DEFAULT NULL,
  `escalation_delay_minutes_call` int(11) DEFAULT NULL,
  KEY `idx_task_id` (`task_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_process_task_convert_lead_defs`
--

CREATE TABLE `pm_process_task_convert_lead_defs` (
  `id` varchar(36) NOT NULL,
  `task_id` varchar(36) DEFAULT NULL,
  `create_account` tinyint(4) DEFAULT NULL,
  `create_contact` tinyint(4) DEFAULT NULL,
  `create_opportunity` tinyint(4) DEFAULT NULL,
  `create_opportunity_name` varchar(100) DEFAULT NULL,
  `create_opportunity_sales_stage` varchar(100) DEFAULT NULL,
  `create_opportunity_close_date` varchar(50) DEFAULT NULL,
  KEY `idx_object_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_process_task_create_by_field_defs`
--

CREATE TABLE `pm_process_task_create_by_field_defs` (
  `id` varchar(36) NOT NULL,
  `task_id` varchar(36) DEFAULT NULL,
  `create_by_field_field` varchar(255) DEFAULT NULL,
  `create_by_field_method` varchar(255) DEFAULT NULL,
  `create_by_field_by_field` varchar(255) DEFAULT NULL,
  `create_by_field_by_value` varchar(255) DEFAULT NULL,
  `create_by_field_by_date` varchar(255) DEFAULT NULL,
  KEY `idx_object_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_process_task_create_object_defs`
--

CREATE TABLE `pm_process_task_create_object_defs` (
  `id` varchar(36) NOT NULL,
  `create_object_type` varchar(36) DEFAULT NULL,
  `create_object_id` varchar(45) DEFAULT NULL,
  `create_object_delay_minutes` int(11) DEFAULT NULL,
  `create_object_delay_hours` int(11) DEFAULT NULL,
  `create_object_delay_days` int(11) DEFAULT NULL,
  `create_object_description` mediumtext,
  `create_object_delay_months` int(11) DEFAULT NULL,
  `create_object_delay_years` int(11) DEFAULT NULL,
  `start_delay_months` int(11) DEFAULT NULL,
  `assigned_user_id_create_object` varchar(36) DEFAULT NULL,
  `task_id` varchar(36) DEFAULT NULL,
  `inherit_parent_data` tinyint(4) DEFAULT NULL,
  `inherit_parent_relationships` tinyint(4) DEFAULT NULL,
  `relate_object_to_parent` tinyint(4) DEFAULT NULL,
  `create_record_method` varchar(50) DEFAULT NULL,
  KEY `idx_object_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_process_task_email_defs`
--

CREATE TABLE `pm_process_task_email_defs` (
  `id` varchar(36) NOT NULL,
  `email_template_name` varchar(100) DEFAULT NULL,
  `email_template_id` varchar(36) DEFAULT NULL,
  `task_id` varchar(36) DEFAULT NULL,
  `contact_role` varchar(45) DEFAULT NULL,
  `internal_email` int(11) DEFAULT NULL,
  `internal_email_to_address` mediumtext,
  `send_email_to_caseopp_account` int(2) DEFAULT NULL,
  `send_email_to_object_owner` int(2) DEFAULT NULL,
  `email_from_account` varchar(100) DEFAULT NULL,
  `send_email_to_contact` int(2) DEFAULT NULL,
  `email_queue_campaign_name` varchar(100) DEFAULT NULL,
  `send_email_to_email_queue` int(2) DEFAULT NULL,
  `cc_email_to_address` mediumtext,
  `email_field` varchar(100) DEFAULT NULL,
  `related_module` varchar(100) DEFAULT NULL,
  `related_module_email_field` varchar(100) DEFAULT NULL,
  `send_email_to_all` int(2) DEFAULT NULL,
  KEY `idx_object_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_process_task_meeting_defs`
--

CREATE TABLE `pm_process_task_meeting_defs` (
  `id` varchar(36) NOT NULL,
  `task_id` varchar(36) DEFAULT NULL,
  `meeting_subject` varchar(45) DEFAULT NULL,
  `start_delay_minutes` int(11) DEFAULT NULL,
  `start_delay_hours` int(11) DEFAULT NULL,
  `start_delay_days` int(11) DEFAULT NULL,
  `reminder_time` int(11) DEFAULT NULL,
  `meeting_description` mediumtext,
  `start_delay_type` varchar(45) DEFAULT NULL,
  `start_delay_months` int(11) DEFAULT NULL,
  `start_delay_years` int(11) DEFAULT NULL,
  `assigned_user_id_meeting` varchar(36) DEFAULT NULL,
  `meeting_location` varchar(45) DEFAULT NULL,
  KEY `idx_object_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_process_task_modify_field_defs`
--

CREATE TABLE `pm_process_task_modify_field_defs` (
  `id` varchar(36) NOT NULL,
  `process_object_modify_field` varchar(50) DEFAULT NULL,
  `process_object_modify_field_value` varchar(255) DEFAULT NULL,
  `process_object_modify_field_by_field` varchar(255) DEFAULT NULL,
  `process_object_modify_field_by_date` varchar(100) DEFAULT NULL,
  `task_id` varchar(36) DEFAULT NULL,
  `process_object_modify_related_object` varchar(100) DEFAULT NULL,
  `modify_field_by_related_field` varchar(100) DEFAULT NULL,
  `modify_field_by_related_module` varchar(100) DEFAULT NULL,
  `process_object_modify_related_field` varchar(100) DEFAULT NULL,
  `process_object_modify_related_value` varchar(255) DEFAULT NULL,
  `modify_method` varchar(100) DEFAULT NULL,
  `related_modify_method` varchar(100) DEFAULT NULL,
  `process_object_modify_related_field_by_field` varchar(255) DEFAULT NULL,
  `process_object_modify_related_field_by_date` varchar(100) DEFAULT NULL,
  `modify_field_by_relate_field_related_field` varchar(100) DEFAULT NULL,
  `modify_field_by_relate_field_field` varchar(100) DEFAULT NULL,
  KEY `idx_object_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_process_task_notification_defs`
--

CREATE TABLE `pm_process_task_notification_defs` (
  `id` varchar(36) NOT NULL,
  `task_id` varchar(36) DEFAULT NULL,
  `notification_name` varchar(255) DEFAULT NULL,
  `notification_description` varchar(1024) DEFAULT NULL,
  `assigned_user_id_notification` varchar(36) DEFAULT NULL,
  `severity_notification` varchar(100) DEFAULT NULL,
  KEY `idx_object_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_process_task_rest_defs`
--

CREATE TABLE `pm_process_task_rest_defs` (
  `id` varchar(36) NOT NULL,
  `task_id` varchar(36) DEFAULT NULL,
  `rest_url` varchar(1024) DEFAULT NULL,
  `rest_method` varchar(255) DEFAULT NULL,
  `rest_http_query` varchar(1024) DEFAULT NULL,
  `rest_json` mediumtext,
  `rest_headers` mediumtext,
  `rest_custom_script` varchar(255) DEFAULT NULL,
  KEY `idx_object_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_process_task_routing_defs`
--

CREATE TABLE `pm_process_task_routing_defs` (
  `id` varchar(36) NOT NULL,
  `task_id` varchar(36) DEFAULT NULL,
  `routing_type` varchar(25) DEFAULT NULL,
  `route_to_user` varchar(25) DEFAULT NULL,
  `check_login_status` int(11) DEFAULT NULL,
  `find_logged_in_user` int(11) DEFAULT NULL,
  `route_to_role` varchar(100) DEFAULT NULL,
  `route_to_team` varchar(100) DEFAULT NULL,
  `route_to_securitygroups` varchar(100) DEFAULT NULL,
  KEY `idx_object_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_process_task_task_defs`
--

CREATE TABLE `pm_process_task_task_defs` (
  `id` varchar(36) NOT NULL,
  `task_id` varchar(36) DEFAULT NULL,
  `task_subject` varchar(45) DEFAULT NULL,
  `task_priority` varchar(15) DEFAULT NULL,
  `due_date_delay_minutes` int(11) DEFAULT NULL,
  `due_date_delay_hours` int(11) DEFAULT NULL,
  `due_date_delay_days` int(11) DEFAULT NULL,
  `due_date_delay_type` varchar(45) DEFAULT NULL,
  `due_date_delay_months` int(11) DEFAULT NULL,
  `due_date_delay_years` int(11) DEFAULT NULL,
  `assigned_user_id_task` varchar(36) DEFAULT NULL,
  `is_escalatable_task` tinyint(4) DEFAULT NULL,
  `escalation_delay_minutes_task` int(11) DEFAULT NULL,
  `task_description` mediumtext,
  KEY `idx_object_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_process_task_waiting_todo`
--

CREATE TABLE `pm_process_task_waiting_todo` (
  `id` varchar(36) NOT NULL,
  `object_id` varchar(36) DEFAULT NULL,
  `object_type` varchar(45) DEFAULT NULL,
  `process_id` varchar(36) DEFAULT NULL,
  `stage_id` varchar(36) DEFAULT NULL,
  `task_id` varchar(36) DEFAULT NULL,
  `start_date` datetime DEFAULT NULL,
  `waiting_on_id` varchar(36) DEFAULT NULL,
  `task_order` int(11) DEFAULT NULL,
  `task_type` varchar(10) DEFAULT NULL,
  KEY `idx_id` (`id`),
  KEY `idx_object_id` (`object_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_processmanager`
--

CREATE TABLE `pm_processmanager` (
  `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` varchar(36) DEFAULT 'null',
  `team_set_id` varchar(36) DEFAULT 'null',
  `assigned_user_id` char(36) DEFAULT NULL,
  `status` varchar(100) DEFAULT 'Active',
  `process_object` char(100) DEFAULT NULL,
  `start_event` varchar(100) DEFAULT 'Create',
  `cancel_on_event` varchar(100) DEFAULT '--None--',
  `process_object_cancel_field` varchar(100) DEFAULT NULL,
  `process_object_cancel_field_value` varchar(25) DEFAULT NULL,
  `process_object_cancel_field_operator` varchar(25) DEFAULT NULL,
  `related_object` char(100) DEFAULT 'Create',
  `filter_on_related` varchar(100) DEFAULT NULL,
  `check_delete_modify_cancel` tinyint(1) DEFAULT '-1',
  PRIMARY KEY (`id`),
  KEY `pm_processmanagermod` (`date_modified`),
  KEY `idx_pm_processmanager_tmst_id` (`team_set_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_processmanager_audit`
--

CREATE TABLE `pm_processmanager_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_pm_processmanager_parent_id` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_processmanager_entry_table`
--

CREATE TABLE `pm_processmanager_entry_table` (
  `id` varchar(36) NOT NULL,
  `object_id` varchar(36) DEFAULT NULL,
  `object_type` varchar(45) DEFAULT NULL,
  `object_event` varchar(45) DEFAULT NULL,
  KEY `idx_object_id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_processmanagerstage`
--

CREATE TABLE `pm_processmanagerstage` (
  `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` varchar(36) DEFAULT 'null',
  `team_set_id` varchar(36) DEFAULT 'null',
  `assigned_user_id` char(36) DEFAULT NULL,
  `stage_order` int(11) DEFAULT '0',
  `start_delay_minutes` varchar(100) DEFAULT NULL,
  `start_delay_hours` varchar(100) DEFAULT NULL,
  `start_delay_days` varchar(100) DEFAULT NULL,
  `start_delay_months` varchar(100) DEFAULT NULL,
  `start_delay_years` varchar(100) DEFAULT NULL,
  `process_id` varchar(36) DEFAULT 'null',
  PRIMARY KEY (`id`),
  KEY `pm_processmanagerstagemod` (`date_modified`),
  KEY `idx_pm_processmanagerstage_tmst_id` (`team_set_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_processmanagerstage_audit`
--

CREATE TABLE `pm_processmanagerstage_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_pm_processmanagerstage_parent_id` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_processmanagerstagetask`
--

CREATE TABLE `pm_processmanagerstagetask` (
  `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` varchar(36) DEFAULT 'null',
  `team_set_id` varchar(36) DEFAULT 'null',
  `assigned_user_id` char(36) DEFAULT NULL,
  `task_order` int(11) DEFAULT NULL,
  `stage_id` varchar(36) DEFAULT 'null',
  `email_template_defs_id` varchar(36) DEFAULT NULL,
  `calls_defs_id` varchar(36) DEFAULT NULL,
  `project_task_defs_id` varchar(36) DEFAULT NULL,
  `task_defs_id` varchar(36) DEFAULT NULL,
  `task_type` varchar(50) DEFAULT NULL,
  `trigger_process_name` varchar(200) DEFAULT NULL,
  `start_delay_type` varchar(50) DEFAULT NULL,
  `custom_script` varchar(25) DEFAULT NULL,
  `meetings_defs_id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pm_processmanagerstagetaskmod` (`date_modified`),
  KEY `idx_pm_processmanagerstagetask_tmst_id` (`team_set_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_processmanagerstagetask_audit`
--

CREATE TABLE `pm_processmanagerstagetask_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_pm_processmanagerstagetask_parent_id` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_processmgerstagetask`
--

CREATE TABLE `pm_processmgerstagetask` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `pm_processmanagerstage_ida` varchar(36) DEFAULT NULL,
  `pm_processmanagerstagetask_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pm_processmgerstagetask_ida1` (`pm_processmanagerstage_ida`),
  KEY `pm_processmgerstagetask_idb2` (`pm_processmanagerstagetask_idb`),
  KEY `pm_processmgerstagetask_idc3` (`pm_processmanagerstage_ida`,`pm_processmanagerstagetask_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_processmmanagerstage`
--

CREATE TABLE `pm_processmmanagerstage` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `pm_processmanager_ida` varchar(36) DEFAULT NULL,
  `pm_processmanagerstage_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pm_processmmanagerstage_ida1` (`pm_processmanager_ida`),
  KEY `pm_processmmanagerstage_idb2` (`pm_processmanagerstage_idb`),
  KEY `pm_processmmanagerstage_idc3` (`pm_processmanager_ida`,`pm_processmanagerstage_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pm_round_robin_tracking`
--

CREATE TABLE `pm_round_robin_tracking` (
  `id` varchar(36) NOT NULL,
  `user_id` varchar(36) DEFAULT NULL,
  `role_id` varchar(36) DEFAULT NULL,
  `process_id` varchar(36) DEFAULT NULL,
  `object_id` varchar(36) DEFAULT NULL,
  `object_type` varchar(12) DEFAULT NULL,
  `object_event` varchar(10) DEFAULT NULL,
  `date_last_object_routed` datetime DEFAULT NULL,
  KEY `idx_object_id` (`object_id`),
  KEY `idx_role_id` (`role_id`),
  KEY `idx_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpm_activity_definition`
--

CREATE TABLE `pmse_bpm_activity_definition` (
  `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,
  `pro_id` varchar(36) DEFAULT '',
  `act_type` varchar(32) DEFAULT 'TASK',
  `act_duration` int(4) DEFAULT '0',
  `act_duration_unit` varchar(32) DEFAULT 'DAYS',
  `act_send_notification` int(4) DEFAULT '0',
  `act_assignment_method` varchar(32) DEFAULT 'balanced',
  `act_assign_team` varchar(40) DEFAULT '',
  `act_assign_user` varchar(40) DEFAULT '',
  `act_value_based_assignment` varchar(255) DEFAULT '',
  `act_reassign` int(4) DEFAULT '0',
  `act_reassign_team` varchar(40) DEFAULT '',
  `act_adhoc` int(4) DEFAULT '0',
  `act_adhoc_behavior` varchar(40) DEFAULT '',
  `act_adhoc_team` varchar(40) DEFAULT '',
  `act_response_buttons` varchar(40) DEFAULT '',
  `act_last_user_assigned` varchar(40) DEFAULT '',
  `act_field_module` varchar(100) DEFAULT '',
  `act_fields` text,
  `act_readonly_fields` text,
  `act_expected_time` text,
  `act_required_fields` text,
  `act_related_modules` text,
  `act_service_url` text,
  `act_service_params` text,
  `act_service_method` text,
  `act_update_record_owner` int(4) DEFAULT '0',
  `execution_mode` varchar(10) DEFAULT 'DEFAULT',
  `act_params` text,
  `act_email_process_user` tinyint(1) DEFAULT '0',
  `act_email_template_id` text,
  `act_set_by_avl` tinyint(1) DEFAULT '0',
  `act_avl_count` int(4) DEFAULT '0',
  `act_avl_type` varchar(40) DEFAULT NULL,
  `act_avl_before_type` varchar(40) DEFAULT NULL,
  `act_reserve_user` varchar(36) DEFAULT '',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpm_activity_definition_skey` (`sync_key`),
  KEY `idx_pmse_bpm_activity_definition_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpm_activity_definition_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpm_activity_definition_date_entered` (`date_entered`),
  KEY `idx_pmse_bpm_activity_definition_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpm_activity_definition_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpm_activity_definition_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpm_activity_definition_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpm_activity_step`
--

CREATE TABLE `pmse_bpm_activity_step` (
  `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,
  `pro_id` varchar(36) DEFAULT '',
  `act_step_type` varchar(30) DEFAULT 'START',
  `act_criteria` text,
  `act_step_form` varchar(255) DEFAULT '',
  `act_step_script` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpm_activity_step_skey` (`sync_key`),
  KEY `idx_pmse_bpm_activity_step_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpm_activity_step_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpm_activity_step_date_entered` (`date_entered`),
  KEY `idx_pmse_bpm_activity_step_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpm_activity_step_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpm_activity_step_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpm_activity_step_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpm_activity_user`
--

CREATE TABLE `pmse_bpm_activity_user` (
  `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,
  `pro_id` varchar(36) DEFAULT '',
  `act_user_type` varchar(32) DEFAULT '',
  `act_user_id` varchar(40) DEFAULT '',
  `act_group_id` varchar(40) DEFAULT '',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpm_activity_user_skey` (`sync_key`),
  KEY `idx_pmse_bpm_activity_user_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpm_activity_user_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpm_activity_user_date_entered` (`date_entered`),
  KEY `idx_pmse_bpm_activity_user_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpm_activity_user_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpm_activity_user_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpm_activity_user_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpm_config`
--

CREATE TABLE `pmse_bpm_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',
  `assigned_user_id` char(36) DEFAULT NULL,
  `cfg_status` varchar(20) DEFAULT 'ACTIVE',
  `cfg_value` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpm_config_skey` (`sync_key`),
  KEY `idx_pmse_bpm_config_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpm_config_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpm_config_date_entered` (`date_entered`),
  KEY `idx_pmse_bpm_config_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpm_config_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpm_config_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpm_config_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpm_dynamic_forms`
--

CREATE TABLE `pmse_bpm_dynamic_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',
  `assigned_user_id` char(36) DEFAULT NULL,
  `dyn_uid` varchar(32) DEFAULT '',
  `pro_id` varchar(36) DEFAULT '',
  `prj_id` varchar(36) DEFAULT '',
  `dyn_module` varchar(255) DEFAULT '',
  `dyn_view_defs` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpm_dynamic_forms_skey` (`sync_key`),
  KEY `idx_pmse_bpm_dynamic_forms_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpm_dynamic_forms_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpm_dynamic_forms_date_entered` (`date_entered`),
  KEY `idx_pmse_bpm_dynamic_forms_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpm_dynamic_forms_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpm_dynamic_forms_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpm_dynamic_forms_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpm_event_definition`
--

CREATE TABLE `pmse_bpm_event_definition` (
  `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,
  `prj_id` varchar(36) DEFAULT '',
  `pro_id` varchar(36) DEFAULT '',
  `evn_status` varchar(32) DEFAULT 'ACTIVE',
  `evn_type` varchar(30) DEFAULT 'START',
  `evn_module` varchar(128) DEFAULT 'Leads',
  `evn_criteria` text,
  `evn_params` text,
  `evn_script` text,
  `execution_mode` varchar(10) DEFAULT 'DEFAULT',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpm_event_definition_skey` (`sync_key`),
  KEY `idx_pmse_bpm_event_definition_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpm_event_definition_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpm_event_definition_date_entered` (`date_entered`),
  KEY `idx_pmse_bpm_event_definition_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpm_event_definition_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpm_event_definition_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpm_event_definition_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpm_flow`
--

CREATE TABLE `pmse_bpm_flow` (
  `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,
  `cas_id` int(11) DEFAULT NULL,
  `cas_index` int(11) DEFAULT NULL,
  `pro_id` varchar(36) DEFAULT '',
  `cas_previous` int(4) DEFAULT '0',
  `cas_reassign_level` int(4) DEFAULT '0',
  `bpmn_id` varchar(36) DEFAULT '',
  `bpmn_type` varchar(32) DEFAULT '',
  `cas_user_id` varchar(40) DEFAULT '',
  `cas_thread` int(4) DEFAULT '0',
  `cas_flow_status` varchar(32) DEFAULT 'OPEN',
  `cas_sugar_module` varchar(128) DEFAULT '',
  `cas_sugar_object_id` varchar(40) DEFAULT '',
  `cas_sugar_action` varchar(40) DEFAULT 'DetailView',
  `cas_adhoc_type` varchar(40) DEFAULT '',
  `cas_adhoc_parent_id` varchar(40) DEFAULT '',
  `cas_adhoc_actions` varchar(255) DEFAULT '',
  `cas_task_start_date` datetime DEFAULT NULL,
  `cas_delegate_date` datetime DEFAULT NULL,
  `cas_start_date` datetime DEFAULT NULL,
  `cas_finish_date` datetime DEFAULT NULL,
  `cas_due_date` datetime DEFAULT NULL,
  `cas_queue_duration` int(4) DEFAULT '0',
  `cas_duration` int(4) DEFAULT '0',
  `cas_delay_duration` int(4) DEFAULT '0',
  `cas_started` int(4) DEFAULT '0',
  `cas_finished` int(4) DEFAULT '0',
  `cas_delayed` int(4) DEFAULT '0',
  `cas_assignment_method` varchar(32) DEFAULT '',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpm_flow_skey` (`sync_key`),
  KEY `idx_pmse_bpm_flow_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpm_flow_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpm_flow_date_entered` (`date_entered`),
  KEY `idx_pmse_bpm_flow_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpm_flow_cas_flow_status` (`bpmn_id`,`cas_flow_status`),
  KEY `idx_pmse_bpm_flow_parent_and_cas_id` (`cas_sugar_object_id`,`cas_sugar_module`,`cas_index`),
  KEY `idx_pmse_bpm_flow_bpmn_type_flow_status_due_date_del` (`bpmn_type`,`cas_flow_status`,`cas_due_date`,`deleted`),
  KEY `idx_pmse_bpm_flow_del_cas_id` (`cas_id`,`deleted`),
  KEY `idx_pmse_bpm_flow_cas_id_flow_status` (`cas_id`,`cas_flow_status`),
  KEY `idx_pmse_bpm_flow_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpm_flow_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpm_flow_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_pmse_bpm_flow_cas_flow_status_cas_obj_id_del` (`cas_flow_status`,`cas_sugar_object_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpm_flow_backup`
--

CREATE TABLE `pmse_bpm_flow_backup` (
  `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,
  `cas_id` int(4) DEFAULT NULL,
  `cas_index` int(4) DEFAULT NULL,
  `pro_id` varchar(36) DEFAULT '',
  `cas_previous` int(4) DEFAULT '0',
  `cas_reassign_level` int(4) DEFAULT '0',
  `bpmn_id` varchar(36) DEFAULT '',
  `bpmn_type` varchar(32) DEFAULT '',
  `cas_user_id` varchar(40) DEFAULT '',
  `cas_thread` int(4) DEFAULT '0',
  `cas_flow_status` varchar(32) DEFAULT 'OPEN',
  `cas_sugar_module` varchar(128) DEFAULT '',
  `cas_sugar_object_id` varchar(40) DEFAULT '',
  `cas_sugar_action` varchar(40) DEFAULT 'DetailView',
  `cas_adhoc_type` varchar(40) DEFAULT '',
  `cas_adhoc_parent_id` varchar(40) DEFAULT '',
  `cas_adhoc_actions` varchar(255) DEFAULT '',
  `cas_task_start_date` datetime DEFAULT NULL,
  `cas_delegate_date` datetime DEFAULT NULL,
  `cas_start_date` datetime DEFAULT NULL,
  `cas_finish_date` datetime DEFAULT NULL,
  `cas_due_date` datetime DEFAULT NULL,
  `cas_queue_duration` int(4) DEFAULT '0',
  `cas_duration` int(4) DEFAULT '0',
  `cas_delay_duration` int(4) DEFAULT '0',
  `cas_started` int(4) DEFAULT '0',
  `cas_finished` int(4) DEFAULT '0',
  `cas_delayed` int(4) DEFAULT '0',
  `cas_assignment_method` varchar(32) DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `idx_pmse_bpm_flow_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpm_flow_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpm_flow_date_entered` (`date_entered`),
  KEY `idx_pmse_bpm_flow_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpm_flow_cas_flow_status` (`bpmn_id`,`cas_flow_status`),
  KEY `idx_pmse_bpm_flow_status` (`cas_flow_status`),
  KEY `idx_pmse_bpm_flow_parent` (`cas_sugar_object_id`,`cas_sugar_module`),
  KEY `idx_pmse_bpm_flow_cas_id` (`cas_id`),
  KEY `idx_pmse_bpm_flow_parent_and_cas_id` (`cas_sugar_object_id`,`cas_sugar_module`,`cas_index`),
  KEY `idx_pmse_bpm_flow_bpmn_type_flow_status_due_date_del` (`bpmn_type`,`cas_flow_status`,`cas_due_date`,`deleted`),
  KEY `idx_pmse_bpm_flow_del_cas_id` (`cas_id`,`deleted`),
  KEY `idx_pmse_bpm_flow_cas_id_flow_status` (`cas_id`,`cas_flow_status`),
  KEY `idx_pmse_bpm_flow_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpm_flow_cas_sugar_object_id` (`cas_sugar_object_id`),
  KEY `idx_pmse_bpm_flow_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpm_flow_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpm_form_action`
--

CREATE TABLE `pmse_bpm_form_action` (
  `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,
  `cas_id` int(11) DEFAULT NULL,
  `act_id` varchar(36) DEFAULT '',
  `pro_id` varchar(36) DEFAULT '',
  `user_id` varchar(36) DEFAULT '',
  `frm_index` int(4) DEFAULT NULL,
  `frm_last` int(4) DEFAULT NULL,
  `frm_action` varchar(255) DEFAULT 'ROUTE',
  `frm_user_id` varchar(255) DEFAULT '',
  `frm_user_name` varchar(255) DEFAULT '',
  `frm_date` datetime DEFAULT NULL,
  `frm_comment` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpm_form_action_skey` (`sync_key`),
  KEY `idx_pmse_bpm_form_action_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpm_form_action_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpm_form_action_date_entered` (`date_entered`),
  KEY `idx_pmse_bpm_form_action_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpm_form_action_del_cas_id` (`cas_id`,`deleted`),
  KEY `idx_pmse_bpm_form_action_cas_id_frm_last` (`cas_id`,`frm_last`,`deleted`),
  KEY `idx_pmse_bpm_form_action_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpm_form_action_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpm_form_action_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpm_gateway_definition`
--

CREATE TABLE `pmse_bpm_gateway_definition` (
  `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,
  `prj_id` varchar(36) DEFAULT '',
  `pro_id` varchar(36) DEFAULT '',
  `execution_mode` varchar(10) DEFAULT 'DEFAULT',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpm_gateway_definition_skey` (`sync_key`),
  KEY `idx_pmse_bpm_gateway_definition_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpm_gateway_definition_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpm_gateway_definition_date_entered` (`date_entered`),
  KEY `idx_pmse_bpm_gateway_definition_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpm_gateway_definition_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpm_gateway_definition_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpm_gateway_definition_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpm_group`
--

CREATE TABLE `pmse_bpm_group` (
  `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,
  `grp_uid` varchar(36) DEFAULT '',
  `grp_parent_group` int(4) DEFAULT '0',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpm_group_skey` (`sync_key`),
  KEY `idx_pmse_bpm_group_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpm_group_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpm_group_date_entered` (`date_entered`),
  KEY `idx_pmse_bpm_group_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpm_group_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpm_group_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpm_group_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpm_group_user`
--

CREATE TABLE `pmse_bpm_group_user` (
  `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,
  `user_id` varchar(36) DEFAULT '',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpm_group_user_skey` (`sync_key`),
  KEY `idx_pmse_bpm_group_user_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpm_group_user_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpm_group_user_date_entered` (`date_entered`),
  KEY `idx_pmse_bpm_group_user_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpm_group_user_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpm_group_user_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpm_group_user_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpm_notes`
--

CREATE TABLE `pmse_bpm_notes` (
  `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,
  `cas_id` varchar(36) DEFAULT '',
  `cas_index` int(11) DEFAULT NULL,
  `not_user_id` varchar(40) DEFAULT '',
  `not_user_recipient_id` varchar(40) DEFAULT '',
  `not_type` varchar(32) DEFAULT 'GENERAL',
  `not_date` datetime DEFAULT NULL,
  `not_status` varchar(10) DEFAULT 'ACTIVE',
  `not_availability` varchar(32) DEFAULT '',
  `not_content` text,
  `not_recipients` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpm_notes_skey` (`sync_key`),
  KEY `idx_pmse_bpm_notes_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpm_notes_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpm_notes_date_entered` (`date_entered`),
  KEY `idx_pmse_bpm_notes_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpm_notes_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpm_notes_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpm_notes_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpm_process_definition`
--

CREATE TABLE `pmse_bpm_process_definition` (
  `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,
  `prj_id` varchar(36) DEFAULT '',
  `pro_module` varchar(255) DEFAULT '',
  `pro_status` varchar(255) DEFAULT '',
  `pro_locked_variables` text,
  `pro_terminate_variables` text,
  `execution_mode` varchar(10) DEFAULT 'SYNC',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpm_process_definition_skey` (`sync_key`),
  KEY `idx_pmse_bpm_process_definition_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpm_process_definition_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpm_process_definition_date_entered` (`date_entered`),
  KEY `idx_pmse_bpm_process_definition_name_del` (`name`,`deleted`),
  KEY `idx_pd_prj_id` (`prj_id`),
  KEY `idx_pd_pro_status` (`pro_status`),
  KEY `idx_pmse_bpm_process_definition_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpm_process_definition_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpm_process_definition_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpm_related_dependency`
--

CREATE TABLE `pmse_bpm_related_dependency` (
  `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,
  `evn_id` varchar(36) DEFAULT '',
  `evn_uid` varchar(36) DEFAULT '',
  `evn_marker` varchar(36) DEFAULT '',
  `evn_is_interrupting` varchar(36) DEFAULT '',
  `evn_attached_to` varchar(36) DEFAULT '',
  `evn_cancel_activity` varchar(36) DEFAULT '',
  `evn_activity_ref` varchar(36) DEFAULT '',
  `evn_wait_for_completion` varchar(36) DEFAULT '',
  `evn_error_name` varchar(36) DEFAULT '',
  `evn_error_code` varchar(36) DEFAULT '',
  `evn_escalation_name` varchar(36) DEFAULT '',
  `evn_escalation_code` varchar(36) DEFAULT '',
  `evn_condition` varchar(36) DEFAULT '',
  `evn_message` varchar(36) DEFAULT '',
  `evn_operation_name` varchar(36) DEFAULT '',
  `evn_operation_implementation` varchar(36) DEFAULT '',
  `evn_time_date` varchar(36) DEFAULT '',
  `evn_time_cycle` varchar(36) DEFAULT '',
  `evn_time_duration` varchar(36) DEFAULT '',
  `evn_behavior` varchar(36) DEFAULT '',
  `evn_status` varchar(36) DEFAULT '',
  `evn_type` varchar(36) DEFAULT '',
  `evn_module` varchar(36) DEFAULT '',
  `evn_criteria` text,
  `evn_params` text,
  `evn_script` text,
  `prj_id` varchar(36) DEFAULT '',
  `pro_id` varchar(36) DEFAULT '',
  `pro_module` varchar(36) DEFAULT '',
  `pro_status` varchar(36) DEFAULT '',
  `pro_locked_variables` text,
  `pro_terminate_variables` text,
  `rel_element_id` varchar(40) DEFAULT '',
  `rel_element_type` varchar(32) DEFAULT '',
  `rel_process_module` varchar(32) DEFAULT '',
  `rel_element_module` varchar(32) DEFAULT '',
  `rel_element_relationship` varchar(255) DEFAULT '',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpm_related_dependency_skey` (`sync_key`),
  KEY `idx_pmse_bpm_related_dependency_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpm_related_dependency_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpm_related_dependency_date_entered` (`date_entered`),
  KEY `idx_pmse_bpm_related_dependency_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpm_related_dependency_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_prostatus_evntype_evnmodule_evn_behavior` (`pro_status`,`evn_type`,`evn_module`,`evn_behavior`),
  KEY `idx_pmse_bpm_related_dependency_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpm_related_dependency_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpm_thread`
--

CREATE TABLE `pmse_bpm_thread` (
  `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,
  `cas_id` int(11) DEFAULT '0',
  `cas_thread_index` int(4) DEFAULT '0',
  `cas_thread_parent` int(4) DEFAULT '0',
  `cas_thread_status` varchar(32) DEFAULT 'OPEN',
  `cas_flow_index` int(4) DEFAULT '0',
  `cas_thread_tokens` int(4) DEFAULT '0',
  `cas_thread_passes` int(4) DEFAULT '0',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpm_thread_skey` (`sync_key`),
  KEY `idx_pmse_bpm_thread_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpm_thread_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpm_thread_date_entered` (`date_entered`),
  KEY `idx_pmse_bpm_thread_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpm_thread_del_cas_id` (`cas_id`,`deleted`),
  KEY `idx_pmse_bpm_thread_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpm_thread_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpm_thread_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpmn_activity`
--

CREATE TABLE `pmse_bpmn_activity` (
  `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,
  `act_uid` varchar(36) DEFAULT '',
  `prj_id` varchar(36) DEFAULT '',
  `pro_id` varchar(36) DEFAULT '',
  `act_type` varchar(30) DEFAULT 'TASK',
  `act_is_for_compensation` int(4) DEFAULT '0',
  `act_start_quantity` int(4) DEFAULT '1',
  `act_completion_quantity` int(4) DEFAULT '1',
  `act_task_type` varchar(20) DEFAULT 'EMPTY',
  `act_implementation` text,
  `act_instantiate` int(4) DEFAULT '0',
  `act_script_type` varchar(255) DEFAULT '',
  `act_script` text,
  `act_loop_type` varchar(20) DEFAULT 'NONE',
  `act_test_before` int(4) DEFAULT '0',
  `act_loop_maximum` int(4) DEFAULT '0',
  `act_loop_condition` varchar(100) DEFAULT '',
  `act_loop_cardinality` int(4) DEFAULT '0',
  `act_loop_behavior` varchar(20) DEFAULT 'NONE',
  `act_is_adhoc` int(4) DEFAULT '0',
  `act_is_collapsed` int(4) DEFAULT '1',
  `act_completion_condition` varchar(255) DEFAULT '',
  `act_ordering` varchar(20) DEFAULT 'PARALLEL',
  `act_cancel_remaining_instances` int(4) DEFAULT '1',
  `act_protocol` varchar(255) DEFAULT '',
  `act_method` varchar(255) DEFAULT '',
  `act_is_global` int(4) DEFAULT '0',
  `act_referer` int(4) DEFAULT NULL,
  `act_default_flow` int(4) DEFAULT NULL,
  `act_master_diagram` int(4) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpmn_activity_skey` (`sync_key`),
  KEY `idx_pmse_bpmn_activity_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpmn_activity_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpmn_activity_date_entered` (`date_entered`),
  KEY `idx_pmse_bpmn_activity_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpmn_activity_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpmn_activity_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpmn_activity_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpmn_artifact`
--

CREATE TABLE `pmse_bpmn_artifact` (
  `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,
  `art_uid` varchar(36) DEFAULT '',
  `prj_id` varchar(36) DEFAULT '',
  `pro_id` varchar(36) DEFAULT '',
  `art_type` varchar(15) DEFAULT '',
  `art_category_ref` varchar(32) DEFAULT '',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpmn_artifact_skey` (`sync_key`),
  KEY `idx_pmse_bpmn_artifact_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpmn_artifact_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpmn_artifact_date_entered` (`date_entered`),
  KEY `idx_pmse_bpmn_artifact_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpmn_artifact_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpmn_artifact_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpmn_artifact_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpmn_bound`
--

CREATE TABLE `pmse_bpmn_bound` (
  `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,
  `bou_uid` varchar(36) DEFAULT '',
  `prj_id` varchar(36) DEFAULT '',
  `dia_id` varchar(36) DEFAULT '',
  `element_id` varchar(36) DEFAULT '',
  `bou_element` varchar(36) DEFAULT '',
  `bou_element_type` varchar(32) DEFAULT '',
  `bou_x` int(4) DEFAULT '0',
  `bou_y` int(4) DEFAULT '0',
  `bou_width` int(4) DEFAULT '0',
  `bou_height` int(4) DEFAULT '0',
  `bou_rel_position` int(4) DEFAULT '0',
  `bou_size_identical` int(4) DEFAULT '0',
  `bou_container` varchar(30) DEFAULT '',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpmn_bound_skey` (`sync_key`),
  KEY `idx_pmse_bpmn_bound_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpmn_bound_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpmn_bound_date_entered` (`date_entered`),
  KEY `idx_pmse_bpmn_bound_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpmn_bound_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpmn_bound_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpmn_bound_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpmn_data`
--

CREATE TABLE `pmse_bpmn_data` (
  `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,
  `dat_uid` varchar(36) DEFAULT '',
  `prj_id` varchar(36) DEFAULT '',
  `pro_id` varchar(36) DEFAULT '',
  `dat_type` varchar(20) DEFAULT '',
  `dat_is_collection` int(4) DEFAULT '0',
  `dat_item_kind` varchar(20) DEFAULT 'INFORMATION',
  `dat_capacity` int(4) DEFAULT '0',
  `dat_is_unlimited` int(4) DEFAULT '0',
  `dat_state` varchar(255) DEFAULT '',
  `dat_is_global` int(4) DEFAULT '0',
  `dat_object_ref` int(4) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpmn_data_skey` (`sync_key`),
  KEY `idx_pmse_bpmn_data_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpmn_data_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpmn_data_date_entered` (`date_entered`),
  KEY `idx_pmse_bpmn_data_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpmn_data_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpmn_data_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpmn_data_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpmn_diagram`
--

CREATE TABLE `pmse_bpmn_diagram` (
  `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,
  `dia_uid` varchar(36) DEFAULT '',
  `prj_id` varchar(36) DEFAULT '',
  `dia_is_closable` int(4) DEFAULT '0',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpmn_diagram_skey` (`sync_key`),
  KEY `idx_pmse_bpmn_diagram_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpmn_diagram_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpmn_diagram_date_entered` (`date_entered`),
  KEY `idx_pmse_bpmn_diagram_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpmn_diagram_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpmn_diagram_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpmn_diagram_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpmn_documentation`
--

CREATE TABLE `pmse_bpmn_documentation` (
  `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,
  `doc_uid` varchar(36) DEFAULT '',
  `prj_id` varchar(36) DEFAULT '',
  `doc_element` varchar(36) DEFAULT '',
  `doc_element_type` varchar(45) DEFAULT '',
  `doc_documentation` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpmn_documentation_skey` (`sync_key`),
  KEY `idx_pmse_bpmn_documentation_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpmn_documentation_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpmn_documentation_date_entered` (`date_entered`),
  KEY `idx_pmse_bpmn_documentation_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpmn_documentation_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpmn_documentation_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpmn_documentation_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpmn_event`
--

CREATE TABLE `pmse_bpmn_event` (
  `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,
  `evn_uid` varchar(36) DEFAULT '',
  `prj_id` varchar(36) DEFAULT '',
  `pro_id` varchar(36) DEFAULT '',
  `evn_type` varchar(30) DEFAULT '',
  `evn_marker` varchar(30) DEFAULT 'EMPTY',
  `evn_is_interrupting` int(4) DEFAULT '1',
  `evn_attached_to` int(4) DEFAULT NULL,
  `evn_cancel_activity` int(4) DEFAULT '0',
  `evn_activity_ref` int(4) DEFAULT NULL,
  `evn_wait_for_completion` int(4) DEFAULT '1',
  `evn_error_name` varchar(255) DEFAULT '',
  `evn_error_code` varchar(255) DEFAULT '',
  `evn_escalation_name` varchar(255) DEFAULT '',
  `evn_escalation_code` varchar(255) DEFAULT '',
  `evn_condition` varchar(255) DEFAULT '',
  `evn_message` text,
  `evn_operation_name` varchar(255) DEFAULT '',
  `evn_operation_implementation` varchar(255) DEFAULT '',
  `evn_time_date` varchar(255) DEFAULT '',
  `evn_time_cycle` varchar(255) DEFAULT '',
  `evn_time_duration` varchar(255) DEFAULT '',
  `evn_behavior` varchar(20) DEFAULT 'CATCH',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpmn_event_skey` (`sync_key`),
  KEY `idx_pmse_bpmn_event_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpmn_event_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpmn_event_date_entered` (`date_entered`),
  KEY `idx_pmse_bpmn_event_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpmn_event_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpmn_event_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpmn_event_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpmn_extension`
--

CREATE TABLE `pmse_bpmn_extension` (
  `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,
  `ext_uid` varchar(36) DEFAULT '',
  `prj_id` varchar(36) DEFAULT '',
  `ext_element` varchar(36) DEFAULT '',
  `ext_element_type` varchar(45) DEFAULT '',
  `ext_extension` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpmn_extension_skey` (`sync_key`),
  KEY `idx_pmse_bpmn_extension_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpmn_extension_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpmn_extension_date_entered` (`date_entered`),
  KEY `idx_pmse_bpmn_extension_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpmn_extension_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpmn_extension_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpmn_extension_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpmn_flow`
--

CREATE TABLE `pmse_bpmn_flow` (
  `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,
  `flo_uid` varchar(36) DEFAULT '',
  `prj_id` varchar(36) DEFAULT '',
  `dia_id` varchar(36) DEFAULT '',
  `flo_type` varchar(20) DEFAULT '',
  `flo_element_origin` varchar(36) DEFAULT '',
  `flo_element_origin_type` varchar(32) DEFAULT '',
  `flo_element_origin_port` int(4) DEFAULT '0',
  `flo_element_dest` varchar(36) DEFAULT '',
  `flo_element_dest_type` varchar(32) DEFAULT '',
  `flo_element_dest_port` int(4) DEFAULT '0',
  `flo_is_inmediate` int(4) DEFAULT NULL,
  `flo_condition` text,
  `flo_eval_priority` int(4) DEFAULT '0',
  `flo_x1` int(4) DEFAULT '0',
  `flo_y1` int(4) DEFAULT '0',
  `flo_x2` int(4) DEFAULT '0',
  `flo_y2` int(4) DEFAULT '0',
  `flo_state` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpmn_flow_skey` (`sync_key`),
  KEY `idx_pmse_bpmn_flow_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpmn_flow_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpmn_flow_date_entered` (`date_entered`),
  KEY `idx_pmse_bpmn_flow_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpmn_flow_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpmn_flow_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpmn_flow_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpmn_gateway`
--

CREATE TABLE `pmse_bpmn_gateway` (
  `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,
  `gat_uid` varchar(36) DEFAULT '',
  `prj_id` varchar(36) DEFAULT '',
  `pro_id` varchar(36) DEFAULT '',
  `gat_type` varchar(30) DEFAULT '',
  `gat_direction` varchar(30) DEFAULT 'UNSPECIFIED',
  `gat_instantiate` int(4) DEFAULT '0',
  `gat_event_gateway_type` varchar(20) DEFAULT 'NONE',
  `gat_activation_count` int(4) DEFAULT '0',
  `gat_waiting_for_start` int(4) DEFAULT '1',
  `gat_default_flow` varchar(36) DEFAULT '',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpmn_gateway_skey` (`sync_key`),
  KEY `idx_pmse_bpmn_gateway_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpmn_gateway_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpmn_gateway_date_entered` (`date_entered`),
  KEY `idx_pmse_bpmn_gateway_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpmn_gateway_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpmn_gateway_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpmn_gateway_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpmn_lane`
--

CREATE TABLE `pmse_bpmn_lane` (
  `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,
  `lan_uid` varchar(36) DEFAULT '',
  `prj_id` varchar(36) DEFAULT '',
  `lns_id` varchar(36) DEFAULT '',
  `lan_child_laneset` varchar(36) DEFAULT '',
  `lan_is_horizontal` int(4) DEFAULT '1',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpmn_lane_skey` (`sync_key`),
  KEY `idx_pmse_bpmn_lane_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpmn_lane_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpmn_lane_date_entered` (`date_entered`),
  KEY `idx_pmse_bpmn_lane_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpmn_lane_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpmn_lane_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpmn_lane_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpmn_laneset`
--

CREATE TABLE `pmse_bpmn_laneset` (
  `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,
  `lns_uid` varchar(36) DEFAULT '',
  `prj_id` varchar(36) DEFAULT '',
  `pro_id` varchar(36) DEFAULT '',
  `lns_parent_lane` varchar(36) DEFAULT '',
  `lns_is_horizontal` int(4) DEFAULT '1',
  `lns_state` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpmn_laneset_skey` (`sync_key`),
  KEY `idx_pmse_bpmn_laneset_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpmn_laneset_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpmn_laneset_date_entered` (`date_entered`),
  KEY `idx_pmse_bpmn_laneset_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpmn_laneset_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpmn_laneset_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpmn_laneset_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpmn_participant`
--

CREATE TABLE `pmse_bpmn_participant` (
  `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,
  `par_uid` varchar(36) DEFAULT '',
  `prj_id` varchar(36) DEFAULT '',
  `pro_id` varchar(36) DEFAULT '',
  `lns_id` varchar(36) DEFAULT '',
  `par_minimum` int(4) DEFAULT '0',
  `par_maximum` int(4) DEFAULT '1',
  `par_num_participants` int(4) DEFAULT '1',
  `par_is_horizontal` int(4) DEFAULT '1',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpmn_participant_skey` (`sync_key`),
  KEY `idx_pmse_bpmn_participant_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpmn_participant_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpmn_participant_date_entered` (`date_entered`),
  KEY `idx_pmse_bpmn_participant_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpmn_participant_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpmn_participant_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpmn_participant_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_bpmn_process`
--

CREATE TABLE `pmse_bpmn_process` (
  `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,
  `pro_uid` varchar(36) DEFAULT '',
  `prj_id` varchar(36) DEFAULT '',
  `dia_id` varchar(36) DEFAULT '',
  `pro_type` varchar(10) DEFAULT 'NONE',
  `pro_is_executable` int(4) DEFAULT '0',
  `pro_is_closed` int(4) DEFAULT '0',
  `pro_is_subprocess` int(4) DEFAULT '0',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_bpmn_process_skey` (`sync_key`),
  KEY `idx_pmse_bpmn_process_date_modfied` (`date_modified`),
  KEY `idx_pmse_bpmn_process_id_del` (`id`,`deleted`),
  KEY `idx_pmse_bpmn_process_date_entered` (`date_entered`),
  KEY `idx_pmse_bpmn_process_name_del` (`name`,`deleted`),
  KEY `idx_pmse_bpmn_process_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_bpmn_process_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_bpmn_process_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_business_rules`
--

CREATE TABLE `pmse_business_rules` (
  `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,
  `rst_uid` varchar(36) DEFAULT NULL,
  `rst_type` varchar(100) DEFAULT 'single',
  `rst_definition` text,
  `rst_editable` int(4) DEFAULT '0',
  `rst_source` varchar(255) DEFAULT NULL,
  `rst_source_definition` longtext,
  `rst_module` varchar(100) DEFAULT NULL,
  `rst_filename` varchar(255) DEFAULT NULL,
  `rst_create_date` datetime DEFAULT NULL,
  `rst_update_date` datetime DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_business_rules_skey` (`sync_key`),
  KEY `idx_pmse_business_rules_date_modfied` (`date_modified`),
  KEY `idx_pmse_business_rules_id_del` (`id`,`deleted`),
  KEY `idx_pmse_business_rules_date_entered` (`date_entered`),
  KEY `idx_pmse_business_rules_name_del` (`name`,`deleted`),
  KEY `idx_pmse_business_rules_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_business_rules_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_pmse_business_rules_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_pmse_business_rules_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_business_rules_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_email_message`
--

CREATE TABLE `pmse_email_message` (
  `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',
  `from_addr` varchar(255) DEFAULT NULL,
  `from_name` varchar(255) DEFAULT NULL,
  `to_addrs` text,
  `cc_addrs` text,
  `bcc_addrs` text,
  `body` longtext,
  `body_html` longtext,
  `subject` varchar(255) DEFAULT NULL,
  `flow_id` char(36) DEFAULT NULL,
  `reply_to_addr` varchar(255) DEFAULT NULL,
  `reply_to_name` varchar(255) DEFAULT NULL,
  `outbound_email_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_email_message_skey` (`sync_key`),
  KEY `idx_pmse_email_message_date_modfied` (`date_modified`),
  KEY `idx_pmse_email_message_id_del` (`id`,`deleted`),
  KEY `idx_pmse_email_message_date_entered` (`date_entered`),
  KEY `idx_pmse_email_message_name_del` (`name`,`deleted`),
  KEY `idx_pmse_email_message_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_email_message_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_emails_templates`
--

CREATE TABLE `pmse_emails_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,
  `assigned_user_id` char(36) DEFAULT NULL,
  `from_name` varchar(255) DEFAULT NULL,
  `from_address` varchar(255) DEFAULT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `body` text,
  `body_html` text,
  `type` varchar(255) DEFAULT NULL,
  `base_module` varchar(100) DEFAULT NULL,
  `text_only` tinyint(4) DEFAULT NULL,
  `published` varchar(3) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_emails_templates_skey` (`sync_key`),
  KEY `idx_pmse_emails_templates_date_modfied` (`date_modified`),
  KEY `idx_pmse_emails_templates_id_del` (`id`,`deleted`),
  KEY `idx_pmse_emails_templates_date_entered` (`date_entered`),
  KEY `idx_pmse_emails_templates_name_del` (`name`,`deleted`),
  KEY `idx_pmse_emails_templates_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_emails_templates_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_pmse_emails_templates_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_pmse_emails_templates_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_emails_templates_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_inbox`
--

CREATE TABLE `pmse_inbox` (
  `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,
  `cas_id` int(255) NOT NULL AUTO_INCREMENT,
  `cas_parent` int(255) DEFAULT NULL,
  `cas_status` varchar(32) DEFAULT 'IN PROGRESS',
  `pro_id` varchar(36) DEFAULT NULL,
  `cas_title` varchar(255) DEFAULT NULL,
  `pro_title` varchar(255) DEFAULT NULL,
  `cas_custom_status` varchar(32) DEFAULT NULL,
  `cas_init_user` varchar(36) DEFAULT NULL,
  `cas_create_date` datetime DEFAULT NULL,
  `cas_update_date` datetime DEFAULT NULL,
  `cas_finish_date` datetime DEFAULT NULL,
  `cas_pin` varchar(10) DEFAULT '0000',
  `cas_assigned_status` varchar(12) DEFAULT 'UNASSIGNED',
  `cas_module` varchar(100) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_inbox_skey` (`sync_key`),
  KEY `idx_pmse_inbox_date_modfied` (`date_modified`),
  KEY `idx_pmse_inbox_id_del` (`id`,`deleted`),
  KEY `idx_pmse_inbox_date_entered` (`date_entered`),
  KEY `idx_pmse_inbox_case_id` (`cas_id`),
  KEY `idx_pmse_inbox_name_del` (`name`,`deleted`),
  KEY `idx_pmse_inbox_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_inbox_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_pmse_inbox_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_pmse_inbox_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_inbox_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_proid_status_del` (`pro_id`,`cas_status`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=2231981 DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_inbox_backup`
--

CREATE TABLE `pmse_inbox_backup` (
  `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,
  `cas_id` int(255) NOT NULL AUTO_INCREMENT,
  `cas_parent` int(255) DEFAULT NULL,
  `cas_status` varchar(32) DEFAULT 'IN PROGRESS',
  `pro_id` varchar(36) DEFAULT NULL,
  `cas_title` varchar(255) DEFAULT NULL,
  `pro_title` varchar(255) DEFAULT NULL,
  `cas_custom_status` varchar(32) DEFAULT NULL,
  `cas_init_user` varchar(36) DEFAULT NULL,
  `cas_create_date` datetime DEFAULT NULL,
  `cas_update_date` datetime DEFAULT NULL,
  `cas_finish_date` datetime DEFAULT NULL,
  `cas_pin` varchar(10) DEFAULT '0000',
  `cas_assigned_status` varchar(12) DEFAULT 'UNASSIGNED',
  `cas_module` varchar(100) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_pmse_inbox_date_modfied` (`date_modified`),
  KEY `idx_pmse_inbox_id_del` (`id`,`deleted`),
  KEY `idx_pmse_inbox_date_entered` (`date_entered`),
  KEY `idx_pmse_inbox_case_id` (`cas_id`),
  KEY `idx_pmse_inbox_name_del` (`name`,`deleted`),
  KEY `idx_pmse_inbox_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_inbox_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_pmse_inbox_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_pmse_inbox_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_inbox_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1640345 DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `pmse_project`
--

CREATE TABLE `pmse_project` (
  `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,
  `prj_uid` varchar(36) DEFAULT NULL,
  `prj_target_namespace` varchar(255) DEFAULT NULL,
  `prj_expression_language` varchar(255) DEFAULT NULL,
  `prj_type_language` varchar(255) DEFAULT NULL,
  `prj_exporter` varchar(255) DEFAULT NULL,
  `prj_exporter_version` varchar(255) DEFAULT NULL,
  `prj_author` varchar(255) DEFAULT NULL,
  `prj_author_version` varchar(255) DEFAULT NULL,
  `prj_original_source` varchar(255) DEFAULT NULL,
  `prj_status` varchar(10) DEFAULT 'INACTIVE',
  `prj_module` varchar(100) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `prj_run_order` int(11) DEFAULT '1',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_pmse_project_skey` (`sync_key`),
  KEY `idx_pmse_project_date_modfied` (`date_modified`),
  KEY `idx_pmse_project_id_del` (`id`,`deleted`),
  KEY `idx_pmse_project_date_entered` (`date_entered`),
  KEY `idx_pmse_project_name_del` (`name`,`deleted`),
  KEY `idx_pmse_project_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_pmse_project_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_pmse_project_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_pmse_project_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_pmse_project_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `product_bundle_note`
--

CREATE TABLE `product_bundle_note` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `bundle_id` char(36) DEFAULT NULL,
  `note_id` char(36) DEFAULT NULL,
  `note_index` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_pbn_bundle` (`bundle_id`),
  KEY `idx_pbn_pb_nb` (`note_id`,`bundle_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `product_bundle_notes`
--

CREATE TABLE `product_bundle_notes` (
  `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,
  `description` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `product_bundle_product`
--

CREATE TABLE `product_bundle_product` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `bundle_id` char(36) DEFAULT NULL,
  `product_id` char(36) DEFAULT NULL,
  `product_index` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_pbp_bundle` (`bundle_id`),
  KEY `idx_pbp_bq` (`product_id`,`bundle_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `product_bundle_quote`
--

CREATE TABLE `product_bundle_quote` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `bundle_id` char(36) DEFAULT NULL,
  `quote_id` char(36) DEFAULT NULL,
  `bundle_index` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_pbq_bundle` (`bundle_id`),
  KEY `idx_pbq_bq` (`quote_id`,`bundle_id`),
  KEY `bundle_index_idx` (`bundle_index`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `product_bundles`
--

CREATE TABLE `product_bundles` (
  `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(255) DEFAULT NULL,
  `bundle_stage` varchar(255) DEFAULT NULL,
  `description` text,
  `tax` decimal(26,6) DEFAULT NULL,
  `tax_usdollar` decimal(26,6) DEFAULT NULL,
  `total` decimal(26,6) DEFAULT NULL,
  `total_usdollar` decimal(26,6) DEFAULT NULL,
  `subtotal_usdollar` decimal(26,6) DEFAULT NULL,
  `shipping_usdollar` decimal(26,6) DEFAULT NULL,
  `deal_tot` decimal(26,6) DEFAULT NULL,
  `deal_tot_usdollar` decimal(26,6) DEFAULT NULL,
  `new_sub` decimal(26,6) DEFAULT NULL,
  `new_sub_usdollar` decimal(26,6) DEFAULT NULL,
  `subtotal` decimal(26,6) DEFAULT NULL,
  `shipping` decimal(26,6) DEFAULT NULL,
  `currency_id` char(36) DEFAULT '-99',
  `base_rate` decimal(26,6) DEFAULT NULL,
  `taxrate_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `taxable_subtotal` decimal(26,6) DEFAULT NULL,
  `default_group` tinyint(1) DEFAULT '0',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_product_bundles_skey` (`sync_key`),
  KEY `idx_products_bundles` (`name`,`deleted`),
  KEY `idx_product_bundles_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_product_bundles_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `product_categories`
--

CREATE TABLE `product_categories` (
  `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(255) DEFAULT NULL,
  `list_order` int(4) DEFAULT NULL,
  `description` text,
  `assigned_user_id` char(36) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_product_categories_skey` (`sync_key`),
  KEY `idx_productcategories` (`name`,`deleted`),
  KEY `idx_product_categories_date_modfied` (`date_modified`),
  KEY `idx_product_categories_id_del` (`id`,`deleted`),
  KEY `idx_product_categories_date_entered` (`date_entered`),
  KEY `idx_product_categories_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_producttemplate_id_parent_name` (`id`,`parent_id`,`name`,`deleted`),
  KEY `idx_product_categories_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_product_categories_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_id_name_list_order` (`id`,`name`,`list_order`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `product_definition`
--

CREATE TABLE `product_definition` (
  `data` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `product_product`
--

CREATE TABLE `product_product` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `parent_id` char(36) DEFAULT NULL,
  `child_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_pp_parent` (`parent_id`),
  KEY `idx_pp_child` (`child_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `product_templates`
--

CREATE TABLE `product_templates` (
  `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,
  `type_id` char(36) DEFAULT NULL,
  `manufacturer_id` char(36) DEFAULT NULL,
  `category_id` char(36) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `mft_part_num` varchar(50) DEFAULT NULL,
  `vendor_part_num` varchar(50) DEFAULT NULL,
  `date_cost_price` date DEFAULT NULL,
  `cost_price` decimal(26,6) DEFAULT NULL,
  `discount_price` decimal(26,6) DEFAULT NULL,
  `list_price` decimal(26,6) DEFAULT NULL,
  `cost_usdollar` decimal(26,6) DEFAULT NULL,
  `discount_usdollar` decimal(26,6) DEFAULT NULL,
  `list_usdollar` decimal(26,6) DEFAULT NULL,
  `currency_id` char(36) DEFAULT '-99',
  `base_rate` decimal(26,6) DEFAULT NULL,
  `currency` varchar(255) DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL,
  `tax_class` varchar(100) DEFAULT NULL,
  `date_available` date DEFAULT NULL,
  `website` varchar(255) DEFAULT NULL,
  `weight` decimal(12,2) DEFAULT NULL,
  `qty_in_stock` int(5) DEFAULT NULL,
  `description` text,
  `support_name` varchar(50) DEFAULT NULL,
  `support_description` varchar(255) DEFAULT NULL,
  `support_contact` varchar(50) DEFAULT NULL,
  `support_term` varchar(100) DEFAULT NULL,
  `pricing_formula` varchar(100) DEFAULT NULL,
  `pricing_factor` decimal(8,2) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `service_duration_value` int(5) DEFAULT NULL,
  `service_duration_unit` varchar(50) DEFAULT NULL,
  `renewable` tinyint(1) DEFAULT '0',
  `service` 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,
  `lock_duration` tinyint(1) DEFAULT '0',
  `sync_key` varchar(100) DEFAULT NULL,
  `active_status` varchar(100) DEFAULT 'Active',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_product_templates_skey` (`sync_key`),
  KEY `idx_product_template` (`name`,`deleted`),
  KEY `idx_producttemplate_qty_in_stock` (`qty_in_stock`),
  KEY `idx_product_templates_date_modfied` (`date_modified`),
  KEY `idx_product_templates_id_del` (`id`,`deleted`),
  KEY `idx_product_templates_date_entered` (`date_entered`),
  KEY `idx_product_templates_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_product_templates_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_product_templates_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_product_templates_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_product_templates_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_producttemplate_category` (`category_id`,`active_status`,`deleted`),
  KEY `idx_id_name` (`id`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `product_templates_audit`
--

CREATE TABLE `product_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_product_templates_parent_id` (`parent_id`),
  KEY `idx_product_templates_audit_event_id` (`event_id`),
  KEY `idx_product_templates_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_product_templates_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `product_types`
--

CREATE TABLE `product_types` (
  `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(255) DEFAULT NULL,
  `description` text,
  `list_order` int(4) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_product_types_skey` (`sync_key`),
  KEY `idx_producttypes` (`name`,`deleted`),
  KEY `idx_product_types_date_modfied` (`date_modified`),
  KEY `idx_product_types_id_del` (`id`,`deleted`),
  KEY `idx_product_types_date_entered` (`date_entered`),
  KEY `idx_product_types_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_product_types_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `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,
  `revenuelineitem_id` char(36) DEFAULT NULL,
  `product_template_id` char(36) DEFAULT NULL,
  `account_id` char(36) DEFAULT NULL,
  `contact_id` char(36) DEFAULT NULL,
  `total_amount` decimal(26,6) DEFAULT '0.000000',
  `type_id` char(36) DEFAULT NULL,
  `quote_id` char(36) DEFAULT NULL,
  `manufacturer_id` char(36) DEFAULT NULL,
  `category_id` char(36) DEFAULT NULL,
  `mft_part_num` varchar(50) DEFAULT NULL,
  `vendor_part_num` varchar(50) DEFAULT NULL,
  `date_purchased` date DEFAULT NULL,
  `cost_price` decimal(26,6) DEFAULT NULL,
  `discount_price` decimal(26,6) DEFAULT NULL,
  `discount_amount` decimal(26,6) DEFAULT NULL,
  `discount_rate_percent` decimal(26,2) DEFAULT NULL,
  `discount_amount_usdollar` decimal(26,6) DEFAULT NULL,
  `discount_select` tinyint(1) DEFAULT NULL,
  `deal_calc` decimal(26,6) DEFAULT NULL,
  `deal_calc_usdollar` decimal(26,6) DEFAULT NULL,
  `list_price` decimal(26,6) DEFAULT NULL,
  `cost_usdollar` decimal(26,6) DEFAULT NULL,
  `discount_usdollar` decimal(26,6) DEFAULT NULL,
  `list_usdollar` decimal(26,6) DEFAULT NULL,
  `currency_id` char(36) DEFAULT '-99',
  `base_rate` decimal(26,6) DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL,
  `tax_class` varchar(100) DEFAULT NULL,
  `website` varchar(255) DEFAULT NULL,
  `weight` decimal(12,2) DEFAULT NULL,
  `quantity` decimal(12,2) DEFAULT '1.00',
  `support_name` varchar(50) DEFAULT NULL,
  `support_description` varchar(255) DEFAULT NULL,
  `support_contact` varchar(50) DEFAULT NULL,
  `support_term` varchar(100) DEFAULT NULL,
  `date_support_expires` date DEFAULT NULL,
  `date_support_starts` date DEFAULT NULL,
  `pricing_formula` varchar(100) DEFAULT NULL,
  `pricing_factor` int(4) DEFAULT NULL,
  `serial_number` varchar(50) DEFAULT NULL,
  `asset_number` varchar(50) DEFAULT NULL,
  `book_value` decimal(26,6) DEFAULT NULL,
  `book_value_usdollar` decimal(26,6) DEFAULT NULL,
  `book_value_date` date DEFAULT NULL,
  `date_closed` date DEFAULT NULL,
  `date_closed_timestamp` bigint(20) unsigned DEFAULT NULL,
  `next_step` varchar(100) DEFAULT NULL,
  `campaign_id` char(36) DEFAULT NULL,
  `opportunity_id` char(36) DEFAULT NULL,
  `product_type` varchar(255) DEFAULT NULL,
  `subtotal` decimal(26,6) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `renewable` tinyint(1) DEFAULT '0',
  `service` tinyint(1) DEFAULT '0',
  `service_duration_value` int(5) DEFAULT NULL,
  `service_duration_unit` varchar(50) DEFAULT NULL,
  `service_end_date` date DEFAULT NULL,
  `service_start_date` date DEFAULT NULL,
  `lock_duration` tinyint(1) DEFAULT '0',
  `discount_amount_signed` decimal(26,6) DEFAULT '0.000000',
  `parent_rli_id` char(36) DEFAULT NULL,
  `add_on_to_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `catalog_service_duration_value` int(5) DEFAULT NULL,
  `catalog_service_duration_unit` varchar(50) DEFAULT NULL,
  `service_duration_multiplier` decimal(10,0) DEFAULT NULL,
  `renewal` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_products_skey` (`sync_key`),
  KEY `productsmod` (`date_modified`),
  KEY `idx_products` (`name`,`deleted`),
  KEY `idx_prod_user_dc_timestamp` (`id`,`assigned_user_id`,`date_closed_timestamp`),
  KEY `idx_product_quantity` (`quantity`),
  KEY `idx_products_id_del` (`id`,`deleted`),
  KEY `idx_products_date_entered` (`date_entered`),
  KEY `idx_product_contact` (`contact_id`),
  KEY `idx_product_account` (`account_id`),
  KEY `idx_product_opp` (`opportunity_id`),
  KEY `idx_product_quote` (`quote_id`),
  KEY `idx_product_rli` (`revenuelineitem_id`),
  KEY `idx_products_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_products_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_products_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_products_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_products_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_product_del_created_by_pt_id` (`deleted`,`created_by`,`product_template_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `products_audit`
--

CREATE TABLE `products_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_products_parent_id` (`parent_id`),
  KEY `idx_products_audit_event_id` (`event_id`),
  KEY `idx_products_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_products_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `project`
--

CREATE TABLE `project` (
  `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,
  `name` varchar(50) DEFAULT NULL,
  `description` text,
  `deleted` tinyint(1) DEFAULT '0',
  `estimated_start_date` date DEFAULT NULL,
  `estimated_end_date` date DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `priority` varchar(255) DEFAULT NULL,
  `is_template` tinyint(1) DEFAULT '0',
  `acl_team_set_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_project_name` (`name`),
  KEY `idx_project_estimated_start_date` (`estimated_start_date`),
  KEY `idx_project_estimated_end_date` (`estimated_end_date`),
  KEY `idx_project_status` (`status`),
  KEY `idx_project_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_project_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `project_resources`
--

CREATE TABLE `project_resources` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `project_id` char(36) DEFAULT NULL,
  `resource_id` char(36) DEFAULT NULL,
  `resource_type` varchar(20) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `project_task`
--

CREATE TABLE `project_task` (
  `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,
  `project_id` char(36) NOT NULL,
  `project_task_id` int(11) DEFAULT NULL,
  `name` varchar(50) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `description` text,
  `resource_id` text,
  `predecessors` text,
  `date_start` date DEFAULT NULL,
  `time_start` int(11) DEFAULT NULL,
  `time_finish` int(11) DEFAULT NULL,
  `date_finish` date DEFAULT NULL,
  `duration` int(11) DEFAULT NULL,
  `duration_unit` text,
  `actual_duration` int(11) DEFAULT NULL,
  `percent_complete` int(11) DEFAULT NULL,
  `date_due` date DEFAULT NULL,
  `time_due` time DEFAULT NULL,
  `parent_task_id` int(11) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `priority` varchar(255) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `milestone_flag` tinyint(1) DEFAULT NULL,
  `order_number` int(11) DEFAULT '1',
  `task_number` int(11) DEFAULT NULL,
  `estimated_effort` int(11) DEFAULT NULL,
  `actual_effort` int(11) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `utilization` int(11) DEFAULT '100',
  `acl_team_set_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_project_task_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_project_task_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `project_task_audit`
--

CREATE TABLE `project_task_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_project_task_parent_id` (`parent_id`),
  KEY `idx_project_task_audit_event_id` (`event_id`),
  KEY `idx_project_task_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_project_task_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `projects_accounts`
--

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

--
-- Table structure for table `projects_bugs`
--

CREATE TABLE `projects_bugs` (
  `id` char(36) NOT NULL,
  `bug_id` char(36) DEFAULT NULL,
  `project_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_proj_bug_bug` (`bug_id`),
  KEY `projects_bugs_alt` (`project_id`,`bug_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `projects_cases`
--

CREATE TABLE `projects_cases` (
  `id` char(36) NOT NULL,
  `case_id` char(36) DEFAULT NULL,
  `project_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_proj_case_case` (`case_id`),
  KEY `projects_cases_alt` (`project_id`,`case_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `projects_contacts`
--

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

--
-- Table structure for table `projects_opportunities`
--

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

--
-- Table structure for table `projects_products`
--

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

--
-- Table structure for table `projects_quotes`
--

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

--
-- Table structure for table `projects_revenue_line_items`
--

CREATE TABLE `projects_revenue_line_items` (
  `id` char(36) NOT NULL,
  `rli_id` char(36) DEFAULT NULL,
  `project_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_proj_rli_product` (`rli_id`),
  KEY `projects_rli_alt` (`project_id`,`rli_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `prospect_list_campaigns`
--

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

--
-- Table structure for table `prospect_lists`
--

CREATE TABLE `prospect_lists` (
  `assigned_user_id` char(36) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `list_type` varchar(100) 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 NULL,
  `description` text,
  `domain_name` varchar(255) DEFAULT NULL,
  `auto_updating` tinyint(1) DEFAULT '0',
  `acl_team_set_id` char(36) DEFAULT NULL,
  `mailchimp_list_name_c` varchar(255) DEFAULT NULL,
  `mailchimp_default_module_c` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_prospect_list_name` (`name`),
  KEY `idx_prospect_list_list_type` (`list_type`),
  KEY `idx_prospect_list_date_entered` (`date_entered`),
  KEY `idx_prospect_lists_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_prospect_lists_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_prospect_lists_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `prospect_lists_cstm`
--

CREATE TABLE `prospect_lists_cstm` (
  `id_c` char(36) NOT NULL,
  `auto_sync_reports_c` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `prospect_lists_prospects`
--

CREATE TABLE `prospect_lists_prospects` (
  `id` char(36) NOT NULL,
  `prospect_list_id` char(36) DEFAULT NULL,
  `related_id` char(36) DEFAULT NULL,
  `related_type` varchar(25) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_plp_rel_id` (`related_id`,`related_type`,`prospect_list_id`),
  KEY `idx_plp_pro_id` (`prospect_list_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `prospect_lists_reports`
--

CREATE TABLE `prospect_lists_reports` (
  `id` varchar(36) NOT NULL,
  `prospectlist_id` varchar(36) DEFAULT NULL,
  `report_id` varchar(36) DEFAULT NULL,
  `date_created` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `related_type` varchar(25) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `active_status` varchar(1) DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `idx_pros_con_proj` (`prospectlist_id`),
  KEY `idx_report_prosp` (`report_id`),
  KEY `prosp_rep_alt` (`prospectlist_id`,`report_id`,`related_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `prospectlists_reports_1_c`
--

CREATE TABLE `prospectlists_reports_1_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `prospectlists_reports_1pl_ida` varchar(36) DEFAULT NULL,
  `prospectlists_reports_1r_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `prospectlists_reports_1_alt` (`prospectlists_reports_1pl_ida`,`prospectlists_reports_1r_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `prospects`
--

CREATE TABLE `prospects` (
  `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,
  `tracker_key` int(11) NOT NULL AUTO_INCREMENT,
  `birthdate` date DEFAULT NULL,
  `lead_id` char(36) DEFAULT NULL,
  `account_name` varchar(150) DEFAULT NULL,
  `campaign_id` char(36) 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,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_prospects_skey` (`sync_key`),
  KEY `prospectsmod` (`date_modified`),
  KEY `prospect_auto_tracker_key` (`tracker_key`),
  KEY `idx_prospects_last_first` (`last_name`,`first_name`,`deleted`),
  KEY `idx_prospecs_del_last` (`last_name`,`deleted`),
  KEY `idx_prospects_id_del` (`id`,`deleted`),
  KEY `idx_prospect_title` (`title`),
  KEY `idx_prospect_date_entered` (`date_entered`),
  KEY `idx_prospects_first_last` (`first_name`,`last_name`,`deleted`),
  KEY `idx_prospects_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_prospects_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_prospects_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_prospects_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_prospects_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `prospects_audit`
--

CREATE TABLE `prospects_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_prospects_audit_event_id` (`event_id`),
  KEY `idx_prospects_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_prospects_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `prospects_dataprivacy`
--

CREATE TABLE `prospects_dataprivacy` (
  `id` char(36) NOT NULL,
  `prospect_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_prospect_dataprivacy_dataprivacy` (`dataprivacy_id`),
  KEY `idx_prospects_dataprivacy` (`prospect_id`,`dataprivacy_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `purchased_line_items`
--

CREATE TABLE `purchased_line_items` (
  `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',
  `annual_revenue` decimal(26,6) DEFAULT NULL,
  `book_value_usdollar` decimal(26,6) DEFAULT NULL,
  `cost_price` decimal(26,6) DEFAULT NULL,
  `cost_usdollar` decimal(26,6) DEFAULT NULL,
  `date_closed` date DEFAULT NULL,
  `date_closed_timestamp` bigint(20) unsigned DEFAULT NULL,
  `deal_calc` decimal(26,6) DEFAULT NULL,
  `deal_calc_usdollar` decimal(26,6) DEFAULT NULL,
  `discount_amount` decimal(26,6) DEFAULT '0.000000',
  `discount_amount_signed` decimal(26,6) DEFAULT '0.000000',
  `discount_amount_usdollar` decimal(26,6) DEFAULT NULL,
  `discount_price` decimal(26,6) DEFAULT NULL,
  `discount_select` tinyint(1) DEFAULT '0',
  `discount_usdollar` decimal(26,6) DEFAULT NULL,
  `list_usdollar` decimal(26,6) DEFAULT NULL,
  `mft_part_num` varchar(50) DEFAULT NULL,
  `revenue` decimal(26,6) DEFAULT NULL,
  `revenue_usdollar` decimal(26,6) DEFAULT NULL,
  `total_amount` decimal(26,6) DEFAULT NULL,
  `subtotal` decimal(26,6) DEFAULT NULL,
  `category_id` char(36) DEFAULT NULL,
  `manufacturer_id` char(36) DEFAULT NULL,
  `product_template_id` char(36) DEFAULT NULL,
  `lock_duration` tinyint(1) DEFAULT '0',
  `product_type_id` char(36) DEFAULT NULL,
  `purchase_id` char(36) DEFAULT NULL,
  `revenuelineitem_id` char(36) DEFAULT NULL,
  `renewal_opp_id` char(36) DEFAULT NULL,
  `account_id` char(36) DEFAULT NULL,
  `status` varchar(255) 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,
  `asset_number` varchar(50) DEFAULT NULL,
  `book_value` decimal(26,6) DEFAULT NULL,
  `book_value_date` date DEFAULT NULL,
  `date_purchased` date DEFAULT NULL,
  `date_support_expires` date DEFAULT NULL,
  `date_support_starts` date DEFAULT NULL,
  `list_price` decimal(26,6) DEFAULT NULL,
  `pricing_factor` int(4) DEFAULT NULL,
  `pricing_formula` varchar(100) DEFAULT NULL,
  `quantity` decimal(12,2) DEFAULT '1.00',
  `serial_number` varchar(50) DEFAULT NULL,
  `renewable` tinyint(1) DEFAULT '0',
  `service` tinyint(1) DEFAULT '0',
  `service_duration_value` int(5) DEFAULT NULL,
  `service_duration_unit` varchar(50) DEFAULT NULL,
  `catalog_service_duration_value` int(5) DEFAULT NULL,
  `catalog_service_duration_unit` varchar(50) DEFAULT NULL,
  `service_duration_multiplier` decimal(10,0) DEFAULT NULL,
  `service_end_date` date DEFAULT NULL,
  `service_start_date` date DEFAULT NULL,
  `support_contact` varchar(50) DEFAULT NULL,
  `support_description` varchar(255) DEFAULT NULL,
  `support_name` varchar(50) DEFAULT NULL,
  `support_term` varchar(100) DEFAULT NULL,
  `tax_class` varchar(100) DEFAULT 'Taxable',
  `vendor_part_num` varchar(50) DEFAULT NULL,
  `website` varchar(255) DEFAULT NULL,
  `weight` decimal(12,2) DEFAULT NULL,
  `renewal` tinyint(1) DEFAULT '0',
  `currency_id` char(36) DEFAULT '-99',
  `base_rate` decimal(26,6) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_purchased_line_items_skey` (`sync_key`),
  KEY `idx_purchased_line_items_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_purchased_line_items_id_del` (`id`,`deleted`),
  KEY `idx_purchased_line_items_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_purchased_line_items_name_del` (`name`,`deleted`),
  KEY `idx_purchased_line_items_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_purchased_line_items_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_purchased_line_items_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_purchaseid_del` (`purchase_id`,`deleted`),
  KEY `idx_pli_purchaseid_del` (`deleted`,`purchase_id`,`id`),
  KEY `idx_pli_dclose_del` (`deleted`,`date_closed`,`id`),
  KEY `idx_pli_dent_name_del` (`deleted`,`date_entered`,`name`,`id`),
  KEY `idx_pli_dclose_name_del` (`deleted`,`date_closed`,`name`,`id`),
  KEY `idx_pli_catid_del` (`deleted`,`category_id`,`id`),
  KEY `idx_pli_manid_del` (`deleted`,`manufacturer_id`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `purchased_line_items_audit`
--

CREATE TABLE `purchased_line_items_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_purchased_line_items_audit_event_id` (`event_id`),
  KEY `idx_purchased_line_items_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_purchased_line_items_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `purchases`
--

CREATE TABLE `purchases` (
  `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',
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `service` tinyint(1) DEFAULT '0',
  `total_revenue` decimal(26,6) DEFAULT NULL,
  `total_quantity` decimal(18,2) DEFAULT NULL,
  `pli_count` int(11) DEFAULT NULL,
  `renewable` tinyint(1) DEFAULT '0',
  `product_template_id` char(36) DEFAULT NULL,
  `account_id` char(36) DEFAULT NULL,
  `type_id` char(36) DEFAULT NULL,
  `category_id` char(36) 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,
  `currency_id` char(36) DEFAULT '-99',
  `base_rate` decimal(26,6) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_purchases_skey` (`sync_key`),
  KEY `idx_purchases_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_purchases_id_del` (`id`,`deleted`),
  KEY `idx_purchases_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_purchases_name_del` (`name`,`deleted`),
  KEY `idx_purchases_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_purchases_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_purchases_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `purchases_audit`
--

CREATE TABLE `purchases_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_purchases_audit_event_id` (`event_id`),
  KEY `idx_purchases_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_purchases_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `push_notifications`
--

CREATE TABLE `push_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',
  `is_sent` tinyint(1) DEFAULT '0',
  `notification_type` varchar(255) DEFAULT NULL,
  `parent_type` varchar(100) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `extra_data` text,
  `sync_key` varchar(100) DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_push_notifications_skey` (`sync_key`),
  KEY `idx_push_notifications_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_push_notifications_id_del` (`id`,`deleted`),
  KEY `idx_push_notifications_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_push_notifications_name_del` (`name`,`deleted`),
  KEY `idx_push_notifications_assigned_del` (`assigned_user_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Temporary view structure for view `qs_ECVs`
--

/*!50001 DROP VIEW IF EXISTS `qs_ECVs`*/;
/*!50001 CREATE VIEW `qs_ECVs` AS SELECT 
 1 AS `contact_id`,
 1 AS `name`,
 1 AS `date_entered`,
 1 AS `date_modified`,
 1 AS `description`,
 1 AS `deleted`,
 1 AS `modified_user_id`,
 1 AS `id`,
 1 AS `numeric_value_c`*/;

--
-- Temporary view structure for view `qs_contacts`
--

/*!50001 DROP VIEW IF EXISTS `qs_contacts`*/;
/*!50001 CREATE VIEW `qs_contacts` AS SELECT 
 1 AS `id`,
 1 AS `date_modified`,
 1 AS `created_by`,
 1 AS `description`,
 1 AS `age_float_c`,
 1 AS `age_months_c`,
 1 AS `facebook`,
 1 AS `twitter`,
 1 AS `googleplus`,
 1 AS `department`,
 1 AS `do_not_call`,
 1 AS `primary_address_city`,
 1 AS `primary_address_state`,
 1 AS `primary_address_postalcode`,
 1 AS `lead_source`,
 1 AS `birthdate`,
 1 AS `mailchimp_rating_c`,
 1 AS `income_current_c`,
 1 AS `income_current_growth_c`,
 1 AS `income_addl_contributions_c`,
 1 AS `income_retirement_desired_c`,
 1 AS `income_retirement_required_c`,
 1 AS `income_desired_p_c`,
 1 AS `income_required_p_c`,
 1 AS `age_retirement_c`,
 1 AS `age_death_c`,
 1 AS `income_expected_retirement_c`,
 1 AS `gender_c`,
 1 AS `segmentation_lifestage_c`,
 1 AS `segmentation_engagement_c`,
 1 AS `segmentation_situation_c`,
 1 AS `income_frequency_c`,
 1 AS `investment_risk_c`,
 1 AS `investor_c`,
 1 AS `simulation_engine_c`,
 1 AS `income_expected_retire_high_c`,
 1 AS `base_rate`,
 1 AS `home_ownership_c`,
 1 AS `income_addl_contrib_c`,
 1 AS `maritalstatus_c`,
 1 AS `income_type_c`,
 1 AS `lsw_type_c`,
 1 AS `per_salary_yearly_total_c`,
 1 AS `repeat_no_of_years_c`,
 1 AS `adnl_super_contributioions_c`,
 1 AS `income_start_date_c`,
 1 AS `assets_total_super_other_c`,
 1 AS `est_date_load_paid_off_c`,
 1 AS `income_end_date_c`,
 1 AS `investment_current_value_c`,
 1 AS `debt_current_value_c`,
 1 AS `lsw_amount_c`,
 1 AS `lsw_first_year_c`,
 1 AS `income_amount_per_year_c`,
 1 AS `debt_type_c`,
 1 AS `investment_type_c`,
 1 AS `soa_flag_c`,
 1 AS `assets_total_primary_super_c`,
 1 AS `simulation_link_text_c`,
 1 AS `total_profile_completion_c`,
 1 AS `profile_prompts_count_c`,
 1 AS `assets_total_addl_income_c`,
 1 AS `assets_total_inv_assets_c`,
 1 AS `liab_total_home_other_loans_c`,
 1 AS `liab_total_inv_loans_c`,
 1 AS `member_id_c`,
 1 AS `member_hash_c`,
 1 AS `optimisation_flag_c`,
 1 AS `show_splash_next_c`,
 1 AS `employment_status_c`,
 1 AS `last_login_c`,
 1 AS `ars_data_c`,
 1 AS `ars_outcome_c`,
 1 AS `ars_finances_c`,
 1 AS `ars_overall_c`,
 1 AS `ars_engagement_c`,
 1 AS `ars_data_value_c`,
 1 AS `ars_outcome_value_c`,
 1 AS `ars_finances_value_c`,
 1 AS `ars_engagement_value_c`,
 1 AS `ars_overall_value_c`,
 1 AS `count_articles_c`,
 1 AS `count_badges_c`,
 1 AS `ri_strong_c`,
 1 AS `ri_weak_c`,
 1 AS `ri_verystrong_c`,
 1 AS `ri_veryweak_c`,
 1 AS `advice_status_c`,
 1 AS `ri_date_created_c`,
 1 AS `optrif_advice_status_c`,
 1 AS `optrif_date_created_c`,
 1 AS `optrif_weak_c`,
 1 AS `optrif_strong_c`,
 1 AS `optrif_veryweak_c`,
 1 AS `ars_data_income_c`,
 1 AS `ars_data_other_super_c`,
 1 AS `ars_data_contribution_c`,
 1 AS `ars_data_retirement_age_high_c`,
 1 AS `ars_data_retirement_age_low_c`,
 1 AS `ars_data_total_c`,
 1 AS `atps_proxy_c`,
 1 AS `pension_flag_c`,
 1 AS `is_guest_c`,
 1 AS `preferred_article_type_c`,
 1 AS `resetpw_token_c`,
 1 AS `resetpw_trigger_c`,
 1 AS `tpd_weekly_premium_c`,
 1 AS `death_cover_c`,
 1 AS `ars_competencies_value_c`,
 1 AS `tpd_cover_c`,
 1 AS `ip_cover_c`,
 1 AS `ip_weekly_premium_c`,
 1 AS `start_date_with_fund_c`,
 1 AS `death_weekly_premium_c`,
 1 AS `retirement_vs_current_age_c`,
 1 AS `userincomefrequency_c`,
 1 AS `userincometype_c`,
 1 AS `usersalsacavailable_c`,
 1 AS `asset_annuitisation_c`,
 1 AS `annuity_income_c`,
 1 AS `referrer_c`,
 1 AS `process_1_completed_c`,
 1 AS `process_2_completed_c`,
 1 AS `process_3_completed_c`,
 1 AS `understanding_c`,
 1 AS `motivation_c`,
 1 AS `involvement_c`,
 1 AS `confidence_c`,
 1 AS `life_journey_c`,
 1 AS `pilot_status_c`,
 1 AS `conts_instructions_c`,
 1 AS `total_interactions_count_c`,
 1 AS `count_competencies_c`,
 1 AS `count_profile_completion_c`,
 1 AS `feature_switches_account_c`,
 1 AS `feature_switches_segment_c`,
 1 AS `ap_application_type_c`,
 1 AS `ap_assessable_income_c`,
 1 AS `ap_assessable_assets_c`,
 1 AS `ap_test_income_amount_c`,
 1 AS `ap_test_assets_amount_c`,
 1 AS `ap_amount_c`,
 1 AS `chargebee_customer_id_c`,
 1 AS `ap_amount_type_c`,
 1 AS `re_one_off_expenses_amount_c`,
 1 AS `re_one_off_expenses_list_c`,
 1 AS `health_check_c`,
 1 AS `main_retirement_concerns_c`,
 1 AS `expenses_current_c`,
 1 AS `ap_age_eligibility_c`,
 1 AS `ap_residency_eligibility_c`,
 1 AS `ap_completed_sections_count_c`,
 1 AS `ap_test_assets_amount_type_c`,
 1 AS `ap_test_income_amount_type_c`,
 1 AS `process_trigger_c`,
 1 AS `process_attributes_c`,
 1 AS `last_logout_c`,
 1 AS `check_ap_application_type_c`,
 1 AS `ap_combined_amount_type_c`,
 1 AS `splash_page_c`,
 1 AS `ap_centrelink_receipt_number_c`,
 1 AS `ap_centrelink_receipt_date_c`,
 1 AS `ap_australia_post_tracking_c`,
 1 AS `ab_test_id_c`,
 1 AS `ap_australia_post_sent_date_c`,
 1 AS `ap_test_assets_amt_type_t1_c`,
 1 AS `ap_amount_type_t2_c`,
 1 AS `ap_eligibility_date_text_c`,
 1 AS `ap_eligibility_date_c`,
 1 AS `ap_amount_t2_c`,
 1 AS `ap_date_text_t1_c`,
 1 AS `ap_assessable_assets_t1_c`,
 1 AS `ap_test_assets_amt_type_t2_c`,
 1 AS `ap_eligibility_date_text_t2_c`,
 1 AS `ap_date_text_t2_c`,
 1 AS `ap_eligibility_date_text_t1_c`,
 1 AS `ap_test_income_amt_type_t1_c`,
 1 AS `ap_test_assets_amount_t2_c`,
 1 AS `ap_test_income_amount_t1_c`,
 1 AS `ap_deemed_income_c`,
 1 AS `ap_eligibility_date_t1_c`,
 1 AS `ap_date_c`,
 1 AS `ap_assessable_income_t2_c`,
 1 AS `ap_combined_amount_type_t1_c`,
 1 AS `ap_test_income_amount_t2_c`,
 1 AS `ap_test_assets_amount_t1_c`,
 1 AS `ap_deemed_income_t2_c`,
 1 AS `ap_deemed_income_t1_c`,
 1 AS `ap_combined_amount_type_t2_c`,
 1 AS `ap_amount_type_t1_c`,
 1 AS `ap_date_text_c`,
 1 AS `ap_test_income_amt_type_t2_c`,
 1 AS `ap_date_t2_c`,
 1 AS `ap_date_t1_c`,
 1 AS `ap_amount_t1_c`,
 1 AS `ap_eligibility_date_t2_c`,
 1 AS `ap_assessable_income_t1_c`,
 1 AS `ap_assessable_assets_t2_c`,
 1 AS `trigger_account_activation_c`,
 1 AS `apc_age_eligibility_c`,
 1 AS `apc_amount_c`,
 1 AS `apc_amount_type_c`,
 1 AS `apc_apec_mongo_id_c`,
 1 AS `apc_assessable_assets_c`,
 1 AS `apc_assessable_income_c`,
 1 AS `apc_combined_amount_c`,
 1 AS `apc_combined_amount_type_c`,
 1 AS `apc_mongo_id_c`,
 1 AS `apc_residency_eligibility_c`,
 1 AS `apc_test_assets_amount_c`,
 1 AS `apc_test_assets_amount_type_c`,
 1 AS `apc_test_income_amount_c`,
 1 AS `apc_test_income_amount_type_c`,
 1 AS `ap_apec_mongo_id_c`,
 1 AS `ap_apec_mongo_id_t1_c`,
 1 AS `ap_apec_mongo_id_t2_c`,
 1 AS `ap_combined_amount_t1_c`,
 1 AS `ap_combined_amount_c`,
 1 AS `ap_combined_amount_t2_c`,
 1 AS `ap_person2_app_date_text_c`,
 1 AS `ap_person1_app_date_c`,
 1 AS `ap_application_date_t2_c`,
 1 AS `ap_application_date_c`,
 1 AS `ap_application_date_text_c`,
 1 AS `ap_application_date_text_t2_c`,
 1 AS `ap_person2_app_date_c`,
 1 AS `apc_application_eligibility_c`,
 1 AS `ap_person1_app_date_text_c`,
 1 AS `ap_application_date_text_t1_c`,
 1 AS `advice_ready_to_proceed_c`,
 1 AS `fund_data_date_c`,
 1 AS `generate_handover_report_c`,
 1 AS `ap_application_date_t1_c`,
 1 AS `deleted`*/;

--
-- Temporary view structure for view `qs_investments`
--

/*!50001 DROP VIEW IF EXISTS `qs_investments`*/;
/*!50001 CREATE VIEW `qs_investments` AS SELECT 
 1 AS `contact_id`,
 1 AS `id`,
 1 AS `name`,
 1 AS `date_entered`,
 1 AS `date_modified`,
 1 AS `description`,
 1 AS `deleted`,
 1 AS `inv_balance`,
 1 AS `inv_balance_date`,
 1 AS `type`,
 1 AS `investment_option`,
 1 AS `balance_calc`,
 1 AS `initial_balance`,
 1 AS `fund_name_c`,
 1 AS `classification_c`,
 1 AS `assets_total_other_super_c`,
 1 AS `assets_primary_super_c`,
 1 AS `liab_home_other_loans_c`,
 1 AS `lsw_amount_c`,
 1 AS `base_rate`,
 1 AS `assets_inv_assets_c`,
 1 AS `liab_inv_loans_c`,
 1 AS `other_parameters_c`,
 1 AS `meta_data_c`,
 1 AS `survey_field_id_c`*/;

--
-- Temporary view structure for view `qs_opportunities`
--

/*!50001 DROP VIEW IF EXISTS `qs_opportunities`*/;
/*!50001 CREATE VIEW `qs_opportunities` AS SELECT 
 1 AS `contact_id`,
 1 AS `name`,
 1 AS `date_entered`,
 1 AS `date_modified`,
 1 AS `modified_user_id`,
 1 AS `created_by`,
 1 AS `description`,
 1 AS `deleted`,
 1 AS `opportunity_type`,
 1 AS `campaign_id`,
 1 AS `lead_source`,
 1 AS `amount`,
 1 AS `date_closed`,
 1 AS `next_step`,
 1 AS `sales_stage`,
 1 AS `sales_status`,
 1 AS `expected_amount_c`,
 1 AS `amount_usdollar`,
 1 AS `process_attributes_c`,
 1 AS `charge_amount_c`,
 1 AS `id`*/;

--
-- Table structure for table `quotas`
--

CREATE TABLE `quotas` (
  `id` char(36) NOT NULL,
  `user_id` char(36) DEFAULT NULL,
  `timeperiod_id` char(36) DEFAULT NULL,
  `quota_type` varchar(100) DEFAULT NULL,
  `amount` decimal(26,6) DEFAULT NULL,
  `amount_base_currency` decimal(26,6) DEFAULT NULL,
  `currency_id` char(36) DEFAULT '-99',
  `base_rate` decimal(26,6) DEFAULT NULL,
  `committed` tinyint(1) DEFAULT '0',
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `assigned_user_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_quotas_skey` (`sync_key`),
  KEY `idx_quota_user_tp` (`user_id`,`timeperiod_id`),
  KEY `idx_quotas_date_modfied` (`date_modified`),
  KEY `idx_quotas_id_del` (`id`,`deleted`),
  KEY `idx_quotas_date_entered` (`date_entered`),
  KEY `idx_quotas_name_del` (`name`,`deleted`),
  KEY `idx_quotas_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_quotas_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_quotas_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `quotas_audit`
--

CREATE TABLE `quotas_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_quotas_audit_event_id` (`event_id`),
  KEY `idx_quotas_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_quotas_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `quotes`
--

CREATE TABLE `quotes` (
  `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,
  `shipper_id` char(36) DEFAULT NULL,
  `currency_id` char(36) DEFAULT '-99',
  `base_rate` decimal(26,6) DEFAULT NULL,
  `taxrate_id` char(36) DEFAULT NULL,
  `show_line_nums` tinyint(1) DEFAULT '1',
  `calc_grand_total` tinyint(1) DEFAULT '1',
  `quote_type` varchar(255) DEFAULT NULL,
  `date_quote_expected_closed` date DEFAULT NULL,
  `original_po_date` date DEFAULT NULL,
  `payment_terms` varchar(128) DEFAULT NULL,
  `date_quote_closed` date DEFAULT NULL,
  `date_order_shipped` date DEFAULT NULL,
  `order_stage` varchar(100) DEFAULT NULL,
  `quote_stage` varchar(100) DEFAULT NULL,
  `purchase_order_num` varchar(50) DEFAULT NULL,
  `quote_num` int(11) NOT NULL AUTO_INCREMENT,
  `subtotal` decimal(26,6) DEFAULT NULL,
  `subtotal_usdollar` decimal(26,6) DEFAULT NULL,
  `shipping` decimal(26,6) DEFAULT NULL,
  `shipping_usdollar` decimal(26,6) DEFAULT NULL,
  `discount` decimal(26,6) DEFAULT NULL,
  `deal_tot` decimal(26,2) DEFAULT NULL,
  `deal_tot_usdollar` decimal(26,2) DEFAULT NULL,
  `new_sub` decimal(26,6) DEFAULT NULL,
  `new_sub_usdollar` decimal(26,6) DEFAULT NULL,
  `tax` decimal(26,6) DEFAULT NULL,
  `tax_usdollar` decimal(26,6) DEFAULT NULL,
  `total` decimal(26,6) DEFAULT NULL,
  `total_usdollar` decimal(26,6) 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(100) 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(100) DEFAULT NULL,
  `system_id` int(11) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `taxrate_value` decimal(26,6) DEFAULT '0.000000',
  `deal_tot_discount_percentage` decimal(26,2) DEFAULT '0.00',
  `taxable_subtotal` decimal(26,6) DEFAULT NULL,
  `renewal` tinyint(1) DEFAULT '0',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `quote_num` (`quote_num`),
  UNIQUE KEY `idx_quotes_skey` (`sync_key`),
  KEY `quotesmod` (`date_modified`),
  KEY `idx_quote_quote_stage` (`quote_stage`),
  KEY `idx_quote_date_quote_expected_closed` (`date_quote_expected_closed`),
  KEY `idx_quote_date_entered` (`date_entered`),
  KEY `idx_quotes_id_del` (`id`,`deleted`),
  KEY `idx_quotes_name_del` (`name`,`deleted`),
  KEY `idx_quotes_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_quotes_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_quotes_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_quotes_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_quotes_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `quotes_accounts`
--

CREATE TABLE `quotes_accounts` (
  `id` char(36) NOT NULL,
  `quote_id` char(36) DEFAULT NULL,
  `account_id` char(36) DEFAULT NULL,
  `account_role` varchar(20) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_acc_qte_acc` (`account_id`),
  KEY `idx_quote_account_role` (`quote_id`,`account_role`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `quotes_audit`
--

CREATE TABLE `quotes_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_quotes_parent_id` (`parent_id`),
  KEY `idx_quotes_audit_event_id` (`event_id`),
  KEY `idx_quotes_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_quotes_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `quotes_contacts`
--

CREATE TABLE `quotes_contacts` (
  `id` char(36) NOT NULL,
  `contact_id` char(36) DEFAULT NULL,
  `quote_id` char(36) DEFAULT NULL,
  `contact_role` varchar(20) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_con_qte_con` (`contact_id`),
  KEY `idx_quote_contact_role` (`quote_id`,`contact_role`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `quotes_opportunities`
--

CREATE TABLE `quotes_opportunities` (
  `id` char(36) NOT NULL,
  `opportunity_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_opp_qte_opp` (`opportunity_id`),
  KEY `idx_quote_oportunities` (`quote_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `record_list`
--

CREATE TABLE `record_list` (
  `id` char(36) NOT NULL,
  `assigned_user_id` char(36) NOT NULL,
  `module_name` varchar(50) DEFAULT NULL,
  `records` longtext,
  `date_modified` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `relationships`
--

CREATE TABLE `relationships` (
  `id` char(36) NOT NULL,
  `relationship_name` varchar(150) DEFAULT NULL,
  `lhs_module` varchar(100) DEFAULT NULL,
  `lhs_table` varchar(64) DEFAULT NULL,
  `lhs_key` varchar(64) DEFAULT NULL,
  `rhs_module` varchar(100) DEFAULT NULL,
  `rhs_table` varchar(64) DEFAULT NULL,
  `rhs_key` varchar(64) DEFAULT NULL,
  `join_table` varchar(128) DEFAULT NULL,
  `join_key_lhs` varchar(128) DEFAULT NULL,
  `join_key_rhs` varchar(128) DEFAULT NULL,
  `relationship_type` varchar(64) DEFAULT NULL,
  `relationship_role_column` varchar(64) DEFAULT NULL,
  `relationship_role_column_value` varchar(50) DEFAULT NULL,
  `reverse` tinyint(1) DEFAULT '0',
  `deleted` tinyint(1) DEFAULT '0',
  `lhs_vname` varchar(64) DEFAULT NULL,
  `rhs_vname` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_rel_name` (`relationship_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `releases`
--

CREATE TABLE `releases` (
  `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(50) DEFAULT NULL,
  `list_order` int(4) DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_releases` (`name`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `report_cache`
--

CREATE TABLE `report_cache` (
  `id` char(36) NOT NULL,
  `assigned_user_id` char(36) NOT NULL,
  `contents` text,
  `report_options` text,
  `deleted` varchar(1) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  PRIMARY KEY (`id`,`assigned_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `report_maker`
--

CREATE TABLE `report_maker` (
  `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,
  `title` varchar(50) DEFAULT NULL,
  `report_align` varchar(8) DEFAULT NULL,
  `description` text,
  `scheduled` tinyint(1) DEFAULT '0',
  `acl_team_set_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_rmaker` (`name`,`deleted`),
  KEY `idx_report_maker_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_report_maker_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `report_schedules`
--

CREATE TABLE `report_schedules` (
  `id` char(36) NOT NULL,
  `user_id` char(36) DEFAULT NULL,
  `report_id` char(36) DEFAULT NULL,
  `date_start` datetime DEFAULT NULL,
  `next_run` datetime DEFAULT NULL,
  `active` tinyint(1) DEFAULT '0',
  `time_interval` int(11) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `schedule_type` varchar(3) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `name` varchar(255) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` 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,
  `file_type` varchar(32) DEFAULT 'PDF',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_report_schedules_skey` (`sync_key`),
  KEY `idx_report_schedules_date_modfied` (`date_modified`),
  KEY `idx_report_schedules_id_del` (`id`,`deleted`),
  KEY `idx_report_schedules_date_entered` (`date_entered`),
  KEY `idx_report_schedules_name_del` (`name`,`deleted`),
  KEY `idx_report_schedules_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_report_schedules_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_report_schedules_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_report_schedules_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_report_schedules_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_del_active` (`deleted`,`active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `report_schedules_audit`
--

CREATE TABLE `report_schedules_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_report_schedules_audit_event_id` (`event_id`),
  KEY `idx_report_schedules_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_report_schedules_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `reportschedules_users`
--

CREATE TABLE `reportschedules_users` (
  `id` char(36) NOT NULL,
  `reportschedule_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_usr_rs_usr` (`user_id`),
  KEY `idx_reportschedule_users_del` (`reportschedule_id`,`user_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `revenue_line_items`
--

CREATE TABLE `revenue_line_items` (
  `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,
  `product_template_id` char(36) DEFAULT NULL,
  `account_id` char(36) DEFAULT NULL,
  `total_amount` decimal(26,6) DEFAULT NULL,
  `type_id` char(36) DEFAULT NULL,
  `quote_id` char(36) DEFAULT NULL,
  `manufacturer_id` char(36) DEFAULT NULL,
  `category_id` char(36) DEFAULT NULL,
  `mft_part_num` varchar(50) DEFAULT NULL,
  `vendor_part_num` varchar(50) DEFAULT NULL,
  `date_purchased` date DEFAULT NULL,
  `cost_price` decimal(26,6) DEFAULT NULL,
  `discount_price` decimal(26,6) DEFAULT NULL,
  `discount_amount` decimal(26,6) DEFAULT NULL,
  `discount_rate_percent` decimal(27,2) DEFAULT NULL,
  `discount_amount_usdollar` decimal(26,6) DEFAULT NULL,
  `discount_select` tinyint(1) DEFAULT NULL,
  `deal_calc` decimal(26,6) DEFAULT NULL,
  `deal_calc_usdollar` decimal(26,6) DEFAULT NULL,
  `list_price` decimal(26,6) DEFAULT NULL,
  `cost_usdollar` decimal(26,6) DEFAULT NULL,
  `discount_usdollar` decimal(26,6) DEFAULT NULL,
  `list_usdollar` decimal(26,6) DEFAULT NULL,
  `currency_id` char(36) DEFAULT '-99',
  `base_rate` decimal(26,6) DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL,
  `tax_class` varchar(100) DEFAULT NULL,
  `website` varchar(255) DEFAULT NULL,
  `weight` decimal(12,2) DEFAULT NULL,
  `quantity` decimal(12,2) DEFAULT '1.00',
  `support_name` varchar(50) DEFAULT NULL,
  `support_description` varchar(255) DEFAULT NULL,
  `support_contact` varchar(50) DEFAULT NULL,
  `support_term` varchar(100) DEFAULT NULL,
  `date_support_expires` date DEFAULT NULL,
  `date_support_starts` date DEFAULT NULL,
  `pricing_formula` varchar(100) DEFAULT NULL,
  `pricing_factor` int(4) DEFAULT NULL,
  `serial_number` varchar(50) DEFAULT NULL,
  `asset_number` varchar(50) DEFAULT NULL,
  `book_value` decimal(26,6) DEFAULT NULL,
  `book_value_usdollar` decimal(26,6) DEFAULT NULL,
  `book_value_date` date DEFAULT NULL,
  `best_case` decimal(26,6) DEFAULT NULL,
  `likely_case` decimal(26,6) DEFAULT NULL,
  `worst_case` decimal(26,6) DEFAULT NULL,
  `date_closed` date DEFAULT NULL,
  `date_closed_timestamp` bigint(20) unsigned DEFAULT NULL,
  `next_step` varchar(100) DEFAULT NULL,
  `commit_stage` varchar(50) DEFAULT 'exclude',
  `sales_stage` varchar(255) DEFAULT 'Prospecting',
  `probability` double DEFAULT NULL,
  `lead_source` varchar(50) DEFAULT NULL,
  `campaign_id` char(36) DEFAULT NULL,
  `opportunity_id` char(36) NOT NULL,
  `product_type` varchar(255) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `renewable` tinyint(1) DEFAULT '0',
  `service` tinyint(1) DEFAULT '0',
  `service_duration_value` int(5) DEFAULT NULL,
  `service_duration_unit` varchar(50) DEFAULT NULL,
  `service_end_date` date DEFAULT NULL,
  `service_start_date` date DEFAULT NULL,
  `lock_duration` tinyint(1) DEFAULT '0',
  `subtotal` decimal(26,6) DEFAULT NULL,
  `discount_amount_signed` decimal(26,6) DEFAULT '0.000000',
  `generate_purchase` varchar(25) DEFAULT NULL,
  `purchasedlineitem_id` char(36) DEFAULT NULL,
  `add_on_to_id` char(36) DEFAULT NULL,
  `renewal_rli_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `catalog_service_duration_value` int(5) DEFAULT NULL,
  `catalog_service_duration_unit` varchar(50) DEFAULT NULL,
  `service_duration_multiplier` decimal(10,0) DEFAULT NULL,
  `renewal` tinyint(1) DEFAULT '0',
  `forecasted_likely` decimal(26,6) DEFAULT NULL,
  `denorm_account_name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_revenue_line_items_skey` (`sync_key`),
  KEY `revenue_line_itemsmod` (`date_modified`),
  KEY `idx_revenuelineitem` (`name`,`deleted`),
  KEY `idx_revenuelineitem_sales_stage` (`sales_stage`),
  KEY `idx_revenuelineitem_oppid` (`opportunity_id`),
  KEY `idx_revenue_line_items_id_del` (`id`,`deleted`),
  KEY `idx_revenue_line_items_date_entered` (`date_entered`),
  KEY `idx_revenue_line_items_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_revenue_line_items_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_revenue_line_items_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_revenue_line_items_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_revenue_line_items_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_rli_account_id_del` (`deleted`,`account_id`,`id`),
  KEY `idx_rli_quote_id_del` (`deleted`,`quote_id`,`id`),
  KEY `idx_rli_name_dm` (`deleted`,`name`,`date_modified`),
  KEY `idx_rli_del_created_by_pt_id` (`deleted`,`created_by`,`product_template_id`),
  KEY `idx_accountid_type_ren_dateclosed` (`account_id`,`product_type`,`renewable`,`date_closed`),
  KEY `idx_renewal_rli_id_del` (`deleted`,`renewal_rli_id`,`id`),
  KEY `idx_del_addontoid` (`deleted`,`add_on_to_id`),
  KEY `idx_revenue_line_items_denorm_account_name` (`denorm_account_name`,`id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `revenue_line_items_audit`
--

CREATE TABLE `revenue_line_items_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_revenue_line_items_parent_id` (`parent_id`),
  KEY `idx_revenue_line_items_audit_event_id` (`event_id`),
  KEY `idx_revenue_line_items_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_revenue_line_items_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `roles`
--

CREATE TABLE `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,
  `modules` text,
  `deleted` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_role_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `roles_modules`
--

CREATE TABLE `roles_modules` (
  `id` char(36) NOT NULL,
  `role_id` char(36) DEFAULT NULL,
  `module_id` char(36) DEFAULT NULL,
  `allow` tinyint(1) DEFAULT '0',
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_module_id` (`module_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `roles_users`
--

CREATE TABLE `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_ru_role_id` (`role_id`),
  KEY `idx_ru_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

CREATE TABLE `saved_reports` (
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `module` varchar(255) DEFAULT NULL,
  `report_type` varchar(255) DEFAULT NULL,
  `content` longtext,
  `deleted` tinyint(1) DEFAULT 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,
  `is_published` tinyint(1) DEFAULT '0',
  `chart_type` varchar(36) DEFAULT 'none',
  `schedule_type` varchar(3) DEFAULT 'pro',
  `favorite` tinyint(1) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `description` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_saved_reports_skey` (`sync_key`),
  KEY `idx_savedreport_module` (`module`),
  KEY `idx_saved_reports_date_modfied` (`date_modified`),
  KEY `idx_saved_reports_id_del` (`id`,`deleted`),
  KEY `idx_saved_reports_date_entered` (`date_entered`),
  KEY `idx_saved_reports_name_del` (`name`,`deleted`),
  KEY `idx_saved_reports_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_saved_reports_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_saved_reports_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_saved_reports_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_saved_reports_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `saved_search`
--

CREATE TABLE `saved_search` (
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `id` char(36) NOT NULL,
  `name` varchar(150) DEFAULT NULL,
  `search_module` varchar(150) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `contents` text,
  `description` text,
  `acl_team_set_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_desc` (`name`,`deleted`),
  KEY `idx_saved_search_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_saved_search_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `schedulers`
--

CREATE TABLE `schedulers` (
  `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',
  `job` varchar(255) DEFAULT NULL,
  `date_time_start` datetime DEFAULT NULL,
  `date_time_end` datetime DEFAULT NULL,
  `job_interval` varchar(100) DEFAULT NULL,
  `time_from` time DEFAULT NULL,
  `time_to` time DEFAULT NULL,
  `last_run` datetime DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL,
  `catch_up` tinyint(1) DEFAULT '1',
  `system_job` tinyint(1) DEFAULT '0',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_schedulers_skey` (`sync_key`),
  KEY `schedulersmod` (`date_modified`),
  KEY `idx_schedule` (`date_time_start`,`deleted`),
  KEY `idx_scheduler_job_interval` (`job_interval`),
  KEY `idx_scheduler_status` (`status`),
  KEY `idx_schedulers_id_del` (`id`,`deleted`),
  KEY `idx_schedulers_date_entered` (`date_entered`),
  KEY `idx_schedulers_name_del` (`name`,`deleted`),
  KEY `idx_schedulers_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_schedulers_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `schedulers_times`
--

CREATE TABLE `schedulers_times` (
  `id` char(36) NOT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `scheduler_id` char(36) NOT NULL,
  `execute_time` datetime DEFAULT NULL,
  `status` varchar(25) DEFAULT 'ready',
  PRIMARY KEY (`id`),
  KEY `idx_scheduler_id` (`scheduler_id`,`execute_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_advice`
--

CREATE TABLE `se_advice` (
  `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,
  `assumptions` text,
  `output_raw` text,
  `output_formatted` text,
  `ri_mean` decimal(26,6) DEFAULT NULL,
  `ri_standard_deviation` decimal(26,6) DEFAULT NULL,
  `currency_id` char(36) DEFAULT NULL,
  `ri_median` decimal(26,6) DEFAULT NULL,
  `advice_engine` varchar(255) DEFAULT NULL,
  `ri_verystrong` decimal(26,6) DEFAULT NULL,
  `ri_weak` decimal(26,6) DEFAULT NULL,
  `ri_veryweak` decimal(26,6) DEFAULT NULL,
  `ri_strong` decimal(26,6) DEFAULT NULL,
  `re_strong` 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_se_advice_skey` (`sync_key`),
  KEY `se_advicemod` (`date_modified`),
  KEY `idx_se_advice_id_del` (`id`,`deleted`),
  KEY `idx_se_advice_date_entered` (`date_entered`),
  KEY `idx_se_advice_name_del` (`name`,`deleted`),
  KEY `idx_se_advice_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_se_advice_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_advice_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_advice_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_advice_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_advice_audit`
--

CREATE TABLE `se_advice_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_se_advice_parent_id` (`parent_id`),
  KEY `idx_se_advice_audit_event_id` (`event_id`),
  KEY `idx_se_advice_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_advice_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_advice_contacts_c`
--

CREATE TABLE `se_advice_contacts_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_advice_contactscontacts_ida` varchar(36) DEFAULT NULL,
  `se_advice_contactsse_advice_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `se_advice_contacts_ida1` (`se_advice_contactscontacts_ida`),
  KEY `se_advice_contacts_alt` (`se_advice_contactsse_advice_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_advice_cstm`
--

CREATE TABLE `se_advice_cstm` (
  `id_c` char(36) NOT NULL,
  `advice_engine_version_c` varchar(255) DEFAULT NULL,
  `generate_soa_c` tinyint(1) DEFAULT '0',
  `email_soa_c` tinyint(1) DEFAULT '0',
  `appstate_json_c` longtext,
  `old_investment_risk_c` decimal(18,1) DEFAULT NULL,
  `new_investment_risk_c` decimal(18,1) DEFAULT NULL,
  `execute_advice_c` tinyint(1) DEFAULT '0',
  `advice_status_c` varchar(100) DEFAULT NULL,
  `member_name_c` varchar(255) DEFAULT NULL,
  `member_id_c` varchar(255) DEFAULT NULL,
  `soa_content_c` text,
  `soa_content_hash_c` varchar(255) DEFAULT NULL,
  `advice_type_c` varchar(100) DEFAULT '',
  `rife_mongo_id_c` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_advice_documents_1_c`
--

CREATE TABLE `se_advice_documents_1_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_advice_documents_1se_advice_ida` varchar(36) DEFAULT NULL,
  `se_advice_documents_1documents_idb` varchar(36) DEFAULT NULL,
  `document_revision_id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `se_advice_documents_1_ida1` (`se_advice_documents_1se_advice_ida`),
  KEY `se_advice_documents_1_idb2` (`se_advice_documents_1documents_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_advice_se_transactions_1_c`
--

CREATE TABLE `se_advice_se_transactions_1_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_advice_se_transactions_1se_advice_ida` varchar(36) DEFAULT NULL,
  `se_advice_se_transactions_1se_transactions_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `se_advice_se_transactions_1_ida1` (`se_advice_se_transactions_1se_advice_ida`),
  KEY `se_advice_se_transactions_1_alt` (`se_advice_se_transactions_1se_transactions_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_advicetopics`
--

CREATE TABLE `se_advicetopics` (
  `id` char(36) NOT NULL,
  `name` varchar(255) DEFAULT '',
  `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,
  `advice_topic` varchar(100) DEFAULT '',
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_se_advicetopics_skey` (`sync_key`),
  KEY `idx_se_advicetopics_date_modfied` (`date_modified`),
  KEY `idx_se_advicetopics_id_del` (`id`,`deleted`),
  KEY `idx_se_advicetopics_date_entered` (`date_entered`),
  KEY `idx_se_advicetopics_name_del` (`name`,`deleted`),
  KEY `idx_se_advicetopics_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_se_advicetopics_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_advicetopics_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_advicetopics_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_advicetopics_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_advicetopics_audit`
--

CREATE TABLE `se_advicetopics_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_se_advicetopics_audit_parent_id` (`parent_id`),
  KEY `idx_se_advicetopics_audit_event_id` (`event_id`),
  KEY `idx_se_advicetopics_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_advicetopics_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_advicetopics_se_memberadvicetopics_1_c`
--

CREATE TABLE `se_advicetopics_se_memberadvicetopics_1_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_advicetopics_se_memberadvicetopics_1se_advicetopics_ida` varchar(36) DEFAULT NULL,
  `se_advicetopics_se_memberadvicetopics_1se_memberadvicetopics_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `se_advicetopics_se_memberadvicetopics_1_ida1` (`se_advicetopics_se_memberadvicetopics_1se_advicetopics_ida`),
  KEY `se_advicetopics_se_memberadvicetopics_1_alt` (`se_advicetopics_se_memberadvicetopics_1se_memberadvicetopics_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_advicetopics_se_requiredcompetencies_1_c`
--

CREATE TABLE `se_advicetopics_se_requiredcompetencies_1_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_advicetopics_se_requiredcompetencies_1se_advicetopics_ida` varchar(36) DEFAULT NULL,
  `se_advicet43f8tencies_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `se_advicetopics_se_requiredcompetencies_1_ida1` (`se_advicetopics_se_requiredcompetencies_1se_advicetopics_ida`),
  KEY `se_advicetopics_se_requiredcompetencies_1_alt` (`se_advicet43f8tencies_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_competencycontribution`
--

CREATE TABLE `se_competencycontribution` (
  `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,
  `score` decimal(18,2) DEFAULT '0.00',
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_se_competencycontribution_skey` (`sync_key`),
  KEY `idx_se_competencycontribution_date_modfied` (`date_modified`),
  KEY `idx_se_competencycontribution_id_del` (`id`,`deleted`),
  KEY `idx_se_competencycontribution_date_entered` (`date_entered`),
  KEY `idx_se_competencycontribution_name_del` (`name`,`deleted`),
  KEY `idx_se_competencycontribution_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_se_competencycontribution_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_competencycontribution_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_competencycontribution_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_competencycontribution_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_competencycontribution_audit`
--

CREATE TABLE `se_competencycontribution_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_se_competencycontribution_audit_parent_id` (`parent_id`),
  KEY `idx_se_competencycontribution_audit_event_id` (`event_id`),
  KEY `idx_se_competencycontribution_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_competencycontribution_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_competencycontribution_cstm`
--

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

--
-- Table structure for table `se_documentinteractions`
--

CREATE TABLE `se_documentinteractions` (
  `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,
  `date_viewed` datetime DEFAULT NULL,
  `duration_sec` int(255) DEFAULT NULL,
  `revision_viewed` int(255) DEFAULT NULL,
  `navigation_to` varchar(255) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_se_documentinteractions_skey` (`sync_key`),
  KEY `se_documentinteractionsmod` (`date_modified`),
  KEY `idx_se_documentinteractions_id_del` (`id`,`deleted`),
  KEY `idx_se_documentinteractions_date_entered` (`date_entered`),
  KEY `idx_se_documentinteractions_name_del` (`name`,`deleted`),
  KEY `idx_se_documentinteractions_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_se_documentinteractions_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_documentinteractions_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_documentinteractions_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_documentinteractions_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_documentinteractions_audit`
--

CREATE TABLE `se_documentinteractions_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_se_documentinteractions_parent_id` (`parent_id`),
  KEY `idx_se_documentinteractions_audit_event_id` (`event_id`),
  KEY `idx_se_documentinteractions_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_documentinteractions_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_documentinteractions_contacts_c`
--

CREATE TABLE `se_documentinteractions_contacts_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_documentinteractions_contactscontacts_ida` varchar(36) DEFAULT NULL,
  `se_documentinteractions_contactsse_documentinteractions_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `se_documentinteractions_contacts_ida1` (`se_documentinteractions_contactscontacts_ida`),
  KEY `se_documentinteractions_contacts_alt` (`se_documentinteractions_contactsse_documentinteractions_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_documentinteractions_cstm`
--

CREATE TABLE `se_documentinteractions_cstm` (
  `id_c` char(36) NOT NULL,
  `end_page_viewed_c` tinyint(1) DEFAULT '0',
  `slider_updated_c` tinyint(1) DEFAULT '0',
  `article_completed_c` tinyint(1) DEFAULT '0',
  `document_name_c` varchar(255) DEFAULT NULL,
  `routecurrent_c` varchar(255) DEFAULT '',
  `routefrom_c` varchar(255) DEFAULT '',
  `routeto_c` varchar(255) DEFAULT '',
  `end_video_viewed_c` tinyint(1) DEFAULT '0',
  `revision_viewed_url_c` varchar(255) DEFAULT NULL,
  `process_trigger_c` text,
  `interaction_article_id_c` varchar(255) DEFAULT NULL,
  `revision_viewed_text_c` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_documentinteractions_documents_c`
--

CREATE TABLE `se_documentinteractions_documents_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_documentinteractions_documentsdocuments_ida` varchar(36) DEFAULT NULL,
  `se_documentinteractions_documentsse_documentinteractions_idb` varchar(36) DEFAULT NULL,
  `document_revision_id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `se_documentinteractions_documents_ida1` (`se_documentinteractions_documentsdocuments_ida`),
  KEY `se_documentinteractions_documents_alt` (`se_documentinteractions_documentsse_documentinteractions_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_documentinteractions_se_flcompetencyresult_1_c`
--

CREATE TABLE `se_documentinteractions_se_flcompetencyresult_1_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_documen0eb1actions_ida` varchar(36) DEFAULT NULL,
  `se_documen79d8yresult_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `se_documentinteractions_se_flcompetencyresult_1_alt` (`se_documen0eb1actions_ida`,`se_documen79d8yresult_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_extendedcontactfields`
--

CREATE TABLE `se_extendedcontactfields` (
  `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,
  `assigned_user_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `idx_se_extendedcontactfields_skey` (`sync_key`),
  KEY `idx_se_extendedcontactfields_date_modfied` (`date_modified`) USING BTREE,
  KEY `idx_se_extendedcontactfields_id_del` (`id`,`deleted`) USING BTREE,
  KEY `idx_se_extendedcontactfields_date_entered` (`date_entered`) USING BTREE,
  KEY `idx_se_extendedcontactfields_name_del` (`name`,`deleted`) USING BTREE,
  KEY `idx_se_extendedcontactfields_assigned_del` (`assigned_user_id`,`deleted`) USING BTREE,
  KEY `idx_se_extendedcontactfields_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_extendedcontactfields_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_extendedcontactfields_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_extendedcontactfields_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_extendedcontactfields_audit`
--

CREATE TABLE `se_extendedcontactfields_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`) USING BTREE,
  KEY `idx_se_extendedcontactfields_audit_parent_id` (`parent_id`) USING BTREE,
  KEY `idx_se_extendedcontactfields_audit_event_id` (`event_id`),
  KEY `idx_se_extendedcontactfields_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_extendedcontactfields_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_extendedcontactfields_cstm`
--

CREATE TABLE `se_extendedcontactfields_cstm` (
  `id_c` char(36) NOT NULL,
  `definition_json_c` longtext,
  `classification_c` varchar(100) DEFAULT '',
  PRIMARY KEY (`id_c`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_extendedcontactfields_se_questionnaire_1_c`
--

CREATE TABLE `se_extendedcontactfields_se_questionnaire_1_c` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_extendee45dtfields_ida` char(36) DEFAULT NULL,
  `se_extendedcontactfields_se_questionnaire_1se_questionnaire_idb` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_se_extendedcontactfields_se_questionnaire_1_ida1_deleted` (`se_extendee45dtfields_ida`,`deleted`) USING BTREE,
  KEY `idx_se_extendedcontactfields_se_questionnaire_1_idb2_deleted` (`se_extendedcontactfields_se_questionnaire_1se_questionnaire_idb`,`deleted`) USING BTREE,
  KEY `se_extendedcontactfields_se_questionnaire_1_alt` (`se_extendee45dtfields_ida`,`se_extendedcontactfields_se_questionnaire_1se_questionnaire_idb`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_extendedcontactvalues`
--

CREATE TABLE `se_extendedcontactvalues` (
  `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,
  `assigned_user_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `classification` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_se_extendedcontactvalues_skey` (`sync_key`),
  KEY `idx_se_extendedcontactvalues_date_modfied` (`date_modified`),
  KEY `idx_se_extendedcontactvalues_id_del` (`id`,`deleted`),
  KEY `idx_se_extendedcontactvalues_date_entered` (`date_entered`),
  KEY `idx_se_extendedcontactvalues_name_del` (`name`,`deleted`),
  KEY `idx_se_extendedcontactvalues_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_se_extendedcontactvalues_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_extendedcontactvalues_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_extendedcontactvalues_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_extendedcontactvalues_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_extendedcontactvalues_audit`
--

CREATE TABLE `se_extendedcontactvalues_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_se_extendedcontactvalues_audit_parent_id` (`parent_id`),
  KEY `idx_se_extendedcontactvalues_audit_event_id` (`event_id`),
  KEY `idx_se_extendedcontactvalues_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_extendedcontactvalues_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_extendedcontactvalues_cstm`
--

CREATE TABLE `se_extendedcontactvalues_cstm` (
  `id_c` char(36) NOT NULL,
  `numeric_value_c` decimal(18,2) DEFAULT NULL,
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_fl_competency`
--

CREATE TABLE `se_fl_competency` (
  `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,
  `documentname` varchar(255) DEFAULT NULL,
  `behavioural_indicator` varchar(100) DEFAULT 'Keeping Track of Finances',
  `competency_area` varchar(100) DEFAULT 'Review payslips and benefits statements',
  `points` int(255) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_se_fl_competency_skey` (`sync_key`),
  KEY `se_fl_competencymod` (`date_modified`),
  KEY `idx_se_fl_competency_id_del` (`id`,`deleted`),
  KEY `idx_se_fl_competency_date_entered` (`date_entered`),
  KEY `idx_se_fl_competency_name_del` (`name`,`deleted`),
  KEY `idx_se_fl_competency_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_se_fl_competency_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_fl_competency_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_fl_competency_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_fl_competency_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_fl_competency_audit`
--

CREATE TABLE `se_fl_competency_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_se_fl_competency_parent_id` (`parent_id`),
  KEY `idx_se_fl_competency_audit_event_id` (`event_id`),
  KEY `idx_se_fl_competency_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_fl_competency_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_fl_competency_cstm`
--

CREATE TABLE `se_fl_competency_cstm` (
  `id_c` char(36) NOT NULL,
  `validity_time_c` int(255) DEFAULT '12',
  `competency_id_c` int(255) DEFAULT '0',
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_fl_competency_documents_c`
--

CREATE TABLE `se_fl_competency_documents_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_fl_competency_documentsdocuments_ida` varchar(36) DEFAULT NULL,
  `se_fl_competency_documentsse_fl_competency_idb` varchar(36) DEFAULT NULL,
  `document_revision_id` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `se_fl_competency_documents_ida1` (`se_fl_competency_documentsdocuments_ida`),
  KEY `se_fl_competency_documents_alt` (`se_fl_competency_documentsse_fl_competency_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_fl_competency_se_competencycontribution_1_c`
--

CREATE TABLE `se_fl_competency_se_competencycontribution_1_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_fl_competency_se_competencycontribution_1se_fl_competency_ida` varchar(36) DEFAULT NULL,
  `se_fl_comp5695ibution_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `se_fl_competency_se_competencycontribution_1_ida1` (`se_fl_competency_se_competencycontribution_1se_fl_competency_ida`),
  KEY `se_fl_competency_se_competencycontribution_1_alt` (`se_fl_comp5695ibution_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_fl_competency_se_requiredcompetencies_1_c`
--

CREATE TABLE `se_fl_competency_se_requiredcompetencies_1_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_fl_competency_se_requiredcompetencies_1se_fl_competency_ida` varchar(36) DEFAULT NULL,
  `se_fl_compd4aatencies_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `se_fl_competency_se_requiredcompetencies_1_ida1` (`se_fl_competency_se_requiredcompetencies_1se_fl_competency_ida`),
  KEY `se_fl_competency_se_requiredcompetencies_1_alt` (`se_fl_compd4aatencies_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_flcompetencyresult`
--

CREATE TABLE `se_flcompetencyresult` (
  `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,
  `behavioural_indicator` varchar(100) DEFAULT 'Keeping Track of Finances',
  `competency_area` varchar(100) DEFAULT 'Review payslips and benefits statements',
  `points_accumulated` decimal(18,2) DEFAULT NULL,
  `percentage_complete` int(255) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_se_flcompetencyresult_skey` (`sync_key`),
  KEY `se_flcompetencyresultmod` (`date_modified`),
  KEY `idx_se_flcompetencyresult_id_del` (`id`,`deleted`),
  KEY `idx_se_flcompetencyresult_date_entered` (`date_entered`),
  KEY `idx_se_flcompetencyresult_name_del` (`name`,`deleted`),
  KEY `idx_se_flcompetencyresult_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_se_flcompetencyresult_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_flcompetencyresult_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_flcompetencyresult_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_flcompetencyresult_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_flcompetencyresult_audit`
--

CREATE TABLE `se_flcompetencyresult_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_se_flcompetencyresult_parent_id` (`parent_id`),
  KEY `idx_se_flcompetencyresult_audit_event_id` (`event_id`),
  KEY `idx_se_flcompetencyresult_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_flcompetencyresult_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_flcompetencyresult_contacts_c`
--

CREATE TABLE `se_flcompetencyresult_contacts_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_flcompetencyresult_contactscontacts_ida` varchar(36) DEFAULT NULL,
  `se_flcompetencyresult_contactsse_flcompetencyresult_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `se_flcompetencyresult_contacts_ida1` (`se_flcompetencyresult_contactscontacts_ida`),
  KEY `se_flcompetencyresult_contacts_alt` (`se_flcompetencyresult_contactsse_flcompetencyresult_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_flcompetencyresult_cstm`
--

CREATE TABLE `se_flcompetencyresult_cstm` (
  `id_c` char(36) NOT NULL,
  `article_id_c` varchar(255) DEFAULT NULL,
  `expired_c` tinyint(1) DEFAULT '0',
  `expiry_date_c` date DEFAULT NULL,
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_flcompetencyresult_se_fl_competency_c`
--

CREATE TABLE `se_flcompetencyresult_se_fl_competency_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_flcompetencyresult_se_fl_competencyse_fl_competency_ida` varchar(36) DEFAULT NULL,
  `se_flcompetencyresult_se_fl_competencyse_flcompetencyresult_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `se_flcompetencyresult_se_fl_competency_ida1` (`se_flcompetencyresult_se_fl_competencyse_fl_competency_ida`),
  KEY `se_flcompetencyresult_se_fl_competency_alt` (`se_flcompetencyresult_se_fl_competencyse_flcompetencyresult_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_households`
--

CREATE TABLE `se_households` (
  `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,
  `assigned_user_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_se_households_skey` (`sync_key`),
  KEY `idx_se_households_date_modfied` (`date_modified`),
  KEY `idx_se_households_id_del` (`id`,`deleted`),
  KEY `idx_se_households_date_entered` (`date_entered`),
  KEY `idx_se_households_name_del` (`name`,`deleted`),
  KEY `idx_se_households_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_se_households_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_households_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_households_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_households_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_households_audit`
--

CREATE TABLE `se_households_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_se_households_audit_parent_id` (`parent_id`),
  KEY `idx_se_households_audit_event_id` (`event_id`),
  KEY `idx_se_households_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_households_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_households_se_relationships_1_c`
--

CREATE TABLE `se_households_se_relationships_1_c` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_households_se_relationships_1se_households_ida` char(36) DEFAULT NULL,
  `se_households_se_relationships_1se_relationships_idb` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_se_households_se_relationships_1_ida1_deleted` (`se_households_se_relationships_1se_households_ida`,`deleted`),
  KEY `idx_se_households_se_relationships_1_idb2_deleted` (`se_households_se_relationships_1se_relationships_idb`,`deleted`),
  KEY `se_households_se_relationships_1_alt` (`se_households_se_relationships_1se_relationships_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_instructions`
--

CREATE TABLE `se_instructions` (
  `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,
  `assigned_user_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_se_instructions_skey` (`sync_key`),
  KEY `idx_se_instructions_date_modfied` (`date_modified`),
  KEY `idx_se_instructions_id_del` (`id`,`deleted`),
  KEY `idx_se_instructions_date_entered` (`date_entered`),
  KEY `idx_se_instructions_name_del` (`name`,`deleted`),
  KEY `idx_se_instructions_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_se_instructions_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_instructions_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_instructions_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_instructions_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_instructions_audit`
--

CREATE TABLE `se_instructions_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_se_instructions_audit_parent_id` (`parent_id`),
  KEY `idx_se_instructions_audit_event_id` (`event_id`),
  KEY `idx_se_instructions_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_instructions_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_instructions_cstm`
--

CREATE TABLE `se_instructions_cstm` (
  `id_c` char(36) NOT NULL,
  `instruction_type_c` varchar(100) DEFAULT '',
  `frequency_c` varchar(100) DEFAULT '',
  `amount_c` decimal(26,6) DEFAULT '0.000000',
  `start_date_c` date DEFAULT NULL,
  `tax_treatment_c` varchar(100) DEFAULT '',
  `end_date_c` date DEFAULT NULL,
  `base_rate` decimal(26,8) DEFAULT NULL,
  `currency_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_instructions_se_investments_1_c`
--

CREATE TABLE `se_instructions_se_investments_1_c` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_instructions_se_investments_1se_instructions_ida` char(36) DEFAULT NULL,
  `se_instructions_se_investments_1se_investments_idb` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_se_instructions_se_investments_1_ida1_deleted` (`se_instructions_se_investments_1se_instructions_ida`,`deleted`),
  KEY `idx_se_instructions_se_investments_1_idb2_deleted` (`se_instructions_se_investments_1se_investments_idb`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_investmentoptions`
--

CREATE TABLE `se_investmentoptions` (
  `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,
  `month` int(4) DEFAULT NULL,
  `iteration` int(4) DEFAULT NULL,
  `growth` float(18,8) DEFAULT NULL,
  `id_txt` varchar(255) DEFAULT NULL,
  `mthly_avg_return` float(18,12) DEFAULT NULL,
  `mthly_stddev` float(18,12) DEFAULT NULL,
  `iterations` int(255) DEFAULT '500',
  `months` int(255) DEFAULT '1200',
  `gen_matrix` varchar(255) DEFAULT NULL,
  `asset_alloc_au_c` decimal(18,4) DEFAULT '0.0000',
  `asset_alloc_au_e` decimal(18,4) DEFAULT '0.0000',
  `asset_alloc_au_fi` decimal(18,4) DEFAULT '0.0000',
  `asset_alloc_au_p` decimal(18,4) DEFAULT '0.0000',
  `asset_alloc_em_e` decimal(18,4) DEFAULT '0.0000',
  `asset_alloc_i_e` decimal(18,4) DEFAULT '0.0000',
  `asset_alloc_i_eh` decimal(18,4) DEFAULT '0.0000',
  `asset_alloc_i_fi` decimal(18,3) DEFAULT '0.000',
  `asset_alloc_i_fih` decimal(18,4) DEFAULT '0.0000',
  `asset_alloc_i_p` decimal(18,4) DEFAULT '0.0000',
  `asset_alloc_i_ph` decimal(18,3) DEFAULT '0.000',
  `matrix` longblob,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_se_investmentoptions_skey` (`sync_key`),
  KEY `se_investmentoptionsmod` (`date_modified`),
  KEY `idx_se_investmentoptions_id_del` (`id`,`deleted`),
  KEY `idx_se_investmentoptions_date_entered` (`date_entered`),
  KEY `idx_se_investmentoptions_name_del` (`name`,`deleted`),
  KEY `idx_se_investmentoptions_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_se_investmentoptions_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_investmentoptions_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_investmentoptions_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_investmentoptions_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_investmentoptions_audit`
--

CREATE TABLE `se_investmentoptions_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_se_investmentoptions_parent_id` (`parent_id`),
  KEY `idx_se_investmentoptions_audit_event_id` (`event_id`),
  KEY `idx_se_investmentoptions_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_investmentoptions_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_investmentoptions_cstm`
--

CREATE TABLE `se_investmentoptions_cstm` (
  `id_c` char(36) NOT NULL,
  `optimal_option_c` float(18,4) DEFAULT '0.0000',
  `fund_name_c` varchar(255) DEFAULT NULL,
  `is_default_c` tinyint(1) DEFAULT '0',
  `asset_alloc_au_pe_c` decimal(18,3) DEFAULT '0.000',
  `asset_alloc_au_hf_c` decimal(18,3) DEFAULT '0.000',
  `asset_alloc_au_i_c` decimal(18,3) DEFAULT '0.000',
  `asset_alloc_i_pe_c` decimal(18,3) DEFAULT '0.000',
  `asset_alloc_i_hf_c` decimal(18,3) DEFAULT '0.000',
  `asset_alloc_i_i_c` decimal(18,4) DEFAULT '0.0000',
  `glidepath_start_c` decimal(18,2) DEFAULT '0.00',
  `opt_id_c` int(255) DEFAULT '0',
  `strategy_c` int(255) DEFAULT '0',
  `glidepath_end_c` decimal(18,2) DEFAULT '0.00',
  `fee_account_c` decimal(18,4) DEFAULT '0.0000',
  `fee_base_c` decimal(18,6) DEFAULT '0.000000',
  `fee_perf_c` decimal(18,6) DEFAULT '0.000000',
  `alpha_c` decimal(18,6) DEFAULT '0.000000',
  `buy_spread_c` decimal(18,6) DEFAULT '0.000000',
  `sell_spread_c` decimal(18,6) DEFAULT '0.000000',
  `asset_alloc_i_e_uh_c` decimal(18,4) DEFAULT '0.0000',
  `asset_alloc_pe_c` decimal(18,4) DEFAULT '0.0000',
  `asset_alloc_p_c` decimal(18,4) DEFAULT '0.0000',
  `asset_alloc_fi_c` decimal(18,4) DEFAULT '0.0000',
  `asset_alloc_hf_c` decimal(18,4) DEFAULT '0.0000',
  `asset_alloc_ma_c` decimal(18,4) DEFAULT '0.0000',
  `asset_alloc_a_c` decimal(18,4) DEFAULT '0.0000',
  `asset_alloc_cg_c` decimal(18,4) DEFAULT '0.0000',
  `asset_alloc_au_ib_c` decimal(18,4) DEFAULT '0.0000',
  `other_parameters_c` text,
  `asset_alloc_i_ib_c` decimal(18,4) DEFAULT '0.0000',
  `confidence_in_modeling_c` decimal(18,4) DEFAULT NULL,
  `investment_option_type_c` varchar(100) DEFAULT '',
  `fee_buy_spread_c` decimal(18,6) DEFAULT '0.000000',
  `fee_investment_c` decimal(18,6) DEFAULT '0.000000',
  `fee_icr_c` decimal(18,6) DEFAULT '0.000000',
  `fee_sell_spread_c` decimal(18,6) DEFAULT '0.000000',
  `fee_option_rebate_c` decimal(18,6) DEFAULT '0.000000',
  `fee_borrowing_cost_c` decimal(18,4) DEFAULT '0.0000',
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_investments`
--

CREATE TABLE `se_investments` (
  `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,
  `inv_balance` decimal(26,6) DEFAULT NULL,
  `currency_id` char(36) DEFAULT NULL,
  `inv_balance_date` date DEFAULT NULL,
  `type` varchar(100) DEFAULT 'AfterTax',
  `priority` int(255) DEFAULT NULL,
  `member_name` varchar(255) DEFAULT NULL,
  `investment_option` varchar(255) DEFAULT NULL,
  `balance_calc` decimal(26,6) DEFAULT NULL,
  `initial_balance` 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_se_investments_skey` (`sync_key`),
  KEY `se_investmentsmod` (`date_modified`),
  KEY `idx_se_investments_id_del` (`id`,`deleted`),
  KEY `idx_se_investments_date_entered` (`date_entered`),
  KEY `idx_se_investments_name_del` (`name`,`deleted`),
  KEY `idx_se_investments_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_se_investments_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_investments_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_investments_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_investments_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_investments_audit`
--

CREATE TABLE `se_investments_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_se_investments_parent_id` (`parent_id`),
  KEY `idx_se_investments_audit_event_id` (`event_id`),
  KEY `idx_se_investments_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_investments_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_investments_contacts_c`
--

CREATE TABLE `se_investments_contacts_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_investments_contactscontacts_ida` varchar(36) DEFAULT NULL,
  `se_investments_contactsse_investments_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `se_investments_contacts_ida1` (`se_investments_contactscontacts_ida`),
  KEY `se_investments_contacts_alt` (`se_investments_contactsse_investments_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_investments_cstm`
--

CREATE TABLE `se_investments_cstm` (
  `id_c` char(36) NOT NULL,
  `classification_c` varchar(100) DEFAULT 'Assets',
  `fund_name_c` varchar(255) DEFAULT NULL,
  `assets_total_other_super_c` decimal(26,6) DEFAULT NULL,
  `assets_primary_super_c` decimal(26,6) DEFAULT NULL,
  `liab_home_other_loans_c` decimal(26,6) DEFAULT NULL,
  `lsw_amount_c` decimal(26,6) DEFAULT NULL,
  `base_rate` decimal(26,8) DEFAULT NULL,
  `assets_inv_assets_c` decimal(26,6) DEFAULT NULL,
  `liab_inv_loans_c` decimal(26,6) DEFAULT NULL,
  `other_parameters_c` text,
  `meta_data_c` text,
  `survey_field_id_c` varchar(255) DEFAULT NULL,
  `accountnumber_c` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_investments_se_investmentoptions_c`
--

CREATE TABLE `se_investments_se_investmentoptions_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_investments_se_investmentoptionsse_investmentoptions_ida` varchar(36) DEFAULT NULL,
  `se_investments_se_investmentoptionsse_investments_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `se_investments_se_investmentoptions_ida1` (`se_investments_se_investmentoptionsse_investmentoptions_ida`),
  KEY `se_investments_se_investmentoptions_alt` (`se_investments_se_investmentoptionsse_investments_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_investments_se_transactions_c`
--

CREATE TABLE `se_investments_se_transactions_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_investments_se_transactionsse_investments_ida` varchar(36) DEFAULT NULL,
  `se_investments_se_transactionsse_transactions_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `se_investments_se_transactions_ida1` (`se_investments_se_transactionsse_investments_ida`),
  KEY `se_investments_se_transactions_alt` (`se_investments_se_transactionsse_transactions_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_memberadvicetopics`
--

CREATE TABLE `se_memberadvicetopics` (
  `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_se_memberadvicetopics_skey` (`sync_key`),
  KEY `idx_se_memberadvicetopics_date_modfied` (`date_modified`),
  KEY `idx_se_memberadvicetopics_id_del` (`id`,`deleted`),
  KEY `idx_se_memberadvicetopics_date_entered` (`date_entered`),
  KEY `idx_se_memberadvicetopics_name_del` (`name`,`deleted`),
  KEY `idx_se_memberadvicetopics_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_se_memberadvicetopics_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_memberadvicetopics_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_memberadvicetopics_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_memberadvicetopics_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_memberadvicetopics_audit`
--

CREATE TABLE `se_memberadvicetopics_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_se_memberadvicetopics_audit_parent_id` (`parent_id`),
  KEY `idx_se_memberadvicetopics_audit_event_id` (`event_id`),
  KEY `idx_se_memberadvicetopics_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_memberadvicetopics_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_memberadvicetopics_cstm`
--

CREATE TABLE `se_memberadvicetopics_cstm` (
  `id_c` char(36) NOT NULL,
  `score_c` decimal(18,2) DEFAULT '0.00',
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_members`
--

CREATE TABLE `se_members` (
  `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',
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `assigned_user_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,
  `age_death` int(3) DEFAULT NULL,
  `age_float` float(3,1) DEFAULT NULL,
  `birthdate` date DEFAULT NULL,
  `age_months` int(255) DEFAULT NULL,
  `age_retirement` varchar(2) DEFAULT NULL,
  `assets_total_non_super` decimal(26,6) DEFAULT NULL,
  `currency_id` char(36) DEFAULT NULL,
  `assets_total_super` decimal(26,6) DEFAULT NULL,
  `gender` varchar(100) DEFAULT NULL,
  `income_addl_contributions` int(255) DEFAULT NULL,
  `income_current` decimal(26,6) DEFAULT NULL,
  `income_current_growth` int(255) DEFAULT NULL,
  `income_desired_p` int(255) DEFAULT NULL,
  `income_expected_retirement` decimal(26,6) DEFAULT NULL,
  `income_frequency` varchar(100) DEFAULT 'weekly',
  `income_required_p` int(255) DEFAULT NULL,
  `income_retirement_required` decimal(26,6) DEFAULT NULL,
  `income_retirement_desired` decimal(26,6) DEFAULT NULL,
  `investment_risk` float(3,1) DEFAULT NULL,
  `investment_strategy` varchar(100) DEFAULT 'merton',
  `segmentation_engagement` varchar(100) DEFAULT 'untrouble_unaware',
  `segmentation_lifestage` varchar(100) DEFAULT 'Lifestage30',
  `segmentation_situation` varchar(100) DEFAULT NULL,
  `simulation_iterations` int(5) DEFAULT NULL,
  `simulation_engine` varchar(100) DEFAULT 'index',
  `simulation_link` varchar(250) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_se_members_skey` (`sync_key`),
  KEY `se_membersmod` (`date_modified`),
  KEY `idx_se_members_id_del` (`id`,`deleted`),
  KEY `idx_se_members_date_entered` (`date_entered`),
  KEY `idx_se_members_last_first` (`last_name`,`first_name`,`deleted`),
  KEY `idx_se_members_first_last` (`first_name`,`last_name`,`deleted`),
  KEY `idx_se_members_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_se_members_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_members_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_members_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_members_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_members_audit`
--

CREATE TABLE `se_members_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_se_members_parent_id` (`parent_id`),
  KEY `idx_se_members_audit_event_id` (`event_id`),
  KEY `idx_se_members_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_members_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_members_se_investments_c`
--

CREATE TABLE `se_members_se_investments_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_members_se_investmentsse_members_ida` varchar(36) DEFAULT NULL,
  `se_members_se_investmentsse_investments_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `se_members_se_investments_ida1` (`se_members_se_investmentsse_members_ida`),
  KEY `se_members_se_investments_alt` (`se_members_se_investmentsse_investments_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_memberupdates`
--

CREATE TABLE `se_memberupdates` (
  `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,
  `old_value` varchar(255) DEFAULT NULL,
  `new_value` varchar(255) DEFAULT NULL,
  `parent_type` varchar(255) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `fields` varchar(100) DEFAULT '',
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_se_memberupdates_skey` (`sync_key`),
  KEY `se_memberupdatesmod` (`date_modified`),
  KEY `idx_se_memberupdates_id_del` (`id`,`deleted`),
  KEY `idx_se_memberupdates_date_entered` (`date_entered`),
  KEY `idx_se_memberupdates_name_del` (`name`,`deleted`),
  KEY `idx_se_memberupdates_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_se_memberupdates_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_memberupdates_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_memberupdates_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_memberupdates_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_memberupdates_audit`
--

CREATE TABLE `se_memberupdates_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_se_memberupdates_parent_id` (`parent_id`),
  KEY `idx_se_memberupdates_audit_event_id` (`event_id`),
  KEY `idx_se_memberupdates_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_memberupdates_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_memberupdates_contacts_c`
--

CREATE TABLE `se_memberupdates_contacts_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_memberupdates_contactscontacts_ida` varchar(36) DEFAULT NULL,
  `se_memberupdates_contactsse_memberupdates_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `se_memberupdates_contacts_ida1` (`se_memberupdates_contactscontacts_ida`),
  KEY `se_memberupdates_contacts_alt` (`se_memberupdates_contactsse_memberupdates_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_questionnaire`
--

CREATE TABLE `se_questionnaire` (
  `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,
  `assigned_user_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `idx_se_questionnaire_skey` (`sync_key`),
  KEY `idx_se_questionnaire_date_modfied` (`date_modified`) USING BTREE,
  KEY `idx_se_questionnaire_id_del` (`id`,`deleted`) USING BTREE,
  KEY `idx_se_questionnaire_date_entered` (`date_entered`) USING BTREE,
  KEY `idx_se_questionnaire_name_del` (`name`,`deleted`) USING BTREE,
  KEY `idx_se_questionnaire_assigned_del` (`assigned_user_id`,`deleted`) USING BTREE,
  KEY `idx_se_questionnaire_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_questionnaire_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_questionnaire_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_questionnaire_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_questionnaire_audit`
--

CREATE TABLE `se_questionnaire_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`) USING BTREE,
  KEY `idx_se_questionnaire_audit_parent_id` (`parent_id`) USING BTREE,
  KEY `idx_se_questionnaire_audit_event_id` (`event_id`),
  KEY `idx_se_questionnaire_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_questionnaire_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_questionnaire_cstm`
--

CREATE TABLE `se_questionnaire_cstm` (
  `id_c` char(36) NOT NULL,
  `definition_json_c` longtext,
  PRIMARY KEY (`id_c`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_relationships`
--

CREATE TABLE `se_relationships` (
  `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,
  `assigned_user_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_se_relationships_skey` (`sync_key`),
  KEY `idx_se_relationships_date_modfied` (`date_modified`),
  KEY `idx_se_relationships_id_del` (`id`,`deleted`),
  KEY `idx_se_relationships_date_entered` (`date_entered`),
  KEY `idx_se_relationships_name_del` (`name`,`deleted`),
  KEY `idx_se_relationships_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_se_relationships_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_relationships_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_relationships_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_relationships_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_relationships_audit`
--

CREATE TABLE `se_relationships_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_se_relationships_audit_parent_id` (`parent_id`),
  KEY `idx_se_relationships_audit_event_id` (`event_id`),
  KEY `idx_se_relationships_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_relationships_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_relationships_cstm`
--

CREATE TABLE `se_relationships_cstm` (
  `id_c` char(36) NOT NULL,
  `household_member_type_c` varchar(100) DEFAULT '',
  `relationship_type_c` varchar(100) DEFAULT NULL,
  `date_started_c` date DEFAULT NULL,
  `date_ended_c` date DEFAULT NULL,
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_requiredcompetencies`
--

CREATE TABLE `se_requiredcompetencies` (
  `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,
  `score` decimal(18,2) DEFAULT '0.00',
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_se_requiredcompetencies_skey` (`sync_key`),
  KEY `idx_se_requiredcompetencies_date_modfied` (`date_modified`),
  KEY `idx_se_requiredcompetencies_id_del` (`id`,`deleted`),
  KEY `idx_se_requiredcompetencies_date_entered` (`date_entered`),
  KEY `idx_se_requiredcompetencies_name_del` (`name`,`deleted`),
  KEY `idx_se_requiredcompetencies_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_se_requiredcompetencies_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_requiredcompetencies_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_requiredcompetencies_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_requiredcompetencies_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_requiredcompetencies_audit`
--

CREATE TABLE `se_requiredcompetencies_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_se_requiredcompetencies_audit_parent_id` (`parent_id`),
  KEY `idx_se_requiredcompetencies_audit_event_id` (`event_id`),
  KEY `idx_se_requiredcompetencies_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_requiredcompetencies_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `se_requiredcompetencies_cstm`
--

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

--
-- Table structure for table `se_segment`
--

CREATE TABLE `se_segment` (
  `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,
  `assigned_user_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_se_segment_skey` (`sync_key`),
  KEY `idx_se_segment_date_modfied` (`date_modified`),
  KEY `idx_se_segment_id_del` (`id`,`deleted`),
  KEY `idx_se_segment_date_entered` (`date_entered`),
  KEY `idx_se_segment_name_del` (`name`,`deleted`),
  KEY `idx_se_segment_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_se_segment_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_segment_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_segment_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_segment_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;

--
-- Table structure for table `se_segment_audit`
--

CREATE TABLE `se_segment_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_se_segment_audit_parent_id` (`parent_id`),
  KEY `idx_se_segment_audit_event_id` (`event_id`),
  KEY `idx_se_segment_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_segment_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;

--
-- Table structure for table `se_segment_contacts_1_c`
--

CREATE TABLE `se_segment_contacts_1_c` (
  `id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `se_segment_contacts_1se_segment_ida` char(36) DEFAULT NULL,
  `se_segment_contacts_1contacts_idb` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_se_segment_contacts_1_ida1_deleted` (`se_segment_contacts_1se_segment_ida`,`deleted`),
  KEY `idx_se_segment_contacts_1_idb2_deleted` (`se_segment_contacts_1contacts_idb`,`deleted`),
  KEY `se_segment_contacts_1_alt` (`se_segment_contacts_1contacts_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;

--
-- Table structure for table `se_segment_cstm`
--

CREATE TABLE `se_segment_cstm` (
  `id_c` char(36) NOT NULL,
  `feature_switches_segment_c` longtext,
  `steps_c_segment_c` longtext,
  `profile_prompts_segment_c` longtext,
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;

--
-- Table structure for table `se_transactions`
--

CREATE TABLE `se_transactions` (
  `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,
  `member_name` varchar(255) DEFAULT NULL,
  `investment_option` varchar(255) DEFAULT NULL,
  `txn_value` decimal(26,6) DEFAULT NULL,
  `currency_id` char(36) DEFAULT NULL,
  `type` varchar(100) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_se_transactions_skey` (`sync_key`),
  KEY `se_transactionsmod` (`date_modified`),
  KEY `idx_se_transactions_id_del` (`id`,`deleted`),
  KEY `idx_se_transactions_date_entered` (`date_entered`),
  KEY `idx_se_transactions_name_del` (`name`,`deleted`),
  KEY `idx_se_transactions_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_se_transactions_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_se_transactions_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_se_transactions_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_se_transactions_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;

--
-- Table structure for table `se_transactions_audit`
--

CREATE TABLE `se_transactions_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_se_transactions_parent_id` (`parent_id`),
  KEY `idx_se_transactions_audit_event_id` (`event_id`),
  KEY `idx_se_transactions_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_se_transactions_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;

--
-- Table structure for table `se_transactions_cstm`
--

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

--
-- Table structure for table `session_active`
--

CREATE TABLE `session_active` (
  `id` char(36) NOT NULL,
  `session_id` varchar(100) DEFAULT NULL,
  `last_request_time` datetime DEFAULT NULL,
  `session_type` varchar(100) DEFAULT NULL,
  `is_violation` tinyint(1) DEFAULT '0',
  `num_active_sessions` int(11) DEFAULT '0',
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_session_id` (`session_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;

--
-- Table structure for table `session_history`
--

CREATE TABLE `session_history` (
  `id` char(36) NOT NULL,
  `session_id` varchar(100) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `last_request_time` datetime DEFAULT NULL,
  `session_type` varchar(100) DEFAULT NULL,
  `is_violation` tinyint(1) DEFAULT '0',
  `num_active_sessions` int(11) DEFAULT '0',
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `shift_exceptions`
--

CREATE TABLE `shift_exceptions` (
  `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,
  `shift_exception_type` varchar(50) DEFAULT NULL,
  `all_day` tinyint(1) DEFAULT '1',
  `start_date` date DEFAULT NULL,
  `start_hour` varchar(2) DEFAULT NULL,
  `start_minutes` varchar(2) DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `end_hour` varchar(2) DEFAULT NULL,
  `end_minutes` varchar(2) DEFAULT NULL,
  `enabled` tinyint(1) DEFAULT '0',
  `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_shift_exceptions_skey` (`sync_key`),
  KEY `idx_shift_exceptions_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_shift_exceptions_id_del` (`id`,`deleted`),
  KEY `idx_shift_exceptions_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_shift_exceptions_name_del` (`name`,`deleted`),
  KEY `idx_shift_exceptions_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_shift_exceptions_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_shift_exceptions_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `shift_exceptions_audit`
--

CREATE TABLE `shift_exceptions_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_shift_exceptions_audit_event_id` (`event_id`),
  KEY `idx_shift_exceptions_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_shift_exceptions_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `shift_exceptions_users`
--

CREATE TABLE `shift_exceptions_users` (
  `id` char(36) NOT NULL,
  `shift_exception_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 `shift_exceptions_idx_user_id` (`shift_exception_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `shifts`
--

CREATE TABLE `shifts` (
  `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,
  `date_start` date DEFAULT NULL,
  `date_end` date 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,
  `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,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_shifts_skey` (`sync_key`),
  KEY `idx_shifts_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_shifts_id_del` (`id`,`deleted`),
  KEY `idx_shifts_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_shifts_name_del` (`name`,`deleted`),
  KEY `idx_shifts_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_shifts_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_shifts_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `shifts_audit`
--

CREATE TABLE `shifts_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_shifts_audit_event_id` (`event_id`),
  KEY `idx_shifts_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_shifts_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `shifts_users`
--

CREATE TABLE `shifts_users` (
  `id` char(36) NOT NULL,
  `shift_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 `shift_idx_user_id` (`shift_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `shippers`
--

CREATE TABLE `shippers` (
  `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,
  `default_cost` decimal(26,6) DEFAULT NULL,
  `default_cost_usdollar` decimal(26,6) DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL,
  `description` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_shippers_skey` (`sync_key`),
  KEY `idx_shippers` (`name`,`deleted`),
  KEY `idx_shippers_date_modfied` (`date_modified`),
  KEY `idx_shippers_id_del` (`id`,`deleted`),
  KEY `idx_shippers_date_entered` (`date_entered`),
  KEY `idx_shippers_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_shippers_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `smartlist`
--

CREATE TABLE `smartlist` (
  `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',
  `prospect_list_id` char(36) DEFAULT NULL,
  `active` tinyint(1) DEFAULT '1',
  `type` varchar(255) DEFAULT NULL,
  `metadata` text,
  `query` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_smartlist_skey` (`sync_key`),
  KEY `idx_smartlist_date_modfied` (`date_modified`),
  KEY `idx_smartlist_id_del` (`id`,`deleted`),
  KEY `idx_smartlist_date_entered` (`date_entered`),
  KEY `idx_smartlist_name_del` (`name`,`deleted`),
  KEY `idx_smartlist_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_smartlist_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `smartlist_queue`
--

CREATE TABLE `smartlist_queue` (
  `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',
  `module` varchar(255) DEFAULT NULL,
  `record` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_smartlist_queue_skey` (`sync_key`),
  KEY `idx_smartlist_queue_date_modfied` (`date_modified`),
  KEY `idx_smartlist_queue_id_del` (`id`,`deleted`),
  KEY `idx_smartlist_queue_date_entered` (`date_entered`),
  KEY `idx_smartlist_queue_name_del` (`name`,`deleted`),
  KEY `idx_smartlist_queue_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_smartlist_queue_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `styleguide`
--

CREATE TABLE `styleguide` (
  `salutation` varchar(255) DEFAULT NULL,
  `first_name` varchar(255) DEFAULT NULL,
  `last_name` varchar(255) DEFAULT NULL,
  `title` varchar(255) 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',
  `assigned_user_id` char(36) DEFAULT NULL,
  `parent_type` varchar(255) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `file_mime_type` varchar(100) DEFAULT NULL,
  `filename` varchar(255) DEFAULT NULL,
  `currency_id` char(36) DEFAULT '-99',
  `list_price` decimal(26,6) DEFAULT NULL,
  `website` varchar(255) DEFAULT NULL,
  `birthdate` date DEFAULT NULL,
  `secret_password` varchar(255) DEFAULT NULL,
  `date_start` datetime DEFAULT NULL,
  `radio_button_group` varchar(255) DEFAULT NULL,
  `user_email` varchar(100) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_styleguide_skey` (`sync_key`),
  KEY `styleguidemod` (`date_modified`),
  KEY `idx_styleguide_id_del` (`id`,`deleted`),
  KEY `idx_styleguide_date_entered` (`date_entered`),
  KEY `idx_styleguide_last_first` (`last_name`,`first_name`,`deleted`),
  KEY `idx_styleguide_first_last` (`first_name`,`last_name`,`deleted`),
  KEY `idx_styleguide_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_styleguide_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_styleguide_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `subscriptions`
--

CREATE TABLE `subscriptions` (
  `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_type` varchar(100) DEFAULT NULL,
  `parent_id` char(36) NOT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_subscriptions_skey` (`sync_key`),
  KEY `subscriptionsmod` (`date_modified`),
  KEY `subscription_parent` (`parent_id`),
  KEY `idx_subscriptions_id_del` (`id`,`deleted`),
  KEY `idx_subscriptions_date_entered` (`date_entered`),
  KEY `idx_subscriptions_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_subscriptions_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugar_live`
--

CREATE TABLE `sugar_live` (
  `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,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sugar_live_skey` (`sync_key`),
  KEY `idx_sugar_live_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_sugar_live_id_del` (`id`,`deleted`),
  KEY `idx_sugar_live_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_sugar_live_name_del` (`name`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimp`
--

CREATE TABLE `sugarchimp` (
  `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',
  `mailchimp_list_id` varchar(255) DEFAULT NULL,
  `param1` varchar(255) DEFAULT NULL,
  `param2` varchar(255) DEFAULT NULL,
  `param3` varchar(255) DEFAULT NULL,
  `param4` varchar(255) DEFAULT NULL,
  `param5` varchar(255) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sugarchimp_skey` (`sync_key`),
  KEY `idx_sugarchimp_date_modfied` (`date_modified`),
  KEY `idx_sugarchimp_id_del` (`id`,`deleted`),
  KEY `idx_sugarchimp_date_entered` (`date_entered`),
  KEY `idx_sugarchimp_name_del` (`name`,`deleted`),
  KEY `idx_sugarchimp_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_sugarchimp_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimp_activity_tracker`
--

CREATE TABLE `sugarchimp_activity_tracker` (
  `id` char(36) NOT NULL,
  `mailchimp_list_id` varchar(64) DEFAULT NULL,
  `mailchimp_campaign_id` varchar(64) DEFAULT NULL,
  `initial_sync` tinyint(1) DEFAULT '0',
  `start_date` datetime DEFAULT NULL,
  `last_sync` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimp_backup_queue`
--

CREATE TABLE `sugarchimp_backup_queue` (
  `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',
  `mailchimp_list_id` varchar(255) DEFAULT NULL,
  `data` longtext,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sugarchimp_backup_queue_skey` (`sync_key`),
  KEY `idx_sugarchimp_backup_queue_date_modfied` (`date_modified`),
  KEY `idx_sugarchimp_backup_queue_id_del` (`id`,`deleted`),
  KEY `idx_sugarchimp_backup_queue_date_entered` (`date_entered`),
  KEY `idx_sugarchimp_backup_queue_name_del` (`name`,`deleted`),
  KEY `idx_sugarchimp_backup_queue_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_sugarchimp_backup_queue_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimp_batches`
--

CREATE TABLE `sugarchimp_batches` (
  `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',
  `batch_id` varchar(255) DEFAULT NULL,
  `mailchimp_list_id` varchar(255) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sugarchimp_batches_skey` (`sync_key`),
  KEY `idx_sugarchimp_batches_date_modfied` (`date_modified`),
  KEY `idx_sugarchimp_batches_id_del` (`id`,`deleted`),
  KEY `idx_sugarchimp_batches_date_entered` (`date_entered`),
  KEY `idx_sugarchimp_batches_name_del` (`name`,`deleted`),
  KEY `idx_sugarchimp_batches_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_sugarchimp_batches_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimp_lock`
--

CREATE TABLE `sugarchimp_lock` (
  `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',
  `email` varchar(255) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sugarchimp_lock_skey` (`sync_key`),
  KEY `idx_sugarchimp_lock_date_modfied` (`date_modified`),
  KEY `idx_sugarchimp_lock_id_del` (`id`,`deleted`),
  KEY `idx_sugarchimp_lock_date_entered` (`date_entered`),
  KEY `idx_sugarchimp_lock_name_del` (`name`,`deleted`),
  KEY `idx_sugarchimp_lock_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_sugarchimp_lock_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimp_mailchimp_backup`
--

CREATE TABLE `sugarchimp_mailchimp_backup` (
  `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',
  `mailchimp_list_id` varchar(255) DEFAULT NULL,
  `data` longtext,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sugarchimp_mailchimp_backup_skey` (`sync_key`),
  KEY `idx_sugarchimp_mailchimp_backup_date_modfied` (`date_modified`),
  KEY `idx_sugarchimp_mailchimp_backup_id_del` (`id`,`deleted`),
  KEY `idx_sugarchimp_mailchimp_backup_date_entered` (`date_entered`),
  KEY `idx_sugarchimp_mailchimp_backup_name_del` (`name`,`deleted`),
  KEY `idx_sugarchimp_mailchimp_backup_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_sugarchimp_mailchimp_backup_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimp_mc`
--

CREATE TABLE `sugarchimp_mc` (
  `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',
  `mailchimp_list_id` varchar(255) DEFAULT NULL,
  `data` longtext,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sugarchimp_mc_skey` (`sync_key`),
  KEY `idx_sugarchimp_mc_date_modfied` (`date_modified`),
  KEY `idx_sugarchimp_mc_id_del` (`id`,`deleted`),
  KEY `idx_sugarchimp_mc_date_entered` (`date_entered`),
  KEY `idx_sugarchimp_mc_name_del` (`name`,`deleted`),
  KEY `idx_sugarchimp_mc_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_sugarchimp_mc_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimp_mc_activity`
--

CREATE TABLE `sugarchimp_mc_activity` (
  `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',
  `mailchimp_campaign_id` varchar(255) DEFAULT NULL,
  `mailchimp_list_id` varchar(255) DEFAULT NULL,
  `include_empty` tinyint(1) DEFAULT '0',
  `data` longtext,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sugarchimp_mc_activity_skey` (`sync_key`),
  KEY `idx_sugarchimp_mc_activity_date_modfied` (`date_modified`),
  KEY `idx_sugarchimp_mc_activity_id_del` (`id`,`deleted`),
  KEY `idx_sugarchimp_mc_activity_date_entered` (`date_entered`),
  KEY `idx_sugarchimp_mc_activity_name_del` (`name`,`deleted`),
  KEY `sugarchimp_mc_activity_next_mc_list_id` (`mailchimp_list_id`,`date_entered`),
  KEY `idx_sugarchimp_mc_activity_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_sugarchimp_mc_activity_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimp_mc_campaign`
--

CREATE TABLE `sugarchimp_mc_campaign` (
  `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(255) DEFAULT NULL,
  `mailchimp_campaign_id` varchar(255) DEFAULT NULL,
  `mailchimp_list_id` varchar(255) DEFAULT NULL,
  `type` varchar(50) DEFAULT NULL,
  `send_time` datetime DEFAULT NULL,
  `archive_url` varchar(2048) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sugarchimp_mc_campaign_skey` (`sync_key`),
  KEY `idx_sugarchimp_mc_campaign_date_modfied` (`date_modified`),
  KEY `idx_sugarchimp_mc_campaign_id_del` (`id`,`deleted`),
  KEY `idx_sugarchimp_mc_campaign_date_entered` (`date_entered`),
  KEY `idx_sugarchimp_mc_campaign_name_del` (`name`,`deleted`),
  KEY `idx_sugarchimp_mc_campaign_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_sugarchimp_mc_campaign_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimp_mc_cleaned_email`
--

CREATE TABLE `sugarchimp_mc_cleaned_email` (
  `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',
  `mailchimp_list_id` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sugarchimp_mc_cleaned_email_skey` (`sync_key`),
  KEY `idx_sugarchimp_mc_cleaned_email_date_modfied` (`date_modified`),
  KEY `idx_sugarchimp_mc_cleaned_email_id_del` (`id`,`deleted`),
  KEY `idx_sugarchimp_mc_cleaned_email_date_entered` (`date_entered`),
  KEY `idx_sugarchimp_mc_cleaned_email_name_del` (`name`,`deleted`),
  KEY `idx_sugarchimp_mc_cleaned_email_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_sugarchimp_mc_cleaned_email_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimp_mc_list`
--

CREATE TABLE `sugarchimp_mc_list` (
  `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',
  `mailchimp_list_id` varchar(255) DEFAULT NULL,
  `deleted_from_mailchimp` tinyint(1) DEFAULT '0',
  `optout_tracker_processed` tinyint(1) DEFAULT '0',
  `optout_tracker_offset` int(11) DEFAULT '0',
  `last_cleaned_email_check` datetime DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sugarchimp_mc_list_skey` (`sync_key`),
  KEY `idx_sugarchimp_mc_list_date_modfied` (`date_modified`),
  KEY `idx_sugarchimp_mc_list_id_del` (`id`,`deleted`),
  KEY `idx_sugarchimp_mc_list_date_entered` (`date_entered`),
  KEY `idx_sugarchimp_mc_list_name_del` (`name`,`deleted`),
  KEY `idx_mailchimp_list_id` (`mailchimp_list_id`),
  KEY `idx_sugarchimp_mc_list_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_sugarchimp_mc_list_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimp_mc_people`
--

CREATE TABLE `sugarchimp_mc_people` (
  `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',
  `mailchimp_list_id` varchar(255) DEFAULT NULL,
  `data` longtext,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sugarchimp_mc_people_skey` (`sync_key`),
  KEY `idx_sugarchimp_mc_people_date_modfied` (`date_modified`),
  KEY `idx_sugarchimp_mc_people_id_del` (`id`,`deleted`),
  KEY `idx_sugarchimp_mc_people_date_entered` (`date_entered`),
  KEY `idx_sugarchimp_mc_people_name_del` (`name`,`deleted`),
  KEY `idx_sugarchimp_mc_people_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_sugarchimp_mc_people_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimp_optout_tracker`
--

CREATE TABLE `sugarchimp_optout_tracker` (
  `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',
  `email` varchar(255) DEFAULT NULL,
  `mailchimp_list_id` varchar(255) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sugarchimp_optout_tracker_skey` (`sync_key`),
  KEY `idx_sugarchimp_optout_tracker_date_modfied` (`date_modified`),
  KEY `idx_sugarchimp_optout_tracker_id_del` (`id`,`deleted`),
  KEY `idx_sugarchimp_optout_tracker_date_entered` (`date_entered`),
  KEY `idx_sugarchimp_optout_tracker_name_del` (`name`,`deleted`),
  KEY `idx_sugarchimp_optout_tracker_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_sugarchimp_optout_tracker_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimp_sugar_backup`
--

CREATE TABLE `sugarchimp_sugar_backup` (
  `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` char(36) DEFAULT NULL,
  `module` varchar(255) DEFAULT NULL,
  `data` longtext,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sugarchimp_sugar_backup_skey` (`sync_key`),
  KEY `idx_sugarchimp_sugar_backup_date_modfied` (`date_modified`),
  KEY `idx_sugarchimp_sugar_backup_id_del` (`id`,`deleted`),
  KEY `idx_sugarchimp_sugar_backup_date_entered` (`date_entered`),
  KEY `idx_sugarchimp_sugar_backup_name_del` (`name`,`deleted`),
  KEY `idx_sugarchimp_sugar_backup_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_sugarchimp_sugar_backup_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimpactivity`
--

CREATE TABLE `sugarchimpactivity` (
  `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',
  `activity` varchar(50) DEFAULT NULL,
  `timestamp` datetime DEFAULT NULL,
  `url` varchar(2048) DEFAULT NULL,
  `ip` varchar(32) DEFAULT NULL,
  `mailchimp_list_id` varchar(255) DEFAULT NULL,
  `mailchimp_campaign_id` varchar(255) DEFAULT NULL,
  `include_empty` tinyint(1) DEFAULT '0',
  `assigned_user_id` char(36) DEFAULT NULL,
  `sugarchimpmclist_id` char(36) DEFAULT NULL,
  `sugarchimpmccampaign_id` char(255) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sugarchimpactivity_skey` (`sync_key`),
  KEY `idx_sugarchimpactivity_date_modfied` (`date_modified`),
  KEY `idx_sugarchimpactivity_id_del` (`id`,`deleted`),
  KEY `idx_sugarchimpactivity_date_entered` (`date_entered`),
  KEY `idx_sugarchimpactivity_name_del` (`name`,`deleted`),
  KEY `sugarchimpactivity_activity` (`activity`),
  KEY `sugarchimpactivity_mailchimp_list_id` (`mailchimp_list_id`),
  KEY `sugarchimpactivity_mailchimp_campaign_id` (`mailchimp_campaign_id`),
  KEY `idx_sugarchimpactivity_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_sugarchimpactivity_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_sugarchimpactivity_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimpactivity_accounts`
--

CREATE TABLE `sugarchimpactivity_accounts` (
  `id` varchar(36) NOT NULL,
  `sugarchimpactivity_id` varchar(36) DEFAULT NULL,
  `account_id` varchar(36) DEFAULT NULL,
  `date_created` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_entered` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sugarchimpactivity_accounts_idxa` (`sugarchimpactivity_id`),
  KEY `sugarchimpactivity_accounts_idxb` (`account_id`),
  KEY `sugarchimpactivity_accounts_idx` (`sugarchimpactivity_id`,`account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimpactivity_audit`
--

CREATE TABLE `sugarchimpactivity_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_sugarchimpactivity_audit_parent_id` (`parent_id`),
  KEY `idx_sugarchimpactivity_audit_event_id` (`event_id`),
  KEY `idx_sugarchimpactivity_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_sugarchimpactivity_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimpactivity_contacts`
--

CREATE TABLE `sugarchimpactivity_contacts` (
  `id` varchar(36) NOT NULL,
  `sugarchimpactivity_id` varchar(36) DEFAULT NULL,
  `contact_id` varchar(36) DEFAULT NULL,
  `date_created` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_entered` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sugarchimpactivity_contacts_idxa` (`sugarchimpactivity_id`),
  KEY `sugarchimpactivity_contacts_idxb` (`contact_id`),
  KEY `sugarchimpactivity_contacts_idx` (`sugarchimpactivity_id`,`contact_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimpactivity_leads`
--

CREATE TABLE `sugarchimpactivity_leads` (
  `id` varchar(36) NOT NULL,
  `sugarchimpactivity_id` varchar(36) DEFAULT NULL,
  `lead_id` varchar(36) DEFAULT NULL,
  `date_created` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_entered` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sugarchimpactivity_leads_idxa` (`sugarchimpactivity_id`),
  KEY `sugarchimpactivity_leads_idxb` (`lead_id`),
  KEY `sugarchimpactivity_leads_idx` (`sugarchimpactivity_id`,`lead_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarchimpactivity_prospects`
--

CREATE TABLE `sugarchimpactivity_prospects` (
  `id` varchar(36) NOT NULL,
  `sugarchimpactivity_id` varchar(36) DEFAULT NULL,
  `prospect_id` varchar(36) DEFAULT NULL,
  `date_created` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_entered` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sugarchimpactivity_prospects_idxa` (`sugarchimpactivity_id`),
  KEY `sugarchimpactivity_prospects_idxb` (`prospect_id`),
  KEY `sugarchimpactivity_prospects_idx` (`sugarchimpactivity_id`,`prospect_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `sugarfavorites`
--

CREATE TABLE `sugarfavorites` (
  `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` varchar(50) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `assigned_user_id` char(36) DEFAULT NULL,
  `module` varchar(50) DEFAULT NULL,
  `record_id` char(36) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sugarfavorites_skey` (`sync_key`),
  KEY `sugarfavoritesmod` (`date_modified`),
  KEY `idx_favs_date_entered` (`date_entered`,`deleted`),
  KEY `idx_favs_user_module` (`modified_user_id`,`module`,`deleted`),
  KEY `idx_favs_module_record_deleted` (`module`,`record_id`,`deleted`),
  KEY `idx_favs_id_record_id` (`record_id`,`id`),
  KEY `idx_sugarfavorites_id_del` (`id`,`deleted`),
  KEY `idx_sugarfavorites_date_entered` (`date_entered`),
  KEY `idx_sugarfavorites_name_del` (`name`,`deleted`),
  KEY `idx_sugarfavorites_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_sugarfavorites_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_sugarfavorites_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `syno_dashboardtemplatefilters`
--

CREATE TABLE `syno_dashboardtemplatefilters` (
  `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',
  `assigned_user_id` char(36) DEFAULT NULL,
  `original_filter_id` varchar(255) DEFAULT NULL,
  `filter_definition` mediumtext,
  `filter_template` mediumtext,
  `module_name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_syno_dashboardtemplatefilters_date_modfied` (`date_modified`),
  KEY `idx_syno_dashboardtemplatefilters_id_del` (`id`,`deleted`),
  KEY `idx_syno_dashboardtemplatefilters_date_entered` (`date_entered`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `syno_dashboardtemplatefilters_audit`
--

CREATE TABLE `syno_dashboardtemplatefilters_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_syno_dashboardtemplatefilters_audit_parent_id` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `syno_dashboardtemplatehistory`
--

CREATE TABLE `syno_dashboardtemplatehistory` (
  `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',
  `assigned_user_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_syno_dashboardtemplatehistory_date_modfied` (`date_modified`),
  KEY `idx_syno_dashboardtemplatehistory_id_del` (`id`,`deleted`),
  KEY `idx_syno_dashboardtemplatehistory_date_entered` (`date_entered`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `syno_dashboardtemplatehistory_audit`
--

CREATE TABLE `syno_dashboardtemplatehistory_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_syno_dashboardtemplatehistory_audit_parent_id` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `syno_dashboardtemplatehistory_syno_dashboardtemplates_c`
--

CREATE TABLE `syno_dashboardtemplatehistory_syno_dashboardtemplates_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `syno_dashb4d41mplates_ida` varchar(36) DEFAULT NULL,
  `syno_dashb25f5history_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `syno_dashboardtemplatehistory_syno_dashboardtemplates_ida1` (`syno_dashb4d41mplates_ida`),
  KEY `syno_dashboardtemplatehistory_syno_dashboardtemplates_alt` (`syno_dashb25f5history_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `syno_dashboardtemplatehistory_users_c`
--

CREATE TABLE `syno_dashboardtemplatehistory_users_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `syno_dashboardtemplatehistory_usersusers_ida` varchar(36) DEFAULT NULL,
  `syno_dashb8a60history_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `syno_dashboardtemplatehistory_users_ida1` (`syno_dashboardtemplatehistory_usersusers_ida`),
  KEY `syno_dashboardtemplatehistory_users_alt` (`syno_dashb8a60history_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `syno_dashboardtemplatelines`
--

CREATE TABLE `syno_dashboardtemplatelines` (
  `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',
  `assigned_user_id` char(36) DEFAULT NULL,
  `template_dashboard_type` varchar(255) DEFAULT NULL,
  `template_name` varchar(255) DEFAULT NULL,
  `template_dashboard_module` varchar(255) DEFAULT NULL,
  `template_view` varchar(255) DEFAULT NULL,
  `template_metadata` mediumtext,
  PRIMARY KEY (`id`),
  KEY `idx_syno_dashboardtemplatelines_date_modfied` (`date_modified`),
  KEY `idx_syno_dashboardtemplatelines_id_del` (`id`,`deleted`),
  KEY `idx_syno_dashboardtemplatelines_date_entered` (`date_entered`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `syno_dashboardtemplatelines_audit`
--

CREATE TABLE `syno_dashboardtemplatelines_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_syno_dashboardtemplatelines_audit_parent_id` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `syno_dashboardtemplatelines_syno_dashboardtemplates_c`
--

CREATE TABLE `syno_dashboardtemplatelines_syno_dashboardtemplates_c` (
  `id` varchar(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `syno_dashbb94dmplates_ida` varchar(36) DEFAULT NULL,
  `syno_dashb419atelines_idb` varchar(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `syno_dashboardtemplatelines_syno_dashboardtemplates_ida1` (`syno_dashbb94dmplates_ida`),
  KEY `syno_dashboardtemplatelines_syno_dashboardtemplates_alt` (`syno_dashb419atelines_idb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `syno_dashboardtemplates`
--

CREATE TABLE `syno_dashboardtemplates` (
  `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',
  `assigned_user_id` char(36) DEFAULT NULL,
  `template_data` mediumtext,
  `flag_data` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_syno_dashboardtemplates_date_modfied` (`date_modified`),
  KEY `idx_syno_dashboardtemplates_id_del` (`id`,`deleted`),
  KEY `idx_syno_dashboardtemplates_date_entered` (`date_entered`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `syno_dashboardtemplates_audit`
--

CREATE TABLE `syno_dashboardtemplates_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_syno_dashboardtemplates_audit_parent_id` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `system_process_lock`
--

CREATE TABLE `system_process_lock` (
  `unique_id` varchar(255) NOT NULL DEFAULT '',
  `additional_key` varchar(255) NOT NULL DEFAULT '',
  `date_expires` datetime DEFAULT NULL,
  PRIMARY KEY (`unique_id`,`additional_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `systems`
--

CREATE TABLE `systems` (
  `id` char(36) NOT NULL,
  `system_id` int(11) NOT NULL AUTO_INCREMENT,
  `system_key` varchar(36) DEFAULT NULL,
  `user_id` char(36) DEFAULT NULL,
  `last_connect_date` datetime DEFAULT NULL,
  `status` varchar(255) DEFAULT 'Active',
  `num_syncs` int(11) DEFAULT '0',
  `system_name` varchar(100) DEFAULT NULL,
  `install_method` varchar(100) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `system_id` (`system_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `tag_bean_rel`
--

CREATE TABLE `tag_bean_rel` (
  `id` char(36) NOT NULL,
  `tag_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_tagsrel_tagid_beanid` (`tag_id`,`bean_id`),
  KEY `idx_tag_bean_rel_del_bean_module_beanid` (`deleted`,`bean_module`,`bean_id`),
  KEY `idx_del_tagid_beanid` (`deleted`,`tag_id`,`bean_id`),
  KEY `idx_bid_tid_bm_del` (`bean_id`,`tag_id`,`bean_module`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `tags`
--

CREATE TABLE `tags` (
  `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',
  `name_lower` 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,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_tags_skey` (`sync_key`),
  KEY `idx_tags_date_modfied` (`date_modified`),
  KEY `idx_tags_id_del` (`id`,`deleted`),
  KEY `idx_tags_date_entered` (`date_entered`),
  KEY `idx_tags_name_del` (`name`,`deleted`),
  KEY `idx_tag_name` (`name`),
  KEY `idx_tag_name_lower` (`name_lower`),
  KEY `idx_tags_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_tags_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_tags_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `tags_audit`
--

CREATE TABLE `tags_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_tags_audit_event_id` (`event_id`),
  KEY `idx_tags_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_tags_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `target_list_updater_queue`
--

CREATE TABLE `target_list_updater_queue` (
  `id` char(36) NOT NULL,
  `prospect_list_id` char(36) NOT NULL,
  `bean_id` char(36) NOT NULL,
  `mod_name` char(36) NOT NULL,
  `oper_type` char(36) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `prospect_list_id` (`prospect_list_id`,`bean_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

CREATE TABLE `tasks` (
  `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,
  `status` varchar(100) DEFAULT '',
  `date_due_flag` tinyint(1) DEFAULT '0',
  `date_due` datetime DEFAULT NULL,
  `date_start_flag` tinyint(1) DEFAULT '0',
  `date_start` datetime DEFAULT NULL,
  `parent_type` varchar(255) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `contact_id` char(36) DEFAULT NULL,
  `priority` varchar(100) 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_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,
  `cj_activity_start_date` datetime DEFAULT NULL,
  `cj_activity_completion_date` datetime DEFAULT NULL,
  `cj_days_to_complete` varchar(255) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  `dri_workflow_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_tasks_skey` (`sync_key`),
  KEY `tasksmod` (`date_modified`),
  KEY `idx_task_con_del` (`contact_id`,`deleted`),
  KEY `idx_task_par_del` (`parent_id`,`parent_type`,`deleted`),
  KEY `idx_task_status` (`status`),
  KEY `idx_task_date_due` (`date_due`),
  KEY `idx_task_date_entered` (`date_entered`),
  KEY `idx_tasks_id_del` (`id`,`deleted`),
  KEY `idx_tasks_name_del` (`name`,`deleted`),
  KEY `idx_tasks_assigned_del` (`assigned_user_id`,`deleted`),
  KEY `idx_task_cj_journey_tpl_id` (`dri_workflow_template_id`),
  KEY `idx_task_cj_stage_tpl_id` (`dri_subworkflow_template_id`),
  KEY `idx_task_cj_activity_tpl_id` (`dri_workflow_task_template_id`),
  KEY `idx_task_cj_stage_id` (`dri_subworkflow_id`),
  KEY `idx_task_cj_parent_activity` (`deleted`,`cj_parent_activity_id`,`cj_parent_activity_type`),
  KEY `idx_tasks_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_tasks_acl_tmst_id` (`acl_team_set_id`,`deleted`),
  KEY `idx_tasks_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_tasks_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_tsk_name` (`deleted`,`name`,`date_modified`),
  KEY `idx_task_cj_journey_id` (`dri_workflow_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `tasks_audit`
--

CREATE TABLE `tasks_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_tasks_audit_event_id` (`event_id`),
  KEY `idx_tasks_audit_pa_ev_id` (`parent_id`,`event_id`),
  KEY `idx_tasks_audit_after_value` (`after_value_string`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `tasks_cstm`
--

CREATE TABLE `tasks_cstm` (
  `id_c` char(36) NOT NULL,
  `phase_c` varchar(100) DEFAULT NULL,
  `theme_c` varchar(100) DEFAULT NULL,
  `checklist_url_c` varchar(255) DEFAULT '',
  `show_in_portal_c` tinyint(1) DEFAULT '0',
  `checklist_cta_label_c` varchar(50) DEFAULT '',
  `completed_description_c` text,
  `notes_required_c` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id_c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `taxrates`
--

CREATE TABLE `taxrates` (
  `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,
  `value` decimal(26,6) 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_taxrates_skey` (`sync_key`),
  KEY `idx_taxrates` (`name`,`deleted`),
  KEY `idx_taxrates_date_modfied` (`date_modified`),
  KEY `idx_taxrates_id_del` (`id`,`deleted`),
  KEY `idx_taxrates_date_entered` (`date_entered`),
  KEY `idx_taxrates_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_taxrates_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `team_memberships`
--

CREATE TABLE `team_memberships` (
  `id` char(36) NOT NULL,
  `team_id` char(36) DEFAULT NULL,
  `user_id` char(36) DEFAULT NULL,
  `explicit_assign` tinyint(1) DEFAULT '0',
  `implicit_assign` tinyint(1) DEFAULT '0',
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_team_membership` (`user_id`,`team_id`),
  KEY `idx_teammemb_team_user` (`team_id`,`user_id`),
  KEY `idx_del_team_user` (`deleted`,`team_id`,`user_id`),
  KEY `idx_del_dateentered` (`deleted`,`user_id`,`team_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `team_notices`
--

CREATE TABLE `team_notices` (
  `team_id` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `id` char(36) NOT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `date_start` date DEFAULT NULL,
  `date_end` date DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `name` varchar(50) DEFAULT NULL,
  `description` text,
  `status` varchar(100) DEFAULT NULL,
  `url` varchar(255) DEFAULT NULL,
  `url_title` varchar(255) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_team_notice` (`name`,`deleted`),
  KEY `idx_team_notices_tmst_id` (`team_set_id`,`deleted`),
  KEY `idx_team_notices_acl_tmst_id` (`acl_team_set_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `team_set_events`
--

CREATE TABLE `team_set_events` (
  `id` char(36) NOT NULL,
  `action` varchar(100) DEFAULT NULL,
  `params` text,
  `date_created` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `team_sets`
--

CREATE TABLE `team_sets` (
  `id` char(36) NOT NULL,
  `name` varchar(128) DEFAULT NULL,
  `team_md5` varchar(32) DEFAULT NULL,
  `team_count` int(11) DEFAULT '0',
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `created_by` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_team_sets_md5` (`team_md5`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `team_sets_modules`
--

CREATE TABLE `team_sets_modules` (
  `id` char(36) NOT NULL,
  `team_set_id` char(36) NOT NULL,
  `module_table_name` varchar(128) NOT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_team_sets_modules` (`team_set_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `team_sets_teams`
--

CREATE TABLE `team_sets_teams` (
  `id` char(36) NOT NULL,
  `team_set_id` char(36) NOT NULL,
  `team_id` char(36) NOT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_ud_set_id` (`team_set_id`,`team_id`),
  KEY `idx_ud_team_id` (`team_id`),
  KEY `idx_ud_team_set_id` (`team_set_id`),
  KEY `idx_ud_team_id_team_set_id` (`team_id`,`team_set_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `team_sets_users_1`
--

CREATE TABLE `team_sets_users_1` (
  `team_set_id` char(36) NOT NULL,
  `user_id` char(36) NOT NULL,
  PRIMARY KEY (`team_set_id`,`user_id`),
  KEY `idx_tud1_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `team_sets_users_2`
--

CREATE TABLE `team_sets_users_2` (
  `team_set_id` char(36) NOT NULL,
  `user_id` char(36) NOT NULL,
  PRIMARY KEY (`team_set_id`,`user_id`),
  KEY `idx_tud2_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `teams`
--

CREATE TABLE `teams` (
  `id` char(36) NOT NULL,
  `name` varchar(128) 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',
  `name_2` varchar(128) DEFAULT NULL,
  `associated_user_id` char(36) DEFAULT NULL,
  `private` tinyint(1) DEFAULT '0',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_teams_skey` (`sync_key`),
  KEY `teamsmod` (`date_modified`),
  KEY `idx_team_del` (`name`),
  KEY `idx_team_del_name` (`deleted`,`name`),
  KEY `idx_teams_id_del` (`id`,`deleted`),
  KEY `idx_teams_date_entered` (`date_entered`),
  KEY `idx_teams_name_del` (`name`,`deleted`),
  KEY `idx_teams_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_teams_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `time_aware_schedules`
--

CREATE TABLE `time_aware_schedules` (
  `id` char(36) NOT NULL,
  `next_run` datetime DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `module` varchar(255) DEFAULT NULL,
  `bean_id` char(36) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `timeperiods`
--

CREATE TABLE `timeperiods` (
  `id` char(36) NOT NULL,
  `name` varchar(36) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `start_date_timestamp` int(14) DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `end_date_timestamp` int(14) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  `is_fiscal` tinyint(1) DEFAULT '0',
  `is_fiscal_year` tinyint(1) DEFAULT '0',
  `leaf_cycle` int(2) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `tracker`
--

CREATE TABLE `tracker` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `monitor_id` char(36) NOT NULL,
  `user_id` char(36) DEFAULT NULL,
  `module_name` varchar(255) DEFAULT NULL,
  `item_id` char(36) DEFAULT NULL,
  `item_summary` varchar(255) DEFAULT NULL,
  `team_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `action` varchar(255) DEFAULT NULL,
  `session_id` char(36) DEFAULT NULL,
  `visible` tinyint(1) DEFAULT '0',
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_tracker_iid` (`item_id`),
  KEY `idx_tracker_userid_vis_id` (`user_id`,`visible`,`id`),
  KEY `idx_tracker_userid_itemid_vis` (`user_id`,`item_id`,`visible`),
  KEY `idx_tracker_monitor_id` (`monitor_id`),
  KEY `idx_tracker_date_modified` (`date_modified`),
  KEY `idx_trckr_mod_uid_dtmod_item` (`module_name`,`user_id`,`date_modified`,`item_id`),
  KEY `idx_tracker_userid_del_vis` (`user_id`,`deleted`,`visible`)
) ENGINE=InnoDB AUTO_INCREMENT=205421162 DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `tracker_perf`
--

CREATE TABLE `tracker_perf` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `monitor_id` char(36) NOT NULL,
  `server_response_time` double DEFAULT NULL,
  `db_round_trips` int(6) DEFAULT NULL,
  `files_opened` int(6) DEFAULT NULL,
  `memory_usage` int(12) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_modified` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_tracker_perf_mon_id` (`monitor_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `tracker_queries`
--

CREATE TABLE `tracker_queries` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `query_id` char(36) NOT NULL,
  `text` text,
  `query_hash` varchar(36) DEFAULT NULL,
  `sec_total` double DEFAULT NULL,
  `sec_avg` double DEFAULT NULL,
  `run_count` int(6) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_modified` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_tracker_queries_query_hash` (`query_hash`),
  KEY `idx_tracker_queries_query_id` (`query_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `tracker_sessions`
--

CREATE TABLE `tracker_sessions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `session_id` char(36) DEFAULT NULL,
  `date_start` datetime DEFAULT NULL,
  `date_end` datetime DEFAULT NULL,
  `seconds` int(9) DEFAULT '0',
  `client_ip` varchar(45) DEFAULT NULL,
  `user_id` char(36) DEFAULT NULL,
  `active` tinyint(1) DEFAULT '1',
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_tracker_sessions_s_id` (`session_id`),
  KEY `idx_tracker_sessions_uas_id` (`user_id`,`active`,`session_id`),
  KEY `idx_tracker_sessions_active_date` (`active`,`date_end`)
) ENGINE=InnoDB AUTO_INCREMENT=123790 DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `tracker_tracker_queries`
--

CREATE TABLE `tracker_tracker_queries` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `monitor_id` char(36) DEFAULT NULL,
  `query_id` char(36) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_tracker_tq_monitor` (`monitor_id`),
  KEY `idx_tracker_tq_query` (`query_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `upgrade_history`
--

CREATE TABLE `upgrade_history` (
  `id` char(36) NOT NULL,
  `filename` varchar(255) DEFAULT NULL,
  `md5sum` varchar(32) DEFAULT NULL,
  `type` varchar(30) DEFAULT NULL,
  `status` varchar(50) DEFAULT NULL,
  `version` varchar(64) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `id_name` varchar(255) DEFAULT NULL,
  `manifest` longtext,
  `date_entered` datetime DEFAULT NULL,
  `enabled` tinyint(1) DEFAULT '1',
  `patch` text,
  `date_modified` datetime DEFAULT NULL,
  `published_date` varchar(50) DEFAULT NULL,
  `uninstallable` tinyint(1) DEFAULT '1',
  `deleted` tinyint(1) DEFAULT '0',
  `process_status` text,
  PRIMARY KEY (`id`),
  UNIQUE KEY `upgrade_history_md5_uk` (`md5sum`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `user_preferences`
--

CREATE TABLE `user_preferences` (
  `id` char(36) NOT NULL,
  `category` varchar(50) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `contents` longtext,
  PRIMARY KEY (`id`),
  KEY `idx_userprefnamecat` (`assigned_user_id`,`category`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` char(36) NOT NULL,
  `user_name` varchar(60) DEFAULT NULL,
  `user_hash` varchar(255) DEFAULT NULL,
  `system_generated_password` tinyint(1) DEFAULT NULL,
  `pwd_last_changed` datetime DEFAULT NULL,
  `authenticate_id` varchar(100) DEFAULT NULL,
  `sugar_login` tinyint(1) DEFAULT '1',
  `picture` varchar(255) DEFAULT NULL,
  `first_name` varchar(30) DEFAULT NULL,
  `last_name` varchar(30) DEFAULT NULL,
  `is_admin` tinyint(1) DEFAULT '0',
  `external_auth_only` tinyint(1) DEFAULT '0',
  `receive_notifications` tinyint(1) DEFAULT '1',
  `description` text,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `title` varchar(50) DEFAULT NULL,
  `department` varchar(50) DEFAULT NULL,
  `phone_home` varchar(50) DEFAULT NULL,
  `phone_mobile` varchar(50) DEFAULT NULL,
  `phone_work` varchar(50) DEFAULT NULL,
  `phone_other` varchar(50) DEFAULT NULL,
  `phone_fax` varchar(50) DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL,
  `address_street` varchar(150) DEFAULT NULL,
  `address_city` varchar(100) DEFAULT NULL,
  `address_state` varchar(100) DEFAULT NULL,
  `address_country` varchar(100) DEFAULT NULL,
  `address_postalcode` varchar(20) DEFAULT NULL,
  `default_team` char(36) DEFAULT NULL,
  `team_set_id` char(36) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  `portal_only` tinyint(1) DEFAULT '0',
  `show_on_employees` tinyint(1) DEFAULT '1',
  `employee_status` varchar(100) DEFAULT NULL,
  `messenger_id` varchar(100) DEFAULT NULL,
  `messenger_type` varchar(100) DEFAULT NULL,
  `reports_to_id` char(36) DEFAULT NULL,
  `is_group` tinyint(1) DEFAULT NULL,
  `preferred_language` varchar(255) DEFAULT NULL,
  `last_login` datetime DEFAULT NULL,
  `acl_role_set_id` char(36) DEFAULT NULL,
  `acl_team_set_id` char(36) DEFAULT NULL,
  `customer_journey_access` tinyint(1) DEFAULT '0',
  `site_user_id` varchar(64) DEFAULT NULL,
  `customer_journey_last_active` datetime DEFAULT NULL,
  `license_type` text,
  `business_center_id` char(36) DEFAULT NULL,
  `cookie_consent` tinyint(1) DEFAULT '0',
  `cookie_consent_received_on` datetime DEFAULT NULL,
  `send_email_on_mention` tinyint(1) DEFAULT '0',
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_users_skey` (`sync_key`),
  KEY `idx_user_name` (`user_name`,`is_group`,`status`,`last_name`,`first_name`,`id`),
  KEY `idx_users_reports_to_id` (`reports_to_id`,`id`),
  KEY `idx_user_first_last` (`first_name`,`last_name`,`deleted`),
  KEY `idx_user_cjp_access` (`customer_journey_access`,`deleted`,`user_name`,`is_group`,`portal_only`,`status`),
  KEY `idx_user_cjp_last_active` (`customer_journey_access`,`customer_journey_last_active`,`deleted`,`user_name`,`is_group`,`portal_only`,`status`),
  KEY `idx_user_type_status` (`status`,`is_admin`,`deleted`),
  KEY `idx_users_del_businesscenter` (`deleted`,`business_center_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `users_cstm`
--

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

--
-- Table structure for table `users_feeds`
--

CREATE TABLE `users_feeds` (
  `user_id` char(36) DEFAULT NULL,
  `feed_id` char(36) DEFAULT NULL,
  `rank` int(11) DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  KEY `idx_ud_user_id` (`user_id`,`feed_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `users_holidays`
--

CREATE TABLE `users_holidays` (
  `id` char(36) NOT NULL,
  `user_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_user_holi_holi` (`holiday_id`),
  KEY `users_quotes_alt` (`user_id`,`holiday_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `users_last_import`
--

CREATE TABLE `users_last_import` (
  `id` char(36) NOT NULL,
  `assigned_user_id` char(36) DEFAULT NULL,
  `import_module` varchar(36) DEFAULT NULL,
  `bean_type` varchar(36) DEFAULT NULL,
  `bean_id` char(36) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user_id` (`assigned_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `users_last_states`
--

CREATE TABLE `users_last_states` (
  `id` char(36) NOT NULL,
  `user_id` char(36) DEFAULT NULL,
  `last_state` longtext,
  `platform` varchar(255) DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `users_password_link`
--

CREATE TABLE `users_password_link` (
  `id` char(36) NOT NULL,
  `username` varchar(36) DEFAULT NULL,
  `date_generated` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  `bean_id` char(36) DEFAULT NULL,
  `bean_type` varchar(36) DEFAULT 'User',
  `platform` varchar(36) DEFAULT 'base',
  PRIMARY KEY (`id`),
  KEY `idx_username` (`username`),
  KEY `idx_bean_id_users_password_link` (`bean_id`),
  KEY `idx_id_deleted_platform` (`id`,`deleted`,`platform`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `users_signatures`
--

CREATE TABLE `users_signatures` (
  `id` char(36) NOT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  `user_id` char(36) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `signature` text,
  `signature_html` text,
  `modified_user_id` char(36) DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_users_signatures_skey` (`sync_key`),
  KEY `idx_usersig_uid` (`user_id`),
  KEY `users_signaturesmod` (`date_modified`),
  KEY `idx_usersig_created_by` (`created_by`),
  KEY `idx_users_signatures_id_del` (`id`,`deleted`),
  KEY `idx_users_signatures_date_entered` (`date_entered`),
  KEY `idx_users_signatures_name_del` (`name`,`deleted`),
  KEY `idx_users_signatures_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_users_signatures_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `vcals`
--

CREATE TABLE `vcals` (
  `id` char(36) NOT NULL,
  `deleted` tinyint(1) DEFAULT NULL,
  `date_entered` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  `user_id` char(36) NOT NULL,
  `type` varchar(100) DEFAULT NULL,
  `source` varchar(100) DEFAULT NULL,
  `content` text,
  PRIMARY KEY (`id`),
  KEY `idx_vcal` (`type`,`user_id`,`source`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `versions`
--

CREATE TABLE `versions` (
  `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,
  `file_version` varchar(255) DEFAULT NULL,
  `db_version` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_version` (`name`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `visual_pipeline`
--

CREATE TABLE `visual_pipeline` (
  `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_module` varchar(255) DEFAULT '',
  `table_header` text,
  `hidden_values` text,
  `tile_header` varchar(50) DEFAULT NULL,
  `tile_body_fields` text,
  `records_per_column` varchar(255) DEFAULT NULL,
  `available_columns` text,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_visual_pipeline_skey` (`sync_key`),
  KEY `idx_visual_pipeline_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_visual_pipeline_id_del` (`id`,`deleted`),
  KEY `idx_visual_pipeline_del_d_e` (`deleted`,`date_entered`,`id`),
  KEY `idx_visual_pipeline_name_del` (`name`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `weblogichooks`
--

CREATE TABLE `weblogichooks` (
  `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',
  `webhook_target_module` varchar(255) DEFAULT NULL,
  `request_method` varchar(255) DEFAULT 'POST',
  `url` varchar(255) DEFAULT NULL,
  `trigger_event` varchar(255) DEFAULT NULL,
  `sync_key` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_weblogichooks_skey` (`sync_key`),
  KEY `weblogichooksmod` (`date_modified`),
  KEY `idx_weblogichooks_id_del` (`id`,`deleted`),
  KEY `idx_weblogichooks_date_entered` (`date_entered`),
  KEY `idx_weblogichooks_name_del` (`name`,`deleted`),
  KEY `idx_weblogichooks_del_d_m` (`deleted`,`date_modified`,`id`),
  KEY `idx_weblogichooks_del_d_e` (`deleted`,`date_entered`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `workflow`
--

CREATE TABLE `workflow` (
  `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,
  `base_module` varchar(50) DEFAULT NULL,
  `status` tinyint(1) DEFAULT '0',
  `description` text,
  `type` varchar(100) DEFAULT NULL,
  `fire_order` varchar(100) DEFAULT NULL,
  `parent_id` char(36) DEFAULT NULL,
  `record_type` varchar(100) DEFAULT NULL,
  `list_order_y` int(3) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_workflow` (`name`,`deleted`),
  KEY `idx_workflow_type` (`type`),
  KEY `idx_workflow_base_module` (`base_module`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `workflow_actions`
--

CREATE TABLE `workflow_actions` (
  `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,
  `field` varchar(50) DEFAULT NULL,
  `value` text,
  `set_type` varchar(10) DEFAULT NULL,
  `adv_type` varchar(10) DEFAULT NULL,
  `parent_id` char(36) NOT NULL,
  `ext1` varchar(50) DEFAULT NULL,
  `ext2` varchar(50) DEFAULT NULL,
  `ext3` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_action` (`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `workflow_actionshells`
--

CREATE TABLE `workflow_actionshells` (
  `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,
  `action_type` varchar(100) DEFAULT NULL,
  `parent_id` char(36) NOT NULL,
  `parameters` varchar(255) DEFAULT NULL,
  `rel_module` varchar(50) DEFAULT NULL,
  `rel_module_type` varchar(10) DEFAULT NULL,
  `action_module` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_actionshell` (`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `workflow_alerts`
--

CREATE TABLE `workflow_alerts` (
  `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,
  `field_value` varchar(50) DEFAULT NULL,
  `rel_email_value` varchar(50) DEFAULT NULL,
  `rel_module1` varchar(255) DEFAULT NULL,
  `rel_module2` varchar(255) DEFAULT NULL,
  `rel_module1_type` varchar(10) DEFAULT NULL,
  `rel_module2_type` varchar(10) DEFAULT NULL,
  `where_filter` tinyint(1) DEFAULT '0',
  `user_type` varchar(100) DEFAULT NULL,
  `array_type` varchar(100) DEFAULT NULL,
  `relate_type` varchar(100) DEFAULT NULL,
  `address_type` varchar(100) DEFAULT NULL,
  `parent_id` char(36) NOT NULL,
  `user_display_type` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `workflow_alertshells`
--

CREATE TABLE `workflow_alertshells` (
  `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,
  `alert_text` text,
  `alert_type` varchar(100) DEFAULT NULL,
  `source_type` varchar(100) DEFAULT NULL,
  `parent_id` char(36) NOT NULL,
  `custom_template_id` char(36) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `workflow_schedules`
--

CREATE TABLE `workflow_schedules` (
  `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,
  `date_expired` datetime DEFAULT NULL,
  `workflow_id` char(36) DEFAULT NULL,
  `target_module` varchar(50) DEFAULT NULL,
  `bean_id` char(36) DEFAULT NULL,
  `parameters` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `workflow_triggershells`
--

CREATE TABLE `workflow_triggershells` (
  `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,
  `field` varchar(50) DEFAULT NULL,
  `type` varchar(100) DEFAULT NULL,
  `frame_type` varchar(15) DEFAULT NULL,
  `eval` text,
  `parent_id` char(36) NOT NULL,
  `show_past` tinyint(1) DEFAULT '0',
  `rel_module` varchar(255) DEFAULT NULL,
  `rel_module_type` varchar(10) DEFAULT NULL,
  `parameters` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Final view structure for view `qs_ECVs`
--

/*!50001 DROP VIEW IF EXISTS `qs_ECVs`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`superedmaster`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `qs_ECVs` AS select `contacts_se_extendedcontactvalues_1_c`.`contacts_se_extendedcontactvalues_1contacts_ida` AS `contact_id`,`se_extendedcontactvalues`.`name` AS `name`,`se_extendedcontactvalues`.`date_entered` AS `date_entered`,`se_extendedcontactvalues`.`date_modified` AS `date_modified`,`se_extendedcontactvalues`.`description` AS `description`,`se_extendedcontactvalues`.`deleted` AS `deleted`,`se_extendedcontactvalues`.`modified_user_id` AS `modified_user_id`,`se_extendedcontactvalues`.`id` AS `id`,`se_extendedcontactvalues_cstm`.`numeric_value_c` AS `numeric_value_c` from ((`se_extendedcontactvalues` join `se_extendedcontactvalues_cstm` on((`se_extendedcontactvalues`.`id` = `se_extendedcontactvalues_cstm`.`id_c`))) join `contacts_se_extendedcontactvalues_1_c` on((`se_extendedcontactvalues`.`id` = `contacts_se_extendedcontactvalues_1_c`.`contacts_se_extendedcontactvalues_1se_extendedcontactvalues_idb`))) where (`se_extendedcontactvalues`.`deleted` = 0) */;

--
-- Final view structure for view `qs_contacts`
--

/*!50001 DROP VIEW IF EXISTS `qs_contacts`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`superedmaster`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `qs_contacts` AS select `contacts`.`id` AS `id`,`contacts`.`date_modified` AS `date_modified`,`contacts`.`created_by` AS `created_by`,`contacts`.`description` AS `description`,`contacts_cstm`.`age_float_c` AS `age_float_c`,`contacts_cstm`.`age_months_c` AS `age_months_c`,`contacts`.`facebook` AS `facebook`,`contacts`.`twitter` AS `twitter`,`contacts`.`googleplus` AS `googleplus`,`contacts`.`department` AS `department`,`contacts`.`do_not_call` AS `do_not_call`,`contacts`.`primary_address_city` AS `primary_address_city`,`contacts`.`primary_address_state` AS `primary_address_state`,`contacts`.`primary_address_postalcode` AS `primary_address_postalcode`,`contacts`.`lead_source` AS `lead_source`,`contacts`.`birthdate` AS `birthdate`,`contacts`.`mailchimp_rating_c` AS `mailchimp_rating_c`,`contacts_cstm`.`income_current_c` AS `income_current_c`,`contacts_cstm`.`income_current_growth_c` AS `income_current_growth_c`,`contacts_cstm`.`income_addl_contributions_c` AS `income_addl_contributions_c`,`contacts_cstm`.`income_retirement_desired_c` AS `income_retirement_desired_c`,`contacts_cstm`.`income_retirement_required_c` AS `income_retirement_required_c`,`contacts_cstm`.`income_desired_p_c` AS `income_desired_p_c`,`contacts_cstm`.`income_required_p_c` AS `income_required_p_c`,`contacts_cstm`.`age_retirement_c` AS `age_retirement_c`,`contacts_cstm`.`age_death_c` AS `age_death_c`,`contacts_cstm`.`income_expected_retirement_c` AS `income_expected_retirement_c`,`contacts_cstm`.`gender_c` AS `gender_c`,`contacts_cstm`.`segmentation_lifestage_c` AS `segmentation_lifestage_c`,`contacts_cstm`.`segmentation_engagement_c` AS `segmentation_engagement_c`,`contacts_cstm`.`segmentation_situation_c` AS `segmentation_situation_c`,`contacts_cstm`.`income_frequency_c` AS `income_frequency_c`,`contacts_cstm`.`investment_risk_c` AS `investment_risk_c`,`contacts_cstm`.`investor_c` AS `investor_c`,`contacts_cstm`.`simulation_engine_c` AS `simulation_engine_c`,`contacts_cstm`.`income_expected_retire_high_c` AS `income_expected_retire_high_c`,`contacts_cstm`.`base_rate` AS `base_rate`,`contacts_cstm`.`home_ownership_c` AS `home_ownership_c`,`contacts_cstm`.`income_addl_contrib_c` AS `income_addl_contrib_c`,`contacts_cstm`.`maritalstatus_c` AS `maritalstatus_c`,`contacts_cstm`.`income_type_c` AS `income_type_c`,`contacts_cstm`.`lsw_type_c` AS `lsw_type_c`,`contacts_cstm`.`per_salary_yearly_total_c` AS `per_salary_yearly_total_c`,`contacts_cstm`.`repeat_no_of_years_c` AS `repeat_no_of_years_c`,`contacts_cstm`.`adnl_super_contributioions_c` AS `adnl_super_contributioions_c`,`contacts_cstm`.`income_start_date_c` AS `income_start_date_c`,`contacts_cstm`.`assets_total_super_other_c` AS `assets_total_super_other_c`,`contacts_cstm`.`est_date_load_paid_off_c` AS `est_date_load_paid_off_c`,`contacts_cstm`.`income_end_date_c` AS `income_end_date_c`,`contacts_cstm`.`investment_current_value_c` AS `investment_current_value_c`,`contacts_cstm`.`debt_current_value_c` AS `debt_current_value_c`,`contacts_cstm`.`lsw_amount_c` AS `lsw_amount_c`,`contacts_cstm`.`lsw_first_year_c` AS `lsw_first_year_c`,`contacts_cstm`.`income_amount_per_year_c` AS `income_amount_per_year_c`,`contacts_cstm`.`debt_type_c` AS `debt_type_c`,`contacts_cstm`.`investment_type_c` AS `investment_type_c`,`contacts_cstm`.`soa_flag_c` AS `soa_flag_c`,`contacts_cstm`.`assets_total_primary_super_c` AS `assets_total_primary_super_c`,`contacts_cstm`.`simulation_link_text_c` AS `simulation_link_text_c`,`contacts_cstm`.`total_profile_completion_c` AS `total_profile_completion_c`,`contacts_cstm`.`profile_prompts_count_c` AS `profile_prompts_count_c`,`contacts_cstm`.`assets_total_addl_income_c` AS `assets_total_addl_income_c`,`contacts_cstm`.`assets_total_inv_assets_c` AS `assets_total_inv_assets_c`,`contacts_cstm`.`liab_total_home_other_loans_c` AS `liab_total_home_other_loans_c`,`contacts_cstm`.`liab_total_inv_loans_c` AS `liab_total_inv_loans_c`,`contacts_cstm`.`member_id_c` AS `member_id_c`,`contacts_cstm`.`member_hash_c` AS `member_hash_c`,`contacts_cstm`.`optimisation_flag_c` AS `optimisation_flag_c`,`contacts_cstm`.`show_splash_next_c` AS `show_splash_next_c`,`contacts_cstm`.`employment_status_c` AS `employment_status_c`,`contacts_cstm`.`last_login_c` AS `last_login_c`,`contacts_cstm`.`ars_data_c` AS `ars_data_c`,`contacts_cstm`.`ars_outcome_c` AS `ars_outcome_c`,`contacts_cstm`.`ars_finances_c` AS `ars_finances_c`,`contacts_cstm`.`ars_overall_c` AS `ars_overall_c`,`contacts_cstm`.`ars_engagement_c` AS `ars_engagement_c`,`contacts_cstm`.`ars_data_value_c` AS `ars_data_value_c`,`contacts_cstm`.`ars_outcome_value_c` AS `ars_outcome_value_c`,`contacts_cstm`.`ars_finances_value_c` AS `ars_finances_value_c`,`contacts_cstm`.`ars_engagement_value_c` AS `ars_engagement_value_c`,`contacts_cstm`.`ars_overall_value_c` AS `ars_overall_value_c`,`contacts_cstm`.`count_articles_c` AS `count_articles_c`,`contacts_cstm`.`count_badges_c` AS `count_badges_c`,`contacts_cstm`.`ri_strong_c` AS `ri_strong_c`,`contacts_cstm`.`ri_weak_c` AS `ri_weak_c`,`contacts_cstm`.`ri_verystrong_c` AS `ri_verystrong_c`,`contacts_cstm`.`ri_veryweak_c` AS `ri_veryweak_c`,`contacts_cstm`.`advice_status_c` AS `advice_status_c`,`contacts_cstm`.`ri_date_created_c` AS `ri_date_created_c`,`contacts_cstm`.`optrif_advice_status_c` AS `optrif_advice_status_c`,`contacts_cstm`.`optrif_date_created_c` AS `optrif_date_created_c`,`contacts_cstm`.`optrif_weak_c` AS `optrif_weak_c`,`contacts_cstm`.`optrif_strong_c` AS `optrif_strong_c`,`contacts_cstm`.`optrif_veryweak_c` AS `optrif_veryweak_c`,`contacts_cstm`.`ars_data_income_c` AS `ars_data_income_c`,`contacts_cstm`.`ars_data_other_super_c` AS `ars_data_other_super_c`,`contacts_cstm`.`ars_data_contribution_c` AS `ars_data_contribution_c`,`contacts_cstm`.`ars_data_retirement_age_high_c` AS `ars_data_retirement_age_high_c`,`contacts_cstm`.`ars_data_retirement_age_low_c` AS `ars_data_retirement_age_low_c`,`contacts_cstm`.`ars_data_total_c` AS `ars_data_total_c`,`contacts_cstm`.`atps_proxy_c` AS `atps_proxy_c`,`contacts_cstm`.`pension_flag_c` AS `pension_flag_c`,`contacts_cstm`.`is_guest_c` AS `is_guest_c`,`contacts_cstm`.`preferred_article_type_c` AS `preferred_article_type_c`,`contacts_cstm`.`resetpw_token_c` AS `resetpw_token_c`,`contacts_cstm`.`resetpw_trigger_c` AS `resetpw_trigger_c`,`contacts_cstm`.`tpd_weekly_premium_c` AS `tpd_weekly_premium_c`,`contacts_cstm`.`death_cover_c` AS `death_cover_c`,`contacts_cstm`.`ars_competencies_value_c` AS `ars_competencies_value_c`,`contacts_cstm`.`tpd_cover_c` AS `tpd_cover_c`,`contacts_cstm`.`ip_cover_c` AS `ip_cover_c`,`contacts_cstm`.`ip_weekly_premium_c` AS `ip_weekly_premium_c`,`contacts_cstm`.`start_date_with_fund_c` AS `start_date_with_fund_c`,`contacts_cstm`.`death_weekly_premium_c` AS `death_weekly_premium_c`,`contacts_cstm`.`retirement_vs_current_age_c` AS `retirement_vs_current_age_c`,`contacts_cstm`.`userincomefrequency_c` AS `userincomefrequency_c`,`contacts_cstm`.`userincometype_c` AS `userincometype_c`,`contacts_cstm`.`usersalsacavailable_c` AS `usersalsacavailable_c`,`contacts_cstm`.`asset_annuitisation_c` AS `asset_annuitisation_c`,`contacts_cstm`.`annuity_income_c` AS `annuity_income_c`,`contacts_cstm`.`referrer_c` AS `referrer_c`,`contacts_cstm`.`process_1_completed_c` AS `process_1_completed_c`,`contacts_cstm`.`process_2_completed_c` AS `process_2_completed_c`,`contacts_cstm`.`process_3_completed_c` AS `process_3_completed_c`,`contacts_cstm`.`understanding_c` AS `understanding_c`,`contacts_cstm`.`motivation_c` AS `motivation_c`,`contacts_cstm`.`involvement_c` AS `involvement_c`,`contacts_cstm`.`confidence_c` AS `confidence_c`,`contacts_cstm`.`life_journey_c` AS `life_journey_c`,`contacts_cstm`.`pilot_status_c` AS `pilot_status_c`,`contacts_cstm`.`conts_instructions_c` AS `conts_instructions_c`,`contacts_cstm`.`total_interactions_count_c` AS `total_interactions_count_c`,`contacts_cstm`.`count_competencies_c` AS `count_competencies_c`,`contacts_cstm`.`count_profile_completion_c` AS `count_profile_completion_c`,`contacts_cstm`.`feature_switches_account_c` AS `feature_switches_account_c`,`contacts_cstm`.`feature_switches_segment_c` AS `feature_switches_segment_c`,`contacts_cstm`.`ap_application_type_c` AS `ap_application_type_c`,`contacts_cstm`.`ap_assessable_income_c` AS `ap_assessable_income_c`,`contacts_cstm`.`ap_assessable_assets_c` AS `ap_assessable_assets_c`,`contacts_cstm`.`ap_test_income_amount_c` AS `ap_test_income_amount_c`,`contacts_cstm`.`ap_test_assets_amount_c` AS `ap_test_assets_amount_c`,`contacts_cstm`.`ap_amount_c` AS `ap_amount_c`,`contacts_cstm`.`chargebee_customer_id_c` AS `chargebee_customer_id_c`,`contacts_cstm`.`ap_amount_type_c` AS `ap_amount_type_c`,`contacts_cstm`.`re_one_off_expenses_amount_c` AS `re_one_off_expenses_amount_c`,`contacts_cstm`.`re_one_off_expenses_list_c` AS `re_one_off_expenses_list_c`,`contacts_cstm`.`health_check_c` AS `health_check_c`,`contacts_cstm`.`main_retirement_concerns_c` AS `main_retirement_concerns_c`,`contacts_cstm`.`expenses_current_c` AS `expenses_current_c`,`contacts_cstm`.`ap_age_eligibility_c` AS `ap_age_eligibility_c`,`contacts_cstm`.`ap_residency_eligibility_c` AS `ap_residency_eligibility_c`,`contacts_cstm`.`ap_completed_sections_count_c` AS `ap_completed_sections_count_c`,`contacts_cstm`.`ap_test_assets_amount_type_c` AS `ap_test_assets_amount_type_c`,`contacts_cstm`.`ap_test_income_amount_type_c` AS `ap_test_income_amount_type_c`,`contacts_cstm`.`process_trigger_c` AS `process_trigger_c`,`contacts_cstm`.`process_attributes_c` AS `process_attributes_c`,`contacts_cstm`.`last_logout_c` AS `last_logout_c`,`contacts_cstm`.`check_ap_application_type_c` AS `check_ap_application_type_c`,`contacts_cstm`.`ap_combined_amount_type_c` AS `ap_combined_amount_type_c`,`contacts_cstm`.`splash_page_c` AS `splash_page_c`,`contacts_cstm`.`ap_centrelink_receipt_number_c` AS `ap_centrelink_receipt_number_c`,`contacts_cstm`.`ap_centrelink_receipt_date_c` AS `ap_centrelink_receipt_date_c`,`contacts_cstm`.`ap_australia_post_tracking_c` AS `ap_australia_post_tracking_c`,`contacts_cstm`.`ab_test_id_c` AS `ab_test_id_c`,`contacts_cstm`.`ap_australia_post_sent_date_c` AS `ap_australia_post_sent_date_c`,`contacts_cstm`.`ap_test_assets_amt_type_t1_c` AS `ap_test_assets_amt_type_t1_c`,`contacts_cstm`.`ap_amount_type_t2_c` AS `ap_amount_type_t2_c`,`contacts_cstm`.`ap_eligibility_date_text_c` AS `ap_eligibility_date_text_c`,`contacts_cstm`.`ap_eligibility_date_c` AS `ap_eligibility_date_c`,`contacts_cstm`.`ap_amount_t2_c` AS `ap_amount_t2_c`,`contacts_cstm`.`ap_date_text_t1_c` AS `ap_date_text_t1_c`,`contacts_cstm`.`ap_assessable_assets_t1_c` AS `ap_assessable_assets_t1_c`,`contacts_cstm`.`ap_test_assets_amt_type_t2_c` AS `ap_test_assets_amt_type_t2_c`,`contacts_cstm`.`ap_eligibility_date_text_t2_c` AS `ap_eligibility_date_text_t2_c`,`contacts_cstm`.`ap_date_text_t2_c` AS `ap_date_text_t2_c`,`contacts_cstm`.`ap_eligibility_date_text_t1_c` AS `ap_eligibility_date_text_t1_c`,`contacts_cstm`.`ap_test_income_amt_type_t1_c` AS `ap_test_income_amt_type_t1_c`,`contacts_cstm`.`ap_test_assets_amount_t2_c` AS `ap_test_assets_amount_t2_c`,`contacts_cstm`.`ap_test_income_amount_t1_c` AS `ap_test_income_amount_t1_c`,`contacts_cstm`.`ap_deemed_income_c` AS `ap_deemed_income_c`,`contacts_cstm`.`ap_eligibility_date_t1_c` AS `ap_eligibility_date_t1_c`,`contacts_cstm`.`ap_date_c` AS `ap_date_c`,`contacts_cstm`.`ap_assessable_income_t2_c` AS `ap_assessable_income_t2_c`,`contacts_cstm`.`ap_combined_amount_type_t1_c` AS `ap_combined_amount_type_t1_c`,`contacts_cstm`.`ap_test_income_amount_t2_c` AS `ap_test_income_amount_t2_c`,`contacts_cstm`.`ap_test_assets_amount_t1_c` AS `ap_test_assets_amount_t1_c`,`contacts_cstm`.`ap_deemed_income_t2_c` AS `ap_deemed_income_t2_c`,`contacts_cstm`.`ap_deemed_income_t1_c` AS `ap_deemed_income_t1_c`,`contacts_cstm`.`ap_combined_amount_type_t2_c` AS `ap_combined_amount_type_t2_c`,`contacts_cstm`.`ap_amount_type_t1_c` AS `ap_amount_type_t1_c`,`contacts_cstm`.`ap_date_text_c` AS `ap_date_text_c`,`contacts_cstm`.`ap_test_income_amt_type_t2_c` AS `ap_test_income_amt_type_t2_c`,`contacts_cstm`.`ap_date_t2_c` AS `ap_date_t2_c`,`contacts_cstm`.`ap_date_t1_c` AS `ap_date_t1_c`,`contacts_cstm`.`ap_amount_t1_c` AS `ap_amount_t1_c`,`contacts_cstm`.`ap_eligibility_date_t2_c` AS `ap_eligibility_date_t2_c`,`contacts_cstm`.`ap_assessable_income_t1_c` AS `ap_assessable_income_t1_c`,`contacts_cstm`.`ap_assessable_assets_t2_c` AS `ap_assessable_assets_t2_c`,`contacts_cstm`.`trigger_account_activation_c` AS `trigger_account_activation_c`,`contacts_cstm`.`apc_age_eligibility_c` AS `apc_age_eligibility_c`,`contacts_cstm`.`apc_amount_c` AS `apc_amount_c`,`contacts_cstm`.`apc_amount_type_c` AS `apc_amount_type_c`,`contacts_cstm`.`apc_apec_mongo_id_c` AS `apc_apec_mongo_id_c`,`contacts_cstm`.`apc_assessable_assets_c` AS `apc_assessable_assets_c`,`contacts_cstm`.`apc_assessable_income_c` AS `apc_assessable_income_c`,`contacts_cstm`.`apc_combined_amount_c` AS `apc_combined_amount_c`,`contacts_cstm`.`apc_combined_amount_type_c` AS `apc_combined_amount_type_c`,`contacts_cstm`.`apc_mongo_id_c` AS `apc_mongo_id_c`,`contacts_cstm`.`apc_residency_eligibility_c` AS `apc_residency_eligibility_c`,`contacts_cstm`.`apc_test_assets_amount_c` AS `apc_test_assets_amount_c`,`contacts_cstm`.`apc_test_assets_amount_type_c` AS `apc_test_assets_amount_type_c`,`contacts_cstm`.`apc_test_income_amount_c` AS `apc_test_income_amount_c`,`contacts_cstm`.`apc_test_income_amount_type_c` AS `apc_test_income_amount_type_c`,`contacts_cstm`.`ap_apec_mongo_id_c` AS `ap_apec_mongo_id_c`,`contacts_cstm`.`ap_apec_mongo_id_t1_c` AS `ap_apec_mongo_id_t1_c`,`contacts_cstm`.`ap_apec_mongo_id_t2_c` AS `ap_apec_mongo_id_t2_c`,`contacts_cstm`.`ap_combined_amount_t1_c` AS `ap_combined_amount_t1_c`,`contacts_cstm`.`ap_combined_amount_c` AS `ap_combined_amount_c`,`contacts_cstm`.`ap_combined_amount_t2_c` AS `ap_combined_amount_t2_c`,`contacts_cstm`.`ap_person2_app_date_text_c` AS `ap_person2_app_date_text_c`,`contacts_cstm`.`ap_person1_app_date_c` AS `ap_person1_app_date_c`,`contacts_cstm`.`ap_application_date_t2_c` AS `ap_application_date_t2_c`,`contacts_cstm`.`ap_application_date_c` AS `ap_application_date_c`,`contacts_cstm`.`ap_application_date_text_c` AS `ap_application_date_text_c`,`contacts_cstm`.`ap_application_date_text_t2_c` AS `ap_application_date_text_t2_c`,`contacts_cstm`.`ap_person2_app_date_c` AS `ap_person2_app_date_c`,`contacts_cstm`.`apc_application_eligibility_c` AS `apc_application_eligibility_c`,`contacts_cstm`.`ap_person1_app_date_text_c` AS `ap_person1_app_date_text_c`,`contacts_cstm`.`ap_application_date_text_t1_c` AS `ap_application_date_text_t1_c`,`contacts_cstm`.`advice_ready_to_proceed_c` AS `advice_ready_to_proceed_c`,`contacts_cstm`.`fund_data_date_c` AS `fund_data_date_c`,`contacts_cstm`.`generate_handover_report_c` AS `generate_handover_report_c`,`contacts_cstm`.`ap_application_date_t1_c` AS `ap_application_date_t1_c`,`contacts`.`deleted` AS `deleted` from (`contacts` join `contacts_cstm` on((`contacts`.`id` = `contacts_cstm`.`id_c`))) where (`contacts`.`deleted` = 0) */;

--
-- Final view structure for view `qs_investments`
--

/*!50001 DROP VIEW IF EXISTS `qs_investments`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`superedmaster`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `qs_investments` AS select `se_investments_contacts_c`.`se_investments_contactscontacts_ida` AS `contact_id`,`se_investments`.`id` AS `id`,`se_investments`.`name` AS `name`,`se_investments`.`date_entered` AS `date_entered`,`se_investments`.`date_modified` AS `date_modified`,`se_investments`.`description` AS `description`,`se_investments`.`deleted` AS `deleted`,`se_investments`.`inv_balance` AS `inv_balance`,`se_investments`.`inv_balance_date` AS `inv_balance_date`,`se_investments`.`type` AS `type`,`se_investments`.`investment_option` AS `investment_option`,`se_investments`.`balance_calc` AS `balance_calc`,`se_investments`.`initial_balance` AS `initial_balance`,`se_investments_cstm`.`fund_name_c` AS `fund_name_c`,`se_investments_cstm`.`classification_c` AS `classification_c`,`se_investments_cstm`.`assets_total_other_super_c` AS `assets_total_other_super_c`,`se_investments_cstm`.`assets_primary_super_c` AS `assets_primary_super_c`,`se_investments_cstm`.`liab_home_other_loans_c` AS `liab_home_other_loans_c`,`se_investments_cstm`.`lsw_amount_c` AS `lsw_amount_c`,`se_investments_cstm`.`base_rate` AS `base_rate`,`se_investments_cstm`.`assets_inv_assets_c` AS `assets_inv_assets_c`,`se_investments_cstm`.`liab_inv_loans_c` AS `liab_inv_loans_c`,`se_investments_cstm`.`other_parameters_c` AS `other_parameters_c`,`se_investments_cstm`.`meta_data_c` AS `meta_data_c`,`se_investments_cstm`.`survey_field_id_c` AS `survey_field_id_c` from ((`se_investments` join `se_investments_cstm` on((`se_investments`.`id` = `se_investments_cstm`.`id_c`))) join `se_investments_contacts_c` on((`se_investments`.`id` = `se_investments_contacts_c`.`se_investments_contactsse_investments_idb`))) where (`se_investments`.`deleted` = 0) */;

--
-- Final view structure for view `qs_opportunities`
--

/*!50001 DROP VIEW IF EXISTS `qs_opportunities`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`superedmaster`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `qs_opportunities` AS select `opportunities_contacts`.`contact_id` AS `contact_id`,`opportunities`.`name` AS `name`,`opportunities`.`date_entered` AS `date_entered`,`opportunities`.`date_modified` AS `date_modified`,`opportunities`.`modified_user_id` AS `modified_user_id`,`opportunities`.`created_by` AS `created_by`,`opportunities`.`description` AS `description`,`opportunities`.`deleted` AS `deleted`,`opportunities`.`opportunity_type` AS `opportunity_type`,`opportunities`.`campaign_id` AS `campaign_id`,`opportunities`.`lead_source` AS `lead_source`,`opportunities`.`amount` AS `amount`,`opportunities`.`date_closed` AS `date_closed`,`opportunities`.`next_step` AS `next_step`,`opportunities`.`sales_stage` AS `sales_stage`,`opportunities`.`sales_status` AS `sales_status`,`opportunities_cstm`.`expected_amount_c` AS `expected_amount_c`,`opportunities`.`amount_usdollar` AS `amount_usdollar`,`opportunities_cstm`.`process_attributes_c` AS `process_attributes_c`,`opportunities_cstm`.`charge_amount_c` AS `charge_amount_c`,`opportunities`.`id` AS `id` from ((`opportunities` join `opportunities_cstm` on((`opportunities`.`id` = `opportunities_cstm`.`id_c`))) join `opportunities_contacts` on((`opportunities`.`id` = `opportunities_contacts`.`opportunity_id`))) where (`opportunities`.`deleted` = 0) */;


