
--
-- Table structure for table `ext_functions`
--

CREATE TABLE `ext_functions` (
  `id` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_file` int NOT NULL,
  `flavour` tinyint NOT NULL,
  `type` tinyint NOT NULL,
  `family` tinyint NOT NULL,
  `name` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `family` (`family`,`name`),
  KEY `ext_functions_owner` (`ref_owner`),
  KEY `ext_functions_file` (`ref_file`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ext_functions`
--


--
-- Table structure for table `ext_states`
--

CREATE TABLE `ext_states` (
  `name` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `data` longtext CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ext_states`
--


--
-- Table structure for table `ftr_cm_actions`
--

CREATE TABLE `ftr_cm_actions` (
  `id` int NOT NULL,
  `state` int DEFAULT NULL,
  `type` int DEFAULT NULL,
  `name` varchar(200) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ftr_cm_actions`
--

INSERT INTO `ftr_cm_actions` VALUES (1,0,0,'Notifica?º?úo atrav?®s de Registro da N?úo Conformidade','N?úo Conformidade'),(2,0,1,'Nova Realiza?º?úo de servi?ºo','Novo Servi?ºo'),(3,0,2,'Compensa?º?úo atrav?®s de servi?ºos','Compensa?º?úo'),(4,0,3,'Compensa?º?úo Financeira','Compensa?º?úo');

--
-- Table structure for table `ftr_cm_categories`
--

CREATE TABLE `ftr_cm_categories` (
  `ref_category` int NOT NULL,
  `ref_type` int NOT NULL,
  PRIMARY KEY (`ref_category`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ftr_cm_categories`
--


--
-- Table structure for table `ftr_cm_contract_historicals`
--

CREATE TABLE `ftr_cm_contract_historicals` (
  `id` int NOT NULL,
  `ref_contract_summary` int NOT NULL,
  `ref_owner` int NOT NULL,
  `negotiation` int NOT NULL,
  `readjustment_state` int NOT NULL,
  `rate_closed` double NOT NULL,
  `created_at` date NOT NULL,
  `description` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ftr_cm_contract_historicals`
--


--
-- Table structure for table `ftr_cm_contract_recipes`
--

CREATE TABLE `ftr_cm_contract_recipes` (
  `id` int NOT NULL,
  `ref_contract_summary` int NOT NULL,
  `margin_pf_med` double NOT NULL,
  `margin_pfs_med` double NOT NULL,
  `margin_pfr_med` double NOT NULL,
  `no_indicators_med` double NOT NULL,
  `margin_opme` double NOT NULL,
  `margin_pfs_mat` double NOT NULL,
  `margin_pfr_mat` double NOT NULL,
  `indicators_mat` double NOT NULL,
  `no_indicators_mat` double NOT NULL,
  `dt_end_mat` date DEFAULT NULL,
  `dt_end_med` date DEFAULT NULL,
  `dt_end_opme` date DEFAULT NULL,
  `dt_end_daily` date DEFAULT NULL,
  `negotiation_type_mat` varchar(32) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `negotiation_type_med` varchar(32) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `negotiation_type_opme` varchar(32) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `negotiation_type_daily` varchar(32) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info_mat` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info_opme` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info_daily` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info_med` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ftr_cm_contract_recipes`
--


--
-- Table structure for table `ftr_cm_contract_summary`
--

CREATE TABLE `ftr_cm_contract_summary` (
  `id` int NOT NULL,
  `ref_suppliers` int NOT NULL,
  `ref_id_work` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_technical_manager` int NOT NULL,
  `type` int NOT NULL,
  `invoice_day` int NOT NULL,
  `created_by` int NOT NULL,
  `contract_value` double DEFAULT NULL,
  `negotiation_month` date DEFAULT NULL,
  `readjustment_date` date NOT NULL,
  `created_at` date NOT NULL,
  `signature` date NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `index_correction` varchar(200) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `payment_term` varchar(200) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `fine` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `rescission` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `readjustment` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `invoice_period` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `observations` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  `glosses_term` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  `invoice_delivery` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `payment_clause` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_ftr_cm_contract_summary` (`ref_suppliers`,`ref_id_work`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ftr_cm_contract_summary`
--


--
-- Table structure for table `ftr_cm_notifications`
--

CREATE TABLE `ftr_cm_notifications` (
  `id` int NOT NULL,
  `ref_source` int NOT NULL,
  `ref_owner` int NOT NULL,
  `family` int NOT NULL,
  `confirmed` smallint NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `title` varchar(150) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ftr_cm_notifications`
--


--
-- Table structure for table `ftr_cm_questionnaire_scales`
--

CREATE TABLE `ftr_cm_questionnaire_scales` (
  `id` int NOT NULL,
  `ref_questionnaire` int NOT NULL,
  `type` int NOT NULL,
  `state` int NOT NULL,
  `name` varchar(60) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ftr_cm_questionnaire_scales`
--

INSERT INTO `ftr_cm_questionnaire_scales` VALUES (1,0,1,0,'Escala de Qualifica?º?úo'),(2,0,2,0,'Escala de Desempenho');

--
-- Table structure for table `ftr_cm_questionnaire_topics`
--

CREATE TABLE `ftr_cm_questionnaire_topics` (
  `id` int NOT NULL,
  `ref_questionnaire` int NOT NULL,
  `type` int NOT NULL,
  `name` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `description` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ftr_cm_questionnaire_topics`
--


--
-- Table structure for table `ftr_cm_questionnaires`
--

CREATE TABLE `ftr_cm_questionnaires` (
  `id` int NOT NULL,
  `ref_scale` int NOT NULL,
  `ref_supplier` int NOT NULL,
  `state` int NOT NULL,
  `type` int NOT NULL,
  `info` varchar(45) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `name` varchar(60) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ftr_cm_questionnaires`
--


--
-- Table structure for table `ftr_cm_questions_scale_options`
--

CREATE TABLE `ftr_cm_questions_scale_options` (
  `id` int NOT NULL,
  `ref_questionnaire_scale` int NOT NULL,
  `score` double NOT NULL,
  `name` varchar(45) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ftr_cm_questions_scale_options`
--

INSERT INTO `ftr_cm_questions_scale_options` VALUES (1,1,1,'Sim',' '),(2,1,-1,'N?úo',' '),(3,1,2,'n/a',' '),(4,2,1,'Sim',' '),(5,2,-1,'N?úo',' '),(6,2,2,'n/a',' ');

--
-- Table structure for table `ftr_cm_rating_results`
--

CREATE TABLE `ftr_cm_rating_results` (
  `id` int NOT NULL,
  `ref_rating_suppliers` int NOT NULL,
  `ref_questionnaire` int NOT NULL,
  `ref_question` int NOT NULL,
  `score_achieved` double NOT NULL,
  `score_max` double NOT NULL,
  `option` varchar(45) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `actions` varchar(16) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ftr_cm_rating_results`
--


--
-- Table structure for table `ftr_cm_relevances`
--

CREATE TABLE `ftr_cm_relevances` (
  `id` int NOT NULL,
  `period` int NOT NULL,
  `state` int NOT NULL,
  `seqno` smallint NOT NULL DEFAULT '0',
  `name` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `description` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ftr_cm_relevances`
--

INSERT INTO `ftr_cm_relevances` VALUES (1,365,0,0,'Irrelevante','Abrang?¬ncia: limites da organiza?º?úo. Impacto sobre o meio/pessoa/organiza?º?úo: irris??rio; A falta dos servi?ºos n?úo ocasionar?í perdas e dados para a organiza?º?úo'),(2,183,0,0,'Pouco Relevante','Abrang?¬ncia: limites da organiza?º?úo. Impacto sobre o meio/pessoa/organiza?º?úo: pontual; A falta dos servi?ºos ocasionar?í perdas e dados a longo prazo para a organiza?º?úo'),(3,60,0,0,'Relevante','Abrang?¬ncia: outros limites al?®m da organiza?º?úo. Impacto sobre o meio/pessoa/organiza?º?úo: revers?¡vel a longo prazo; A falta dos servi?ºos ocasionar?í perdas e dados a curto prazo para a organiza?º?úo'),(4,30,0,0,'Muito Relevante','Abrang?¬ncia: outros limites al?®m da organiza?º?úo. Impacto sobre o meio/pessoa/organiza?º?úo: irrevers?¡vel; A falta dos servi?ºos ocasionar?í perdas e dados irrevers?¡veis para a organiza?º?úo');

--
-- Table structure for table `ftr_cm_supplier_scale_options`
--

CREATE TABLE `ftr_cm_supplier_scale_options` (
  `id` int NOT NULL,
  `ref_supplier_scale` int NOT NULL,
  `color` int NOT NULL,
  `score_from` double NOT NULL,
  `score_until` double NOT NULL,
  `name` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ftr_cm_supplier_scale_options`
--

INSERT INTO `ftr_cm_supplier_scale_options` VALUES (1,1,-52480,0,60,'N?úo Qualificar'),(2,1,-205,60,80,'Qualificar com Restri?º?Áes'),(3,1,-13369600,80,100,'Qualificar Pleno'),(4,2,-52480,0,60,'Desqualificar'),(5,2,-205,60,80,'Solicitar A?º?úo Corretiva'),(6,2,-13369600,80,100,'Manter Qualifica?º?úo');

--
-- Table structure for table `ftr_cm_supplier_scales`
--

CREATE TABLE `ftr_cm_supplier_scales` (
  `id` int NOT NULL,
  `ref_suppliers` int NOT NULL,
  `type` int NOT NULL,
  `state` int NOT NULL,
  `name` varchar(200) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ftr_cm_supplier_scales`
--

INSERT INTO `ftr_cm_supplier_scales` VALUES (1,0,1,0,'Escala de Qualifica?º?úo','Escala criada para avalia?º?úo de qualifica?º?úo dos fornecedores'),(2,0,2,0,'Escala de Desempenho','Escala criada para avalia?º?úo de desempenho dos fornecedores');

--
-- Table structure for table `ftr_cm_suppliers`
--

CREATE TABLE `ftr_cm_suppliers` (
  `id` int NOT NULL,
  `type` int NOT NULL,
  `relevance` int NOT NULL,
  `state` int NOT NULL,
  `last_performance_rating` datetime DEFAULT NULL,
  `next_performance_rating` datetime DEFAULT NULL,
  `end_date_operation` datetime DEFAULT NULL,
  `end_date_health_surveillance` datetime DEFAULT NULL,
  `end_date_art` datetime DEFAULT NULL,
  `cep` varchar(10) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `cnpj` varchar(14) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `options` varchar(32) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `phone1` varchar(40) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `phone2` varchar(40) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `type_activity` varchar(45) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `email` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `company_name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `fantasy_name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `owner` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `contact` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `address` varchar(200) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ftr_cm_suppliers`
--


--
-- Table structure for table `ftr_cm_suppliers_ratings`
--

CREATE TABLE `ftr_cm_suppliers_ratings` (
  `id` int NOT NULL,
  `ref_supplier` int NOT NULL,
  `ref_questionnaire` int NOT NULL,
  `ref_rater` int NOT NULL,
  `ref_approver` int NOT NULL,
  `ref_sector` int NOT NULL,
  `rating_type` int NOT NULL,
  `state` int NOT NULL,
  `score_final` double NOT NULL,
  `dt_rating_start` date NOT NULL,
  `dt_rating_end` date NOT NULL,
  `dt_start` date DEFAULT NULL,
  `dt_end` date DEFAULT NULL,
  `contract_number` varchar(45) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  `documents` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  `feedback` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ftr_cm_suppliers_ratings`
--


--
-- Table structure for table `ftr_cm_type_activities`
--

CREATE TABLE `ftr_cm_type_activities` (
  `id` int NOT NULL,
  `state` int NOT NULL,
  `seqno` smallint NOT NULL DEFAULT '0',
  `name` varchar(45) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ftr_cm_type_activities`
--

INSERT INTO `ftr_cm_type_activities` VALUES (1,0,0,'Alugu?®is (Loca?º?úo)',''),(2,0,0,'Presta?º?úo de Servi?ºos',''),(3,0,0,'Comodato',''),(4,0,0,'M??tuo',''),(5,0,0,'Repasses',''),(6,0,0,'Banc?írios',''),(7,0,0,'Fornecedores',''),(8,0,0,'Outros',''),(9,0,0,'Operadora','');

--
-- Table structure for table `hrm_capacitations`
--

CREATE TABLE `hrm_capacitations` (
  `ref_course` int NOT NULL,
  `ref_qualification` int NOT NULL,
  UNIQUE KEY `ref_course` (`ref_course`,`ref_qualification`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_capacitations`
--


--
-- Table structure for table `hrm_categories`
--

CREATE TABLE `hrm_categories` (
  `id` int NOT NULL,
  `ref_user` int NOT NULL,
  `ref_parent` int DEFAULT '0',
  `family` int NOT NULL,
  `state` smallint NOT NULL,
  `name` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `description` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `hrm_categories_family` (`family`),
  KEY `hrm_categories_name` (`name`),
  KEY `hrm_categories_state` (`state`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_categories`
--

INSERT INTO `hrm_categories` VALUES (1,1,0,3,1,'Cargos',''),(2,1,0,1,1,'Administrador do SA','');

--
-- Table structure for table `hrm_classification_scale_items`
--

CREATE TABLE `hrm_classification_scale_items` (
  `id` int NOT NULL,
  `color` int NOT NULL,
  `result` int DEFAULT '0',
  `ref_scale` int NOT NULL,
  `update_by` int NOT NULL,
  `score_from` double NOT NULL,
  `score_until` double NOT NULL,
  `update_at` date NOT NULL,
  `name` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `hrm_classifications_color` (`color`),
  KEY `hrm_classifications_ref_scale` (`ref_scale`),
  KEY `hrm_classifications_update_by` (`update_by`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_classification_scale_items`
--

INSERT INTO `hrm_classification_scale_items` VALUES (1,-1,0,1,0,0,50,'2022-10-13','Iniciante'),(2,-1,0,1,0,50,70,'2022-10-13','Básico'),(3,-1,0,1,0,70,80,'2022-10-13','Intermediário'),(4,-1,0,1,0,80,90,'2022-10-13','Profissional'),(5,-1,0,1,0,90,100,'2022-10-13','Domínio');

--
-- Table structure for table `hrm_classifications_scales`
--

CREATE TABLE `hrm_classifications_scales` (
  `id` int NOT NULL,
  `ref_cycle` int NOT NULL,
  `state` int NOT NULL,
  `family` int NOT NULL,
  `classification` int NOT NULL,
  `created_by` int NOT NULL,
  `created_at` date DEFAULT NULL,
  `name` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `hrm_classifications_scales_ref_cycle` (`ref_cycle`),
  KEY `hrm_classifications_scales_state` (`state`),
  KEY `hrm_classifications_scales_family` (`family`),
  KEY `hrm_classifications_scales_created_by` (`created_by`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_classifications_scales`
--

INSERT INTO `hrm_classifications_scales` VALUES (1,0,1,2,0,0,'2022-10-13','DEFAULT','Escala utilizada como padrão pelo sistema');

--
-- Table structure for table `hrm_consolidations`
--

CREATE TABLE `hrm_consolidations` (
  `ref_owner` int NOT NULL,
  `ref_cycle` int NOT NULL,
  `ref_function` int NOT NULL,
  `ref_unit` int NOT NULL,
  `ref_department` int NOT NULL,
  `ref_sector` int NOT NULL,
  `score_achieved` double NOT NULL,
  `score_max` double NOT NULL,
  `family` int DEFAULT '0',
  UNIQUE KEY `ref_owner` (`ref_owner`,`ref_cycle`,`ref_function`,`family`),
  KEY `hrm_consolidations_department` (`ref_department`),
  KEY `hrm_consolidations_sector` (`ref_sector`),
  KEY `hrm_consolidations_unit` (`ref_unit`),
  KEY `hrm_consolidations_family` (`family`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_consolidations`
--


--
-- Table structure for table `hrm_course_skills`
--

CREATE TABLE `hrm_course_skills` (
  `ref_qualification` int NOT NULL,
  `ref_course` int NOT NULL,
  `skill_level` int NOT NULL,
  UNIQUE KEY `ref_course` (`ref_course`,`ref_qualification`),
  KEY `hrm_course_skills_qualification` (`ref_qualification`),
  KEY `hrm_course_skills_course` (`ref_course`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_course_skills`
--


--
-- Table structure for table `hrm_courses`
--

CREATE TABLE `hrm_courses` (
  `id` int NOT NULL,
  `ref_serial` int NOT NULL,
  `ref_category` int NOT NULL,
  `ref_owner` int NOT NULL,
  `average_vote` int NOT NULL,
  `validity_value` int NOT NULL,
  `avaliation_mode` smallint NOT NULL,
  `offered` tinyint NOT NULL,
  `validity_type` tinyint NOT NULL,
  `notify_type` tinyint NOT NULL,
  `notify_value` double NOT NULL,
  `required_frequency` double NOT NULL,
  `duration` double NOT NULL,
  `investment` double NOT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `currency` varchar(8) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `institution` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `location` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `professor` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `hrm_courses_category` (`ref_category`),
  KEY `hrm_courses_serial` (`ref_serial`),
  KEY `hrm_courses_owner` (`ref_owner`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_courses`
--


--
-- Table structure for table `hrm_cr_applications`
--

CREATE TABLE `hrm_cr_applications` (
  `id` int NOT NULL,
  `ref_occurrence` int NOT NULL,
  `ref_rater` int NOT NULL,
  `mode_result` int DEFAULT NULL,
  `dt_opened` date NOT NULL,
  `dt_closed` date DEFAULT NULL,
  `type` smallint NOT NULL,
  `state` smallint NOT NULL,
  `score_achieved` double NOT NULL,
  `score_max` double NOT NULL,
  `role` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `mode_info` varchar(4000) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `feedback` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`),
  KEY `hrm_cr_applications_occur` (`ref_occurrence`),
  KEY `hrm_cr_applications_rater` (`ref_rater`),
  KEY `hrm_cr_applications_type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_cr_applications`
--


--
-- Table structure for table `hrm_cr_results`
--

CREATE TABLE `hrm_cr_results` (
  `ref_application` int NOT NULL,
  `ref_qualification` int NOT NULL,
  `ref_evidences` int NOT NULL,
  `fl_rating` int NOT NULL,
  `score_achieved` double NOT NULL,
  `score_max` double NOT NULL,
  `option` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  UNIQUE KEY `ref_application` (`ref_application`,`ref_qualification`,`ref_evidences`),
  KEY `hrm_cr_results_evidence` (`ref_evidences`),
  KEY `hrm_cr_results_application` (`ref_application`),
  KEY `hrm_cr_results_qualification` (`ref_qualification`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_cr_results`
--


--
-- Table structure for table `hrm_cycles`
--

CREATE TABLE `hrm_cycles` (
  `id` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_category` int NOT NULL,
  `mode` int NOT NULL,
  `revision_number` int NOT NULL,
  `competence` int NOT NULL,
  `ind_consensus` tinyint NOT NULL,
  `ind_pairs` tinyint NOT NULL,
  `ind_staff` tinyint NOT NULL,
  `ind_top` tinyint NOT NULL,
  `ind_self_rating` tinyint NOT NULL,
  `ind_client` tinyint NOT NULL,
  `state` smallint NOT NULL,
  `weight_pairs` double NOT NULL,
  `weight_top` double NOT NULL,
  `weight_staff` double NOT NULL,
  `weight_self_rating` double NOT NULL,
  `weight_client` double NOT NULL,
  `weight_individual_target` double NOT NULL,
  `weight_team_target` double NOT NULL,
  `weight_global_target` double NOT NULL,
  `dt_start` date NOT NULL,
  `dt_end` date NOT NULL,
  `dt_rating_start` date NOT NULL,
  `dt_rating_end` date NOT NULL,
  `dt_hiring_start` date DEFAULT NULL,
  `dt_hiring_end` date DEFAULT NULL,
  `dt_approval_start` date DEFAULT NULL,
  `dt_approval_end` date DEFAULT NULL,
  `options` varchar(32) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `name` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `description` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `hrm_cycles_category` (`ref_category`),
  KEY `hrm_cycles_competence` (`competence`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_cycles`
--


--
-- Table structure for table `hrm_deficiencies`
--

CREATE TABLE `hrm_deficiencies` (
  `ref_user` int NOT NULL,
  `ref_function` int NOT NULL,
  `ref_qualification` int NOT NULL,
  `current_skill` int NOT NULL,
  `skill` tinyint NOT NULL,
  UNIQUE KEY `ref_user` (`ref_user`,`ref_function`,`ref_qualification`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_deficiencies`
--


--
-- Table structure for table `hrm_employment_states`
--

CREATE TABLE `hrm_employment_states` (
  `ref_source` int NOT NULL,
  `num_qualified` int DEFAULT '0',
  `num_unqualified` int DEFAULT '0',
  `family` tinyint NOT NULL,
  UNIQUE KEY `family` (`family`,`ref_source`),
  KEY `hrm_employment_states_family` (`family`),
  KEY `hrm_employment_states_source` (`ref_source`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_employment_states`
--

INSERT INTO `hrm_employment_states` VALUES (1,0,0,0),(2,0,0,0),(3,0,0,0),(1,0,0,1);

--
-- Table structure for table `hrm_evidences`
--

CREATE TABLE `hrm_evidences` (
  `id` int NOT NULL,
  `ref_category` int NOT NULL,
  `name` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `state` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `hrm_evidences_state` (`state`),
  KEY `hrm_evidences_category` (`ref_category`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_evidences`
--


--
-- Table structure for table `hrm_evidences_qualifications`
--

CREATE TABLE `hrm_evidences_qualifications` (
  `ref_qualification` int NOT NULL,
  `ref_evidences` int NOT NULL,
  UNIQUE KEY `ref_qualification` (`ref_qualification`,`ref_evidences`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_evidences_qualifications`
--


--
-- Table structure for table `hrm_feedbacks`
--

CREATE TABLE `hrm_feedbacks` (
  `id` int NOT NULL,
  `ref_author` int NOT NULL,
  `ref_user` int NOT NULL,
  `type` tinyint NOT NULL,
  `state` tinyint NOT NULL,
  `dt_performed` date DEFAULT NULL,
  `dt_confirmation` date DEFAULT NULL,
  `positive_info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  `to_improve_info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  `comments` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  `considerations` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  `category` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `hrm_feedbacks_author` (`ref_author`),
  KEY `hrm_feedbacks_user` (`ref_user`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_feedbacks`
--


--
-- Table structure for table `hrm_function_mappings`
--

CREATE TABLE `hrm_function_mappings` (
  `ref_function` int NOT NULL,
  `ref_qualification` int NOT NULL,
  `ref_cycle` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_evidence` int NOT NULL,
  `target` double NOT NULL,
  `weight` double NOT NULL,
  `weight_evidence` double NOT NULL,
  UNIQUE KEY `ref_function` (`ref_function`,`ref_qualification`,`ref_cycle`,`ref_evidence`),
  KEY `hrm_function_mappings_owner` (`ref_owner`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_function_mappings`
--


--
-- Table structure for table `hrm_inscriptions`
--

CREATE TABLE `hrm_inscriptions` (
  `ref_team` int NOT NULL,
  `ref_user` int NOT NULL,
  UNIQUE KEY `ref_team` (`ref_team`,`ref_user`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_inscriptions`
--


--
-- Table structure for table `hrm_jobs`
--

CREATE TABLE `hrm_jobs` (
  `id` int NOT NULL,
  `ref_user` int NOT NULL,
  `dt_start` date DEFAULT NULL,
  `dt_end` date DEFAULT NULL,
  `function` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `location` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `department` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `type_job` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `reference` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `organization` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `activities` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_jobs`
--


--
-- Table structure for table `hrm_matriculations`
--

CREATE TABLE `hrm_matriculations` (
  `id` int NOT NULL,
  `ref_user` int NOT NULL,
  `ref_course` int NOT NULL,
  `ref_team` int NOT NULL,
  `ref_unit` int NOT NULL,
  `ref_department` int NOT NULL,
  `ref_sector` int NOT NULL,
  `approved` tinyint NOT NULL,
  `vote` smallint NOT NULL,
  `frequency` double NOT NULL,
  `duration` double NOT NULL,
  `investment` double NOT NULL,
  `dt_start` date DEFAULT NULL,
  `dt_conclusion` date DEFAULT NULL,
  `matriculation` varchar(20) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `serie` varchar(24) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `result` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `feedback` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `hrm_matriculations_user` (`ref_user`),
  KEY `hrm_matriculations_course` (`ref_course`),
  KEY `hrm_matriculations_team` (`ref_team`),
  KEY `hrm_matriculations_unit` (`ref_unit`),
  KEY `hrm_matriculations_department` (`ref_department`),
  KEY `hrm_matriculations_sector` (`ref_sector`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_matriculations`
--


--
-- Table structure for table `hrm_objectives`
--

CREATE TABLE `hrm_objectives` (
  `ref_qualification` int NOT NULL,
  `ref_objective` int NOT NULL,
  UNIQUE KEY `ref_qualification` (`ref_qualification`,`ref_objective`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_objectives`
--


--
-- Table structure for table `hrm_occurrences`
--

CREATE TABLE `hrm_occurrences` (
  `id` int NOT NULL,
  `ref_user` int NOT NULL,
  `ref_function` int NOT NULL,
  `ref_cycle` int NOT NULL,
  `ref_unit` int NOT NULL,
  `ref_department` int NOT NULL,
  `ref_sector` int NOT NULL,
  `period_from` date NOT NULL,
  `period_until` date NOT NULL,
  `dt_opened` date DEFAULT NULL,
  `dt_closed` date DEFAULT NULL,
  `state` smallint NOT NULL,
  `weight_organizational` double NOT NULL,
  `justification` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `evaluation_number` int NOT NULL,
  `family` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `hrm_occurrences_user` (`ref_user`),
  KEY `hrm_occurrences_function` (`ref_function`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_occurrences`
--


--
-- Table structure for table `hrm_participations`
--

CREATE TABLE `hrm_participations` (
  `ref_team` int NOT NULL,
  `ref_session` int NOT NULL,
  `ref_user` int NOT NULL,
  `role` tinyint NOT NULL,
  `score` smallint NOT NULL,
  `state` smallint NOT NULL,
  `feedback` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  UNIQUE KEY `ref_session` (`ref_session`,`ref_user`),
  KEY `hrm_participations_session` (`ref_session`),
  KEY `hrm_participations_team` (`ref_team`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_participations`
--


--
-- Table structure for table `hrm_pdi_initiatives`
--

CREATE TABLE `hrm_pdi_initiatives` (
  `id` int NOT NULL,
  `ref_initiative` int NOT NULL,
  `ref_occurrence` int NOT NULL,
  `ref_author` int NOT NULL,
  `ref_owner_update` int NOT NULL,
  `ref_top_rater` int NOT NULL,
  `ref_employment` int NOT NULL,
  `type` tinyint NOT NULL,
  `origin` tinyint NOT NULL,
  `released` tinyint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `hrm_pdi_initiatives_initiative` (`ref_initiative`),
  KEY `hrm_pdi_initiatives_occurrence` (`ref_occurrence`),
  KEY `hrm_pdi_initiatives_author` (`ref_author`),
  KEY `hrm_pdi_initiatives_update` (`ref_owner_update`),
  KEY `hrm_pdi_initiatives_top_rater` (`ref_top_rater`),
  KEY `hrm_pdi_initiatives_employment` (`ref_employment`),
  KEY `hrm_pdi_initiatives_type` (`type`),
  KEY `hrm_pdi_initiatives_origin` (`origin`),
  KEY `hrm_pdi_initiatives_released` (`released`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_pdi_initiatives`
--


--
-- Table structure for table `hrm_pdi_mappings`
--

CREATE TABLE `hrm_pdi_mappings` (
  `ref_pdi_initiative` int NOT NULL,
  `ref_source` int NOT NULL,
  `family` int NOT NULL,
  UNIQUE KEY `ref_pdi_initiative` (`ref_pdi_initiative`,`ref_source`),
  KEY `hrm_pdi_mappings_ini` (`ref_pdi_initiative`),
  KEY `hrm_pdi_mappings_sour` (`ref_source`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_pdi_mappings`
--


--
-- Table structure for table `hrm_pr_applications`
--

CREATE TABLE `hrm_pr_applications` (
  `id` int NOT NULL,
  `ref_occurrence` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_hirer` int NOT NULL,
  `ref_approver` int NOT NULL,
  `ref_rater` int NOT NULL,
  `state` int NOT NULL,
  `type` int NOT NULL,
  `score` double DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `hrm_pr_applications_occurrence` (`ref_occurrence`),
  KEY `hrm_pr_applications_owner` (`ref_owner`),
  KEY `hrm_pr_applications_hirer` (`ref_hirer`),
  KEY `hrm_pr_applications_approver` (`ref_approver`),
  KEY `hrm_pr_applications_rater` (`ref_rater`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_pr_applications`
--


--
-- Table structure for table `hrm_pr_targets`
--

CREATE TABLE `hrm_pr_targets` (
  `id` int NOT NULL,
  `ref_application` int NOT NULL,
  `ref_indicator` int DEFAULT NULL,
  `ref_owner` int NOT NULL,
  `state` int NOT NULL,
  `direction` int NOT NULL,
  `weight` double NOT NULL,
  `target_value` double NOT NULL,
  `score` double DEFAULT NULL,
  `date_from` date DEFAULT NULL,
  `date_until` date DEFAULT NULL,
  `name` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `description` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`),
  KEY `hrm_pr_targets_application` (`ref_application`),
  KEY `hrm_pr_targets_indicator` (`ref_indicator`),
  KEY `hrm_pr_targets_owner` (`ref_owner`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_pr_targets`
--


--
-- Table structure for table `hrm_pr_team_mappings`
--

CREATE TABLE `hrm_pr_team_mappings` (
  `ref_application` int NOT NULL,
  `ref_employee` int NOT NULL,
  UNIQUE KEY `ref_application` (`ref_application`,`ref_employee`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_pr_team_mappings`
--


--
-- Table structure for table `hrm_qualifications`
--

CREATE TABLE `hrm_qualifications` (
  `id` int NOT NULL,
  `ref_scale` int NOT NULL,
  `ref_type_qualification` int NOT NULL,
  `ref_category` int NOT NULL,
  `state` int NOT NULL,
  `order` int NOT NULL,
  `num_qualified` int NOT NULL,
  `num_unqualified` int NOT NULL,
  `classification` tinyint NOT NULL,
  `course_provenient` tinyint NOT NULL,
  `implicit` tinyint NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `hrm_qualifications_category` (`ref_category`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_qualifications`
--


--
-- Table structure for table `hrm_raters`
--

CREATE TABLE `hrm_raters` (
  `ref_user` int NOT NULL,
  `ref_occurrence` int NOT NULL,
  `ref_employee` int NOT NULL,
  `family` tinyint DEFAULT '0',
  `type` smallint NOT NULL,
  `period_from` date NOT NULL,
  `period_until` date NOT NULL,
  `role` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  UNIQUE KEY `ref_user` (`ref_user`,`ref_occurrence`,`type`,`family`),
  KEY `hrm_raters_user` (`ref_user`),
  KEY `hrm_raters_occurrence` (`ref_occurrence`),
  KEY `hrm_raters_employee` (`ref_employee`),
  KEY `hrm_raters_type` (`type`),
  KEY `hrm_raters_period_from` (`period_from`),
  KEY `hrm_raters_period_until` (`period_until`),
  KEY `hrm_raters_family` (`family`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_raters`
--


--
-- Table structure for table `hrm_rating_scale_options`
--

CREATE TABLE `hrm_rating_scale_options` (
  `ref_scale` int NOT NULL,
  `fl_rating` int NOT NULL,
  `justify_required` tinyint NOT NULL,
  `score` double NOT NULL,
  `name` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  UNIQUE KEY `ref_scale` (`ref_scale`,`name`),
  KEY `hrm_rat_scale_opt_ref` (`ref_scale`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_rating_scale_options`
--


--
-- Table structure for table `hrm_rating_scales`
--

CREATE TABLE `hrm_rating_scales` (
  `id` int NOT NULL,
  `max_option` double NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_rating_scales`
--


--
-- Table structure for table `hrm_requirements`
--

CREATE TABLE `hrm_requirements` (
  `ref_function` int NOT NULL,
  `ref_qualification` int NOT NULL,
  `skill` smallint NOT NULL,
  UNIQUE KEY `ref_function` (`ref_function`,`ref_qualification`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_requirements`
--


--
-- Table structure for table `hrm_sessions`
--

CREATE TABLE `hrm_sessions` (
  `id` int NOT NULL,
  `ref_team` int NOT NULL,
  `ref_course` int NOT NULL,
  `ref_instructor` int NOT NULL,
  `participants` int NOT NULL,
  `state` smallint NOT NULL,
  `duration` double NOT NULL,
  `idle` double NOT NULL,
  `dt_start_due` date DEFAULT NULL,
  `dt_end_due` date DEFAULT NULL,
  `tm_start` time DEFAULT NULL,
  `tm_finish` time DEFAULT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `instructor` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `location` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `hrm_sessions_team` (`ref_team`),
  KEY `hrm_sessions_course` (`ref_course`),
  KEY `hrm_sessions_instructor` (`ref_instructor`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_sessions`
--


--
-- Table structure for table `hrm_skills`
--

CREATE TABLE `hrm_skills` (
  `ref_user` int NOT NULL,
  `ref_qualification` int NOT NULL,
  `ref_matriculation` int NOT NULL,
  `ref_function` int NOT NULL,
  `level_required` int NOT NULL,
  `level` tinyint NOT NULL,
  UNIQUE KEY `ref_user` (`ref_user`,`ref_qualification`,`ref_matriculation`,`ref_function`),
  KEY `hrm_skills_function` (`ref_function`),
  KEY `hrm_skills_user` (`ref_user`),
  KEY `hrm_skills_qualification` (`ref_qualification`),
  KEY `hrm_skills_matriculation` (`ref_matriculation`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_skills`
--


--
-- Table structure for table `hrm_teams`
--

CREATE TABLE `hrm_teams` (
  `id` int NOT NULL,
  `ref_course` int NOT NULL,
  `state` int NOT NULL,
  `total_participants` int NOT NULL,
  `average_participants` int NOT NULL,
  `active_session` int NOT NULL,
  `certificate` int NOT NULL,
  `validity_value` int NOT NULL,
  `validity_type` tinyint NOT NULL,
  `total_hours` double NOT NULL,
  `due_hours` double NOT NULL,
  `dt_certificate` date DEFAULT NULL,
  `name` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `feedback` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `hrm_teams_course` (`ref_course`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `hrm_teams`
--


--
-- Table structure for table `im_dependencies`
--

CREATE TABLE `im_dependencies` (
  `ref_indicator` int NOT NULL,
  `ref_source` int NOT NULL,
  `family` smallint NOT NULL,
  UNIQUE KEY `ref_indicator` (`ref_indicator`,`ref_source`,`family`),
  KEY `im_dependencies_indicator` (`ref_indicator`),
  KEY `im_dependencies_source` (`ref_source`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `im_dependencies`
--


--
-- Table structure for table `im_indicator_bonds`
--

CREATE TABLE `im_indicator_bonds` (
  `ref_indicator` int NOT NULL,
  `ref_source` int NOT NULL,
  `family` int NOT NULL,
  PRIMARY KEY (`ref_indicator`),
  KEY `im_indicator_bonds_source` (`ref_source`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `im_indicator_bonds`
--


--
-- Table structure for table `im_metas`
--

CREATE TABLE `im_metas` (
  `id` int NOT NULL,
  `ref_indicator` int NOT NULL,
  `competence` int NOT NULL,
  `value` double NOT NULL,
  PRIMARY KEY (`id`),
  KEY `im_metas_indicator` (`ref_indicator`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `im_metas`
--


--
-- Table structure for table `im_results`
--

CREATE TABLE `im_results` (
  `id` int NOT NULL,
  `ref_indicator` int NOT NULL,
  `competence` int NOT NULL,
  `value` double NOT NULL,
  `dt_result` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `im_results_indicator` (`ref_indicator`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `im_results`
--


--
-- Table structure for table `lic_memory`
--

CREATE TABLE `lic_memory` (
  `origin` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `mem_alloc` int NOT NULL,
  `mem_avail` int NOT NULL,
  `mem_usage` double NOT NULL,
  `dt_recorded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`origin`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `lic_memory`
--

INSERT INTO `lic_memory` VALUES ('1',1356857344,2147483647,63.183593779422154,'2022-10-13 11:49:15'),('3',632291328,2147483647,29.443359388710633,'2022-10-14 12:11:52'),('4',808452096,2147483647,37.64648439253051,'2022-10-13 15:52:48'),('8b558dad-5510-4ddd-a259-20e73010e28d',543162368,2147483647,25.292968761777956,'2022-10-13 12:22:00');

--
-- Table structure for table `lic_requests`
--

CREATE TABLE `lic_requests` (
  `origin` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `granted` int NOT NULL,
  `denied` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `lic_requests`
--

INSERT INTO `lic_requests` VALUES ('1',4,0),('4',7,0),('3',2,0);

--
-- Table structure for table `lic_scores`
--

CREATE TABLE `lic_scores` (
  `origin` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `module` varchar(40) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `score` int NOT NULL,
  `peek` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `lic_scores`
--

INSERT INTO `lic_scores` VALUES ('1','WorkflowManager@DEFAULT',1,1),('1','StrategicAdviser@DEFAULT',3,1),('4','AuditManager@DEFAULT',1,1),('4','PerformanceManager@DEFAULT',2,1),('4','DocumentManager@DEFAULT',2,1),('4','StrategicAdviser@DEFAULT',2,1),('3','StrategicAdviser@DEFAULT',2,1);

--
-- Table structure for table `lic_sessions`
--

CREATE TABLE `lic_sessions` (
  `ref_login` int NOT NULL,
  `family` int NOT NULL,
  `origin` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `module` varchar(40) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `instance` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `age` double NOT NULL,
  `last_activity` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `lic_sessions`
--


--
-- Table structure for table `med_teleconference_messages`
--

CREATE TABLE `med_teleconference_messages` (
  `id` int NOT NULL,
  `ref_room` int NOT NULL,
  `ref_user` int NOT NULL,
  `dt_send` datetime NOT NULL,
  `content` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `med_teleconf_messages_room` (`ref_room`),
  KEY `med_teleconf_messages_user` (`ref_user`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `med_teleconference_messages`
--


--
-- Table structure for table `med_teleconference_readings`
--

CREATE TABLE `med_teleconference_readings` (
  `ref_message` int NOT NULL,
  `ref_user` int NOT NULL,
  `dt_read` datetime NOT NULL,
  UNIQUE KEY `ref_message` (`ref_message`,`ref_user`),
  KEY `med_teleconf_readings_message` (`ref_message`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `med_teleconference_readings`
--


--
-- Table structure for table `med_teleconference_rooms`
--

CREATE TABLE `med_teleconference_rooms` (
  `id` int NOT NULL,
  `ref_participant_team` int NOT NULL,
  `ref_moderator_team` int NOT NULL,
  `ref_banned_team` int NOT NULL,
  `ref_appointment` int NOT NULL,
  `type` int NOT NULL,
  `state` int NOT NULL,
  `private` tinyint NOT NULL,
  `dt_start` datetime DEFAULT NULL,
  `dt_end` datetime DEFAULT NULL,
  `name` varchar(120) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `description` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `med_teleconf_rooms_part_team` (`ref_participant_team`),
  KEY `med_teleconf_rooms_mod_team` (`ref_moderator_team`),
  KEY `med_teleconf_rooms_bann_team` (`ref_banned_team`),
  KEY `med_teleconf_rooms_appointment` (`ref_appointment`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `med_teleconference_rooms`
--


--
-- Table structure for table `mob_notifications`
--

CREATE TABLE `mob_notifications` (
  `id` int NOT NULL,
  `ref_user` int NOT NULL,
  `title` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `body` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `protocol` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `mob_notifications_ref_user` (`ref_user`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `mob_notifications`
--


--
-- Table structure for table `orm_alerts`
--

CREATE TABLE `orm_alerts` (
  `id` int NOT NULL,
  `ref_risk_instance` int NOT NULL,
  `treatment` smallint NOT NULL,
  `dt_next_alert` date DEFAULT NULL,
  `dt_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `orm_alerts_risk_instance` (`ref_risk_instance`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_alerts`
--


--
-- Table structure for table `orm_aspect_revision`
--

CREATE TABLE `orm_aspect_revision` (
  `id` int NOT NULL,
  `ref_aspect` int NOT NULL,
  `ref_owner` int NOT NULL,
  `dt_registered` date NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_aspect_revision`
--


--
-- Table structure for table `orm_aspects`
--

CREATE TABLE `orm_aspects` (
  `id` int NOT NULL,
  `ref_cycle` int NOT NULL,
  `ref_audit` int NOT NULL,
  `ref_process` int NOT NULL,
  `ref_control` int NOT NULL,
  `ref_item` int NOT NULL,
  `ref_owner` int NOT NULL,
  `state` tinyint NOT NULL,
  `dt_registered` date DEFAULT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `orm_aspects_cycle` (`ref_cycle`),
  KEY `orm_aspects_audit` (`ref_audit`),
  KEY `orm_aspects_process` (`ref_process`),
  KEY `orm_aspects_control` (`ref_control`),
  KEY `orm_aspects_owner` (`ref_owner`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_aspects`
--


--
-- Table structure for table `orm_aspects_initiatives`
--

CREATE TABLE `orm_aspects_initiatives` (
  `id` int NOT NULL,
  `ref_aspect` int NOT NULL,
  `ref_initiative` int NOT NULL,
  `rev` int NOT NULL,
  `dt_registered` datetime DEFAULT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_aspects_initiatives_id` (`id`),
  KEY `orm_aspects_initiatives_aspect` (`ref_aspect`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_aspects_initiatives`
--


--
-- Table structure for table `orm_audit_controls`
--

CREATE TABLE `orm_audit_controls` (
  `ref_audit` int NOT NULL,
  `ref_control` int NOT NULL,
  UNIQUE KEY `ref_audit` (`ref_audit`,`ref_control`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_audit_controls`
--


--
-- Table structure for table `orm_audits`
--

CREATE TABLE `orm_audits` (
  `id` int NOT NULL,
  `ref_cycle` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_team` int NOT NULL,
  `ref_actionplan` int NOT NULL,
  `fl_verify_aspects` tinyint NOT NULL,
  `state` smallint NOT NULL,
  `dt_from` date DEFAULT NULL,
  `dt_until` date DEFAULT NULL,
  `dt_execute` date DEFAULT NULL,
  `dt_finished` date DEFAULT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `orm_audits_cycle` (`ref_cycle`),
  KEY `orm_audits_owner` (`ref_owner`),
  KEY `orm_audits_actionplan` (`ref_actionplan`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_audits`
--


--
-- Table structure for table `orm_audits_contexts`
--

CREATE TABLE `orm_audits_contexts` (
  `id` int NOT NULL,
  `ref_audit` int NOT NULL,
  `ref_sc` int NOT NULL,
  `ref_control` int NOT NULL,
  `ref_context` int NOT NULL,
  `rev` int NOT NULL,
  `dt_registered` datetime DEFAULT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_audits_contexts_id` (`id`),
  KEY `orm_audits_contexts_audit` (`ref_audit`),
  KEY `orm_audits_contexts_sc` (`ref_sc`),
  KEY `orm_audits_contexts_control` (`ref_control`),
  KEY `orm_audits_contexts_context` (`ref_context`),
  KEY `orm_audits_contexts_rev` (`rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_audits_contexts`
--


--
-- Table structure for table `orm_audits_controls`
--

CREATE TABLE `orm_audits_controls` (
  `id` int NOT NULL,
  `ref_audit` int NOT NULL,
  `ref_sc` int NOT NULL,
  `ref_control` int NOT NULL,
  `ref_risk` int NOT NULL,
  `rev` int NOT NULL,
  `weight` double NOT NULL,
  `dt_registered` datetime DEFAULT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_audits_controls_id` (`id`),
  KEY `orm_audits_controls_audit` (`ref_audit`),
  KEY `orm_audits_controls_sc` (`ref_sc`),
  KEY `orm_audits_controls_control` (`ref_control`),
  KEY `orm_audits_controls_risk` (`ref_risk`),
  KEY `orm_audits_controls_rev` (`rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_audits_controls`
--


--
-- Table structure for table `orm_audits_factors`
--

CREATE TABLE `orm_audits_factors` (
  `id` int NOT NULL,
  `ref_auditplan` int NOT NULL,
  `ref_sc` int NOT NULL,
  `ref_factor` int NOT NULL,
  `ref_risk` int NOT NULL,
  `rev` int NOT NULL,
  `dt_registered` datetime DEFAULT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_audits_factors_id` (`id`),
  KEY `orm_audits_factors_auditplan` (`ref_auditplan`),
  KEY `orm_audits_factors_sc` (`ref_sc`),
  KEY `orm_audits_factors_factor` (`ref_factor`),
  KEY `orm_audits_factors_risk` (`ref_risk`),
  KEY `orm_audits_factors_rev` (`rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_audits_factors`
--


--
-- Table structure for table `orm_baselines`
--

CREATE TABLE `orm_baselines` (
  `id` int NOT NULL,
  `rev` int NOT NULL,
  `ref_unit` int NOT NULL,
  `ref_owner` int NOT NULL,
  `dt_registered` datetime NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `justification` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_baselines_id` (`id`),
  KEY `orm_baselines_unit` (`ref_unit`),
  KEY `orm_baselines_owner` (`ref_owner`),
  KEY `orm_baselines_rev` (`rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_baselines`
--


--
-- Table structure for table `orm_categories`
--

CREATE TABLE `orm_categories` (
  `id` int NOT NULL,
  `ref_riskmap` int DEFAULT NULL,
  `level` int NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `orm_categories_riskmap` (`ref_riskmap`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_categories`
--


--
-- Table structure for table `orm_control_items`
--

CREATE TABLE `orm_control_items` (
  `id` int NOT NULL,
  `ref_process` int NOT NULL,
  `ref_control` int NOT NULL,
  `seqnum` smallint NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `orm_control_items_process` (`ref_process`),
  KEY `orm_control_items_control` (`ref_control`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_control_items`
--


--
-- Table structure for table `orm_control_results`
--

CREATE TABLE `orm_control_results` (
  `id` int NOT NULL,
  `rev` int NOT NULL,
  `ref_audit` int NOT NULL,
  `ref_process` int NOT NULL,
  `ref_control` int NOT NULL,
  `ref_owner` int NOT NULL,
  `dt_registered` date DEFAULT NULL,
  `state` int NOT NULL,
  `score` double NOT NULL,
  `justification` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_control_results_audit` (`ref_audit`),
  KEY `orm_control_results_process` (`ref_process`),
  KEY `orm_control_results_control` (`ref_control`),
  KEY `orm_control_results_owner` (`ref_owner`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_control_results`
--


--
-- Table structure for table `orm_controls_actionplans`
--

CREATE TABLE `orm_controls_actionplans` (
  `id` int NOT NULL,
  `ref_sc` int NOT NULL,
  `ref_risk` int NOT NULL,
  `ref_control` int NOT NULL,
  `ref_actionplan` int NOT NULL,
  `rev` int NOT NULL,
  `dt_registered` datetime DEFAULT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_controls_actionplans_sc` (`ref_sc`),
  KEY `orm_controls_actionplans_risk` (`ref_risk`),
  KEY `orm_controls_actionplans_contr` (`ref_control`),
  KEY `orm_controls_actionplans_actpl` (`ref_actionplan`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_controls_actionplans`
--


--
-- Table structure for table `orm_controls_annotations`
--

CREATE TABLE `orm_controls_annotations` (
  `id` int NOT NULL,
  `ref_sc` int NOT NULL,
  `ref_control` int NOT NULL,
  `ref_annotation` int NOT NULL,
  `rev` int NOT NULL,
  `dt_registered` datetime DEFAULT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_controls_annot_id` (`id`),
  KEY `orm_controls_annot_sc` (`ref_sc`),
  KEY `orm_controls_annot_control` (`ref_control`),
  KEY `orm_controls_annot_annotation` (`ref_annotation`),
  KEY `orm_controls_annot_rev` (`rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_controls_annotations`
--


--
-- Table structure for table `orm_controls_contexts`
--

CREATE TABLE `orm_controls_contexts` (
  `id` int NOT NULL,
  `ref_control` int NOT NULL,
  `ref_sc` int NOT NULL,
  `ref_context` int NOT NULL,
  `rev` int NOT NULL,
  `dt_registered` datetime DEFAULT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_controls_contexts_id` (`id`),
  KEY `orm_controls_contexts_control` (`ref_control`),
  KEY `orm_controls_contexts_sc` (`ref_sc`),
  KEY `orm_controls_contexts_context` (`ref_context`),
  KEY `orm_controls_contexts_rev` (`rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_controls_contexts`
--


--
-- Table structure for table `orm_cycles`
--

CREATE TABLE `orm_cycles` (
  `id` int NOT NULL,
  `ref_owner` int NOT NULL,
  `state` int NOT NULL,
  `dt_from` date DEFAULT NULL,
  `dt_until` date DEFAULT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_cycles`
--


--
-- Table structure for table `orm_impact_classifications`
--

CREATE TABLE `orm_impact_classifications` (
  `id` int NOT NULL,
  `ref_audit` int NOT NULL,
  `ref_process` int NOT NULL,
  `ref_risk` int NOT NULL,
  `ref_impact_level` int NOT NULL,
  `ref_category` int NOT NULL,
  `ref_revision` int NOT NULL,
  `rev` int NOT NULL,
  `impact` double NOT NULL,
  `loss` double NOT NULL,
  `weight` double NOT NULL,
  `title` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_impact_class_audit` (`ref_audit`),
  KEY `orm_impact_class_process` (`ref_process`),
  KEY `orm_impact_class_risk` (`ref_risk`),
  KEY `orm_impact_class_impact` (`ref_impact_level`),
  KEY `orm_impact_class_category` (`ref_category`),
  KEY `orm_impact_class_revision` (`ref_revision`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_impact_classifications`
--


--
-- Table structure for table `orm_impact_levels`
--

CREATE TABLE `orm_impact_levels` (
  `id` int NOT NULL,
  `ref_riskmap` int DEFAULT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `level` smallint NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `orm_impact_levels_riskmap` (`ref_riskmap`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_impact_levels`
--


--
-- Table structure for table `orm_impact_options`
--

CREATE TABLE `orm_impact_options` (
  `id` int NOT NULL,
  `ref_impact` int NOT NULL,
  `ref_level` int NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `orm_impact_options_impact` (`ref_impact`),
  KEY `orm_impact_options_level` (`ref_level`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_impact_options`
--


--
-- Table structure for table `orm_initiatives_directors`
--

CREATE TABLE `orm_initiatives_directors` (
  `id` int NOT NULL,
  `ref_initiative` int NOT NULL,
  `ref_user` int NOT NULL,
  `rev` int NOT NULL,
  `dt_registered` datetime DEFAULT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_initiatives_directors_id` (`id`),
  KEY `orm_initiatives_directors_init` (`ref_initiative`),
  KEY `orm_initiatives_directors_user` (`ref_user`),
  KEY `orm_initiatives_directors_rev` (`rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_initiatives_directors`
--


--
-- Table structure for table `orm_mappings`
--

CREATE TABLE `orm_mappings` (
  `r1` int NOT NULL,
  `r2` int NOT NULL,
  `r3` int NOT NULL,
  `r4` int NOT NULL,
  `family` smallint NOT NULL,
  `c0` double NOT NULL,
  UNIQUE KEY `family` (`family`,`r1`,`r2`,`r3`,`r4`),
  KEY `orm_mappings_r1` (`r1`),
  KEY `orm_mappings_r2` (`r2`),
  KEY `orm_mappings_r3` (`r3`),
  KEY `orm_mappings_r4` (`r4`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_mappings`
--


--
-- Table structure for table `orm_probabilities`
--

CREATE TABLE `orm_probabilities` (
  `id` int NOT NULL,
  `score` double NOT NULL,
  `state` smallint NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_probabilities`
--


--
-- Table structure for table `orm_probability_options`
--

CREATE TABLE `orm_probability_options` (
  `id` int NOT NULL,
  `ref_probability` int NOT NULL,
  `position` smallint NOT NULL,
  `state` smallint NOT NULL,
  `score` double NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `orm_probability_options_prob` (`ref_probability`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_probability_options`
--


--
-- Table structure for table `orm_probability_ranges`
--

CREATE TABLE `orm_probability_ranges` (
  `id` int NOT NULL,
  `ref_riskmap` int DEFAULT NULL,
  `color` int NOT NULL,
  `level` smallint NOT NULL,
  `score_from` double NOT NULL,
  `score_until` double NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `orm_probability_ranges_riskmap` (`ref_riskmap`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_probability_ranges`
--


--
-- Table structure for table `orm_results`
--

CREATE TABLE `orm_results` (
  `rev` int NOT NULL,
  `ref_audit` int NOT NULL,
  `ref_process` int NOT NULL,
  `ref_control` int NOT NULL,
  `ref_probability` int NOT NULL,
  `ref_option` int NOT NULL,
  `ref_control_results` int NOT NULL,
  `competence` int NOT NULL,
  `state` smallint NOT NULL,
  `impact` double NOT NULL,
  `probability` double NOT NULL,
  `score` double NOT NULL,
  KEY `orm_results_competence` (`competence`),
  KEY `orm_results_audit` (`ref_audit`),
  KEY `orm_results_process` (`ref_process`),
  KEY `orm_results_control` (`ref_control`),
  KEY `orm_results_control_results` (`ref_control_results`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_results`
--


--
-- Table structure for table `orm_risk_colors`
--

CREATE TABLE `orm_risk_colors` (
  `id` int NOT NULL,
  `ref_riskmap` int DEFAULT NULL,
  `probability_level` int NOT NULL,
  `impact_level` int NOT NULL,
  `colors` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `orm_risk_colors_riskmap` (`ref_riskmap`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_risk_colors`
--


--
-- Table structure for table `orm_risk_impact_revision`
--

CREATE TABLE `orm_risk_impact_revision` (
  `id` int NOT NULL,
  `rev` int NOT NULL,
  `ref_audit` int NOT NULL,
  `ref_process` int NOT NULL,
  `ref_risk` int NOT NULL,
  `ref_owner` int NOT NULL,
  `workflow` int NOT NULL,
  `dt_registered` datetime NOT NULL,
  `last_impact` double NOT NULL,
  `impact` double NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_risk_imp_rev_ref_aud` (`ref_audit`),
  KEY `orm_risk_imp_rev_ref_pro` (`ref_process`),
  KEY `orm_risk_imp_rev_ref_ris` (`ref_risk`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_risk_impact_revision`
--


--
-- Table structure for table `orm_risk_instances`
--

CREATE TABLE `orm_risk_instances` (
  `id` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_team` int DEFAULT NULL,
  `ref_checklist` int DEFAULT NULL,
  `ref_original` int DEFAULT NULL,
  `ref_checklist_state` int DEFAULT NULL,
  `mit_owner` int DEFAULT NULL,
  `ver_owner` int DEFAULT NULL,
  `ver_period` tinyint DEFAULT NULL,
  `mit_period` tinyint DEFAULT NULL,
  `dt_last_mit` datetime DEFAULT NULL,
  `dt_next_mit` datetime DEFAULT NULL,
  `dt_last_ver` datetime DEFAULT NULL,
  `dt_next_ver` datetime DEFAULT NULL,
  `mit_other` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `ver_other` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `mit_info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  `ver_info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`),
  KEY `orm_risk_instances_owner` (`ref_owner`),
  KEY `orm_risk_instances_team` (`ref_team`),
  KEY `orm_risk_instances_checklist` (`ref_checklist`),
  KEY `orm_risk_instances_original` (`ref_original`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_risk_instances`
--


--
-- Table structure for table `orm_risk_probability_revision`
--

CREATE TABLE `orm_risk_probability_revision` (
  `id` int NOT NULL,
  `rev` int NOT NULL,
  `ref_audit` int NOT NULL,
  `ref_process` int NOT NULL,
  `ref_risk` int NOT NULL,
  `ref_owner` int NOT NULL,
  `workflow` int NOT NULL,
  `probability` double NOT NULL,
  `dt_registered` datetime NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_risk_pr_rev_ref_aud` (`ref_audit`),
  KEY `orm_risk_pr_rev_ref_pro` (`ref_process`),
  KEY `orm_risk_pr_rev_ref_ris` (`ref_risk`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_risk_probability_revision`
--


--
-- Table structure for table `orm_risk_results`
--

CREATE TABLE `orm_risk_results` (
  `rev` int NOT NULL,
  `ref_audit` int NOT NULL,
  `ref_process` int NOT NULL,
  `ref_risk` int NOT NULL,
  `ref_owner` int NOT NULL,
  `impact` double NOT NULL,
  `probability` double NOT NULL,
  UNIQUE KEY `ref_audit` (`ref_audit`,`ref_process`,`ref_risk`,`rev`),
  KEY `orm_risk_results_audit` (`ref_audit`),
  KEY `orm_risk_results_process` (`ref_process`),
  KEY `orm_risk_results_risk` (`ref_risk`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_risk_results`
--


--
-- Table structure for table `orm_riskfactors`
--

CREATE TABLE `orm_riskfactors` (
  `id` int NOT NULL,
  `state` tinyint NOT NULL,
  `code` varchar(20) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `orm_riskfactors_code` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_riskfactors`
--


--
-- Table structure for table `orm_riskfactors_controls`
--

CREATE TABLE `orm_riskfactors_controls` (
  `id` int NOT NULL,
  `ref_sc` int NOT NULL,
  `ref_factor` int NOT NULL,
  `ref_control` int NOT NULL,
  `ref_risk` int NOT NULL,
  `rev` int NOT NULL,
  `dt_registered` datetime DEFAULT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_riskfactors_contr_id` (`id`),
  KEY `orm_riskfactors_contr_sc` (`ref_sc`),
  KEY `orm_riskfactors_contr_factor` (`ref_factor`),
  KEY `orm_riskfactors_contr_control` (`ref_control`),
  KEY `orm_riskfactors_contr_risk` (`ref_risk`),
  KEY `orm_riskfactors_contr_rev` (`rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_riskfactors_controls`
--


--
-- Table structure for table `orm_riskmaps`
--

CREATE TABLE `orm_riskmaps` (
  `id` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_team` int DEFAULT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `state` tinyint NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`),
  KEY `orm_riskmaps_owner` (`ref_owner`),
  KEY `orm_riskmaps_team` (`ref_team`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_riskmaps`
--


--
-- Table structure for table `orm_risks`
--

CREATE TABLE `orm_risks` (
  `id` int NOT NULL,
  `ref_tags` int NOT NULL,
  `icon` int NOT NULL,
  `state` tinyint NOT NULL,
  `code` varchar(20) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `orm_risks_code` (`code`),
  KEY `orm_risks_tags` (`ref_tags`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_risks`
--


--
-- Table structure for table `orm_risks_actionplans`
--

CREATE TABLE `orm_risks_actionplans` (
  `id` int NOT NULL,
  `ref_sc` int NOT NULL,
  `ref_risk` int NOT NULL,
  `ref_actionplan` int NOT NULL,
  `rev` int NOT NULL,
  `dt_registered` datetime DEFAULT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_risks_actionplans_id` (`id`),
  KEY `orm_risks_actionplans_sc` (`ref_sc`),
  KEY `orm_risks_actionplans_risk` (`ref_risk`),
  KEY `orm_risks_actionplans_actionp` (`ref_actionplan`),
  KEY `orm_risks_actionplans_rev` (`rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_risks_actionplans`
--


--
-- Table structure for table `orm_risks_controls`
--

CREATE TABLE `orm_risks_controls` (
  `id` int NOT NULL,
  `ref_sc` int NOT NULL,
  `ref_risk` int NOT NULL,
  `ref_control` int NOT NULL,
  `rev` int NOT NULL,
  `weight` double NOT NULL,
  `dt_registered` datetime DEFAULT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_risks_controls_id` (`id`),
  KEY `orm_risks_controls_sc` (`ref_sc`),
  KEY `orm_risks_controls_risk` (`ref_risk`),
  KEY `orm_risks_controls_control` (`ref_control`),
  KEY `orm_risks_controls_rev` (`rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_risks_controls`
--


--
-- Table structure for table `orm_sc_controls`
--

CREATE TABLE `orm_sc_controls` (
  `id` int NOT NULL,
  `ref_sc` int NOT NULL,
  `ref_control` int NOT NULL,
  `rev` int NOT NULL,
  `dt_registered` datetime DEFAULT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_sc_controls_id` (`id`),
  KEY `orm_sc_controls_sc` (`ref_sc`),
  KEY `orm_sc_controls_control` (`ref_control`),
  KEY `orm_sc_controls_rev` (`rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_sc_controls`
--


--
-- Table structure for table `orm_sc_factors`
--

CREATE TABLE `orm_sc_factors` (
  `id` int NOT NULL,
  `ref_sc` int NOT NULL,
  `ref_risk` int NOT NULL,
  `ref_factor` int NOT NULL,
  `rev` int NOT NULL,
  `dt_registered` datetime DEFAULT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_sc_factors_id` (`id`),
  KEY `orm_sc_factors_sc` (`ref_sc`),
  KEY `orm_sc_factors_risk` (`ref_risk`),
  KEY `orm_sc_factors_factor` (`ref_factor`),
  KEY `orm_sc_factors_rev` (`rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_sc_factors`
--


--
-- Table structure for table `orm_sc_quantifications`
--

CREATE TABLE `orm_sc_quantifications` (
  `id` int NOT NULL,
  `ref_sc` int NOT NULL,
  `ref_risk` int NOT NULL,
  `ref_filter` int NOT NULL,
  `rev` int NOT NULL,
  `dt_registered` datetime DEFAULT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_sc_quantifications_id` (`id`),
  KEY `orm_sc_quantifications_sc` (`ref_sc`),
  KEY `orm_sc_quantifications_risk` (`ref_risk`),
  KEY `orm_sc_quantifications_filter` (`ref_filter`),
  KEY `orm_sc_quantifications_rev` (`rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_sc_quantifications`
--


--
-- Table structure for table `orm_sc_risks`
--

CREATE TABLE `orm_sc_risks` (
  `id` int NOT NULL,
  `ref_sc` int NOT NULL,
  `ref_risk` int NOT NULL,
  `ref_risk_instance` int NOT NULL,
  `rev` int NOT NULL,
  `dt_registered` datetime DEFAULT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `orm_sc_risks_id` (`id`),
  KEY `orm_sc_risks_sc` (`ref_sc`),
  KEY `orm_sc_risks_risk` (`ref_risk`),
  KEY `orm_sc_risks_risk_instance` (`ref_risk_instance`),
  KEY `orm_sc_risks_rev` (`rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `orm_sc_risks`
--


--
-- Table structure for table `prj_answers`
--

CREATE TABLE `prj_answers` (
  `id` int NOT NULL,
  `ref_proposal` int NOT NULL,
  `ref_form` int NOT NULL,
  `state` int NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ref_proposal` (`ref_proposal`),
  KEY `ix_prj_answers_proposal` (`ref_proposal`),
  KEY `ix_prj_answers_form` (`ref_form`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_answers`
--


--
-- Table structure for table `prj_baselines`
--

CREATE TABLE `prj_baselines` (
  `id` int NOT NULL,
  `ref_project_id` int NOT NULL,
  `ref_project_rev` int NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `date` date NOT NULL,
  UNIQUE KEY `ref_project_id` (`ref_project_id`,`ref_project_rev`),
  KEY `ix_prj_baselines_proj_id` (`ref_project_id`),
  KEY `ix_prj_baselines_proj_rev` (`ref_project_rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_baselines`
--


--
-- Table structure for table `prj_cashflows`
--

CREATE TABLE `prj_cashflows` (
  `id` int NOT NULL,
  `ref_project` int NOT NULL,
  `ref_source` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_tags` int NOT NULL,
  `rev` int NOT NULL,
  `origin` tinyint NOT NULL,
  `type` tinyint NOT NULL,
  `estimated_value` double NOT NULL,
  `amount` double NOT NULL,
  `real_value` double NOT NULL,
  `dt_estimated` date NOT NULL,
  `dt_real` date DEFAULT NULL,
  `grouping` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  UNIQUE KEY `id` (`id`,`ref_project`,`rev`),
  KEY `ix_prj_cashflows_project` (`ref_project`),
  KEY `ix_prj_cashflows_task` (`ref_source`),
  KEY `ix_prj_cashflows_owner` (`ref_owner`),
  KEY `ix_prj_cashflows_tags` (`ref_tags`),
  KEY `ix_prj_cashflows_rev` (`rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_cashflows`
--


--
-- Table structure for table `prj_forms`
--

CREATE TABLE `prj_forms` (
  `id` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_team` int NOT NULL,
  `ref_category` int NOT NULL,
  `state` int NOT NULL,
  `fl_default` int NOT NULL,
  `name` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `ix_prj_forms_owner` (`ref_owner`),
  KEY `ix_prj_forms_team` (`ref_team`),
  KEY `ix_prj_forms_category` (`ref_category`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_forms`
--


--
-- Table structure for table `prj_kanban_cards`
--

CREATE TABLE `prj_kanban_cards` (
  `id` int NOT NULL,
  `ref_task` int NOT NULL,
  `ref_item` int NOT NULL,
  `position` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `prj_kanban_cards_task` (`ref_task`),
  KEY `prj_kanban_cards_item` (`ref_item`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_kanban_cards`
--


--
-- Table structure for table `prj_kanban_items`
--

CREATE TABLE `prj_kanban_items` (
  `id` int NOT NULL,
  `ref_project` int NOT NULL,
  `position` int NOT NULL,
  `title` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `prj_kanban_items_project` (`ref_project`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_kanban_items`
--


--
-- Table structure for table `prj_lessons`
--

CREATE TABLE `prj_lessons` (
  `id` int NOT NULL,
  `ref_project` int NOT NULL,
  `ref_user` int NOT NULL,
  `rev` int NOT NULL,
  `type` smallint NOT NULL,
  `item` smallint NOT NULL,
  `dt_created` date NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `prj_lessons_project` (`ref_project`),
  KEY `prj_lessons_user` (`ref_user`),
  KEY `prj_lessons_rev` (`rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_lessons`
--


--
-- Table structure for table `prj_matrices`
--

CREATE TABLE `prj_matrices` (
  `id` int NOT NULL,
  `ref_project` int NOT NULL,
  `rev` int NOT NULL,
  `type` int NOT NULL,
  `font_color` varchar(7) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `header_background_color` varchar(7) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `font_style` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `content` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `ix_prj_matrices_project` (`ref_project`),
  KEY `ix_prj_matrices_rev` (`rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_matrices`
--


--
-- Table structure for table `prj_options`
--

CREATE TABLE `prj_options` (
  `id` int NOT NULL,
  `ref_topic` int NOT NULL,
  `relevance` int NOT NULL,
  `sequence` int NOT NULL,
  `name` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `ix_prj_options_topic` (`ref_topic`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_options`
--


--
-- Table structure for table `prj_predecessors`
--

CREATE TABLE `prj_predecessors` (
  `ref_task_source` int NOT NULL,
  `ref_task_predecessor` int NOT NULL,
  `rev` int NOT NULL,
  UNIQUE KEY `ref_task_source` (`ref_task_source`,`ref_task_predecessor`,`rev`),
  KEY `ix_prj_predecessors_ref_ta_sou` (`ref_task_source`),
  KEY `ix_prj_predecessors_ref_ta_pr` (`ref_task_predecessor`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_predecessors`
--


--
-- Table structure for table `prj_proposals`
--

CREATE TABLE `prj_proposals` (
  `id` int NOT NULL,
  `ref_author` int NOT NULL,
  `ref_analysed_by` int DEFAULT NULL,
  `ref_sponsor` int NOT NULL,
  `ref_manager` int NOT NULL,
  `ref_project` int NOT NULL,
  `ref_office` int NOT NULL,
  `ref_form` int NOT NULL,
  `state` smallint NOT NULL,
  `investment` double DEFAULT NULL,
  `return_rate` double DEFAULT NULL,
  `resource_usage` double DEFAULT NULL,
  `dt_analysed` date DEFAULT NULL,
  `dt_created` date NOT NULL,
  `name` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`),
  KEY `ix_prj_proposals_ref_approved` (`ref_analysed_by`),
  KEY `ix_prj_proposals_ref_author` (`ref_author`),
  KEY `ix_prj_proposals_sponsor` (`ref_sponsor`),
  KEY `ix_prj_proposals_manager` (`ref_manager`),
  KEY `ix_prj_proposals_office` (`ref_office`),
  KEY `prj_proposals_project` (`ref_project`),
  KEY `ix_prj_proposals_form` (`ref_form`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_proposals`
--


--
-- Table structure for table `prj_resources`
--

CREATE TABLE `prj_resources` (
  `id` int NOT NULL,
  `ref_user` int DEFAULT NULL,
  `ref_project` int NOT NULL,
  `ref_calendar` int DEFAULT NULL,
  `rev` int NOT NULL,
  `type` smallint NOT NULL,
  `cost` double NOT NULL,
  `initials` varchar(5) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `group` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `name` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `ix_prj_resources_ref_project` (`ref_project`),
  KEY `ix_prj_resources_ref_user` (`ref_user`),
  KEY `ix_prj_resources_ref_calendar` (`ref_calendar`),
  KEY `ix_prj_resources_rev` (`rev`),
  KEY `ix_prj_resources_type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_resources`
--


--
-- Table structure for table `prj_risks`
--

CREATE TABLE `prj_risks` (
  `ref_project` int NOT NULL,
  `ref_file` int NOT NULL,
  UNIQUE KEY `ref_project` (`ref_project`,`ref_file`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_risks`
--


--
-- Table structure for table `prj_status_reports`
--

CREATE TABLE `prj_status_reports` (
  `id` int NOT NULL,
  `ref_project` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_project_rev` int NOT NULL,
  `classification` int NOT NULL,
  `dt_created` date NOT NULL,
  `dt_next` date DEFAULT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `state` tinyint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `prj_status_reports_proj_rev` (`ref_project_rev`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_status_reports`
--


--
-- Table structure for table `prj_task_checklists`
--

CREATE TABLE `prj_task_checklists` (
  `id` int NOT NULL,
  `ref_task` int NOT NULL,
  `state` int NOT NULL,
  `content` varchar(320) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `ix_prj_task_checklists_task` (`ref_task`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_task_checklists`
--


--
-- Table structure for table `prj_task_resources`
--

CREATE TABLE `prj_task_resources` (
  `id` int NOT NULL,
  `ref_task` int NOT NULL,
  `ref_resource` int NOT NULL,
  `rev` int NOT NULL,
  `realized_duration` int NOT NULL,
  `progress` int NOT NULL DEFAULT '0',
  `percent_usage` smallint NOT NULL,
  `estimated_total` double DEFAULT NULL,
  `realized_total` double DEFAULT NULL,
  `estimated_quantity` double DEFAULT NULL,
  `realized_quantity` double DEFAULT NULL,
  `realized_cost` double DEFAULT NULL,
  `estimated_cost` double DEFAULT NULL,
  `dt_estimated_start` timestamp NULL DEFAULT NULL,
  `dt_estimated_end` timestamp NULL DEFAULT NULL,
  `dt_realized_start` timestamp NULL DEFAULT NULL,
  `dt_realized_end` timestamp NULL DEFAULT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `ix_prj_task_resources_ref_resource` (`ref_resource`),
  KEY `ix_prj_task_resources_ref_task` (`ref_task`),
  KEY `ix_prj_task_res_rev` (`rev`),
  KEY `ix_prj_task_res_dt_est_start` (`dt_estimated_start`),
  KEY `ix_prj_task_res_dt_est_end` (`dt_estimated_end`),
  KEY `ix_prj_task_res_dt_rea_start` (`dt_realized_start`),
  KEY `ix_prj_task_res_dt_rea_end` (`dt_realized_end`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_task_resources`
--


--
-- Table structure for table `prj_tasks`
--

CREATE TABLE `prj_tasks` (
  `id` int NOT NULL,
  `ref_project` int NOT NULL,
  `ref_parent` int NOT NULL,
  `ref_tags` int NOT NULL,
  `ref_owner` int DEFAULT NULL,
  `rev` int NOT NULL,
  `sucessor_offset` int DEFAULT NULL,
  `weight` int NOT NULL,
  `estim_investment` double NOT NULL,
  `real_investment` double NOT NULL,
  `duration` double NOT NULL,
  `state` tinyint NOT NULL,
  `monitor` tinyint NOT NULL,
  `unit` tinyint NOT NULL,
  `fl_eap` tinyint DEFAULT NULL,
  `percent_finished` smallint NOT NULL,
  `dt_estimated_start` date DEFAULT NULL,
  `dt_estimated_end` date DEFAULT NULL,
  `dt_real_start` date DEFAULT NULL,
  `dt_real_end` date DEFAULT NULL,
  `wbs` varchar(30) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `options` varchar(128) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  UNIQUE KEY `id` (`id`,`rev`),
  KEY `ix_prj_tasks_ref_parent` (`ref_parent`),
  KEY `ix_prj_tasks_ref_owner` (`ref_owner`),
  KEY `ix_prj_tasks_ref_project` (`ref_project`),
  KEY `ix_prj_tasks_rev` (`rev`),
  KEY `ix_prj_tasks_dt_estimated_start` (`dt_estimated_start`),
  KEY `ix_prj_tasks_dt_estimated_end` (`dt_estimated_end`),
  KEY `ix_prj_tasks_state` (`state`),
  KEY `prj_tasks_tags` (`ref_tags`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_tasks`
--


--
-- Table structure for table `prj_topic_answers`
--

CREATE TABLE `prj_topic_answers` (
  `id` int NOT NULL,
  `ref_answer` int NOT NULL,
  `ref_topic` int NOT NULL,
  `score` double NOT NULL,
  `feedback` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ref_answer` (`ref_answer`,`ref_topic`),
  KEY `ix_prj_topic_answers_answer` (`ref_answer`),
  KEY `ix_prj_topic_answers_topic` (`ref_topic`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_topic_answers`
--


--
-- Table structure for table `prj_topics`
--

CREATE TABLE `prj_topics` (
  `id` int NOT NULL,
  `ref_form` int NOT NULL,
  `type` int NOT NULL,
  `relevance` int NOT NULL,
  `fl_mandatory` int NOT NULL,
  `sequence` int NOT NULL,
  `name` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `ix_prj_topics_ref_form` (`ref_form`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `prj_topics`
--


--
-- Table structure for table `qms_categories`
--

CREATE TABLE `qms_categories` (
  `id` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_serial` int NOT NULL,
  `state` int NOT NULL,
  `seq_no` smallint NOT NULL,
  `name` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `qms_categories`
--


--
-- Table structure for table `qms_causes`
--

CREATE TABLE `qms_causes` (
  `id` int NOT NULL,
  `ref_occurrence` int NOT NULL,
  `type` smallint NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `qms_causes`
--


--
-- Table structure for table `qms_constraints`
--

CREATE TABLE `qms_constraints` (
  `ref_field` int NOT NULL,
  `ref_option` int NOT NULL,
  `ref_item` int NOT NULL,
  UNIQUE KEY `ref_field` (`ref_field`,`ref_item`),
  KEY `qms_constraints_field` (`ref_field`),
  KEY `qms_constraints_option` (`ref_option`),
  KEY `qms_constraints_item` (`ref_item`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `qms_constraints`
--


--
-- Table structure for table `qms_events`
--

CREATE TABLE `qms_events` (
  `id` int NOT NULL,
  `ref_occurrence` int NOT NULL,
  `ref_owner_in` int NOT NULL,
  `ref_owner_out` int NOT NULL,
  `stage_input` int NOT NULL,
  `stage_output` int NOT NULL,
  `action` int NOT NULL,
  `final_state` tinyint NOT NULL,
  `origin` tinyint NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`),
  KEY `qms_events_occurrence` (`ref_occurrence`),
  KEY `qms_events_owner_in` (`ref_owner_in`),
  KEY `qms_events_owner_out` (`ref_owner_out`),
  KEY `qms_events_created` (`created_at`),
  KEY `qms_events_stage_in` (`stage_input`),
  KEY `qms_events_stage_out` (`stage_output`),
  KEY `qms_events_action` (`action`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `qms_events`
--


--
-- Table structure for table `qms_favourite_items`
--

CREATE TABLE `qms_favourite_items` (
  `ref_favourite` int NOT NULL,
  `ref_occurrence` int NOT NULL,
  `classification` smallint NOT NULL,
  UNIQUE KEY `ref_favourite` (`ref_favourite`,`ref_occurrence`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `qms_favourite_items`
--


--
-- Table structure for table `qms_filter_items`
--

CREATE TABLE `qms_filter_items` (
  `ref_filter` int NOT NULL,
  `ref_field` int NOT NULL,
  `state` tinyint NOT NULL,
  `type` tinyint NOT NULL,
  `value` varchar(4000) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `context` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  KEY `qms_filter_items_filter` (`ref_filter`),
  KEY `qms_filter_items_field` (`ref_field`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `qms_filter_items`
--


--
-- Table structure for table `qms_forms`
--

CREATE TABLE `qms_forms` (
  `ref_user` int NOT NULL,
  `ref_type` int NOT NULL,
  `type` int DEFAULT NULL,
  UNIQUE KEY `ref_user` (`ref_user`,`ref_type`,`type`),
  KEY `qms_forms_user` (`ref_user`),
  KEY `qms_forms_type` (`ref_type`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `qms_forms`
--


--
-- Table structure for table `qms_informations`
--

CREATE TABLE `qms_informations` (
  `ref_occurrence` int NOT NULL,
  `ref_field` int NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  UNIQUE KEY `ref_occurrence` (`ref_occurrence`,`ref_field`),
  KEY `qms_info_occurrence` (`ref_occurrence`),
  KEY `qms_info_field` (`ref_field`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `qms_informations`
--


--
-- Table structure for table `qms_monitor`
--

CREATE TABLE `qms_monitor` (
  `ref_type` int DEFAULT NULL,
  `ref_user` int DEFAULT NULL,
  `stage` int DEFAULT NULL,
  UNIQUE KEY `ref_type` (`ref_type`,`ref_user`,`stage`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `qms_monitor`
--


--
-- Table structure for table `qms_notifications`
--

CREATE TABLE `qms_notifications` (
  `ref_source` int NOT NULL,
  `ref_occurrence` int NOT NULL,
  `family` int NOT NULL,
  `options` int NOT NULL,
  UNIQUE KEY `family` (`family`,`ref_source`,`ref_occurrence`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `qms_notifications`
--


--
-- Table structure for table `qms_occurrences`
--

CREATE TABLE `qms_occurrences` (
  `id` int NOT NULL,
  `ref_created_by` int NOT NULL,
  `ref_category` int NOT NULL,
  `ref_type` int NOT NULL,
  `ref_actionplan_analysis` int NOT NULL,
  `ref_actionplan_disposition` int NOT NULL,
  `ref_previous` int NOT NULL,
  `ref_accepted_by` int NOT NULL,
  `ref_analised_by` int NOT NULL,
  `ref_approved_by` int NOT NULL,
  `ref_executed_by` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_event_accepted` int NOT NULL,
  `ref_event_approved` int NOT NULL,
  `ref_event_executed` int NOT NULL,
  `ref_event_verified` int NOT NULL,
  `ref_verified_by` int NOT NULL,
  `restriction` int NOT NULL,
  `initiative_count` int NOT NULL,
  `context_count` int NOT NULL,
  `archived` tinyint NOT NULL,
  `state` smallint NOT NULL,
  `execute_state` smallint DEFAULT NULL,
  `priority` smallint NOT NULL,
  `workflow` smallint NOT NULL,
  `stage_origin` smallint NOT NULL,
  `stage_current` smallint NOT NULL,
  `dt_created` date NOT NULL,
  `dt_analyse_due` date DEFAULT NULL,
  `dt_analysed` date DEFAULT NULL,
  `dt_execute_estim_start` date DEFAULT NULL,
  `dt_execute_estim_end` date DEFAULT NULL,
  `dt_execute_real_start` date DEFAULT NULL,
  `dt_execute_real_end` date DEFAULT NULL,
  `dt_approve_due` date DEFAULT NULL,
  `dt_execute_due` date DEFAULT NULL,
  `dt_verify_due` date DEFAULT NULL,
  `dt_last_verification` date DEFAULT NULL,
  `next_update` date DEFAULT NULL,
  `dt_accept_due` date DEFAULT NULL,
  `serial` varchar(24) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `options` varchar(32) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `reason` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `disposition` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `title` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `sector` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `description` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `qms_occurrences_restriction` (`restriction`),
  KEY `qms_occurrences_state` (`state`),
  KEY `qms_occurrences_created` (`ref_created_by`),
  KEY `qms_occurrences_category` (`ref_category`),
  KEY `qms_occurrences_type` (`ref_type`),
  KEY `qms_occurrences_analysis` (`ref_actionplan_analysis`),
  KEY `qms_occurrences_disposition` (`ref_actionplan_disposition`),
  KEY `qms_occurrences_previous` (`ref_previous`),
  KEY `qms_occurrences_accepted` (`ref_accepted_by`),
  KEY `qms_occurrences_analised` (`ref_analised_by`),
  KEY `qms_occurrences_approved` (`ref_approved_by`),
  KEY `qms_occurrences_executed` (`ref_executed_by`),
  KEY `qms_occurrences_verified` (`ref_verified_by`),
  KEY `qms_occurrences_owner` (`ref_owner`),
  KEY `qms_occurrences_evaccepted` (`ref_event_accepted`),
  KEY `qms_occurrences_evapproved` (`ref_event_approved`),
  KEY `qms_occurrences_evexecuted` (`ref_event_executed`),
  KEY `qms_occurrences_evverified` (`ref_event_verified`),
  KEY `qms_occurrences_created_on` (`dt_created`),
  KEY `qms_occurrences_archived` (`archived`),
  KEY `qms_occurrences_workflow` (`workflow`),
  KEY `qms_occurrences_dt_analysed` (`dt_analysed`),
  KEY `qms_occu_stage_origin` (`stage_origin`),
  KEY `qms_occu_stage_current` (`stage_current`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `qms_occurrences`
--


--
-- Table structure for table `qms_option_items`
--

CREATE TABLE `qms_option_items` (
  `id` int NOT NULL,
  `ref_option` int NOT NULL,
  `position` int NOT NULL,
  `state` tinyint NOT NULL,
  `value` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `qms_option_items`
--


--
-- Table structure for table `qms_options`
--

CREATE TABLE `qms_options` (
  `id` int NOT NULL,
  `ref_category` int NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` varchar(4000) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `qms_options_category` (`ref_category`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `qms_options`
--


--
-- Table structure for table `qms_random_serials`
--

CREATE TABLE `qms_random_serials` (
  `ref_occurrence` int NOT NULL,
  `random_serial` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `email` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  UNIQUE KEY `ref_occurrence` (`ref_occurrence`,`random_serial`),
  KEY `qms_random_serials_occurrence` (`ref_occurrence`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `qms_random_serials`
--


--
-- Table structure for table `qms_tabs`
--

CREATE TABLE `qms_tabs` (
  `id` int NOT NULL,
  `label` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `ref_type` int NOT NULL,
  `position` int NOT NULL,
  `scope` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `qms_tabs_type` (`ref_type`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `qms_tabs`
--


--
-- Table structure for table `qms_types_indicators`
--

CREATE TABLE `qms_types_indicators` (
  `ref_indicator` int NOT NULL,
  `ref_type` int NOT NULL,
  `stage` int NOT NULL,
  UNIQUE KEY `ref_indicator` (`ref_indicator`,`ref_type`,`stage`),
  KEY `qms_types_indicators_ref_indicator` (`ref_indicator`),
  KEY `qms_types_indicators_ref_type` (`ref_type`),
  KEY `qms_types_indicators_stage` (`stage`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `qms_types_indicators`
--


--
-- Table structure for table `qms_values`
--

CREATE TABLE `qms_values` (
  `ref_occurrence` int NOT NULL,
  `ref_field` int NOT NULL,
  `content` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `type` int NOT NULL,
  KEY `ix_qms_values_field` (`ref_field`),
  KEY `ix_qms_values_occurrence` (`ref_occurrence`),
  KEY `ix_qms_values_content` (`content`),
  KEY `ix_qms_values_type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `qms_values`
--


--
-- Table structure for table `scrum_sprint_annotations`
--

CREATE TABLE `scrum_sprint_annotations` (
  `id` int NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `type` smallint NOT NULL,
  `ref_user` int NOT NULL,
  `ref_sprint` int NOT NULL,
  `dt_create` date NOT NULL,
  PRIMARY KEY (`id`),
  KEY `scrum_sprint_annotations_ref_user` (`ref_user`),
  KEY `scrum_sprint_annotations_ref_sprint` (`ref_sprint`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `scrum_sprint_annotations`
--


--
-- Table structure for table `scrum_sprint_instances`
--

CREATE TABLE `scrum_sprint_instances` (
  `id` int NOT NULL,
  `ref_sprint` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_team` int NOT NULL,
  `state` tinyint NOT NULL,
  `serial` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `dt_from` date NOT NULL,
  `dt_until` date NOT NULL,
  `annotation` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`),
  UNIQUE KEY `serial` (`serial`),
  KEY `scrum_sprint_instances_sprint` (`ref_sprint`),
  KEY `scrum_sprint_instances_owner` (`ref_owner`),
  KEY `scrum_sprint_instances_team` (`ref_team`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `scrum_sprint_instances`
--


--
-- Table structure for table `scrum_sprint_items`
--

CREATE TABLE `scrum_sprint_items` (
  `id` int NOT NULL,
  `ref_sprint_instance` int NOT NULL,
  `ref_category` int NOT NULL,
  `ref_classification` int NOT NULL,
  `estimated` int NOT NULL,
  `duration` int NOT NULL,
  `seq_no` int NOT NULL,
  `relevance` int NOT NULL,
  `potential` int NOT NULL,
  `ref_release` int NOT NULL,
  `ref_group` int NOT NULL,
  `ref_origin` int DEFAULT NULL,
  `type` tinyint NOT NULL,
  `protocol` varchar(40) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`),
  KEY `scrum_sprint_items_instance` (`ref_sprint_instance`),
  KEY `scrum_sprint_items_category` (`ref_category`),
  KEY `scrum_sprint_items_classificat` (`ref_classification`),
  KEY `scrum_sprint_items_ref_release` (`ref_release`),
  KEY `scrum_sprint_items_ref_group` (`ref_group`),
  KEY `scrum_sprint_items_ref_origin` (`ref_origin`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `scrum_sprint_items`
--


--
-- Table structure for table `scrum_sprint_tasks`
--

CREATE TABLE `scrum_sprint_tasks` (
  `id` int NOT NULL,
  `ref_sprint_item` int NOT NULL,
  `ref_category` int NOT NULL,
  `ref_classification` int NOT NULL,
  `ref_owner` int NOT NULL,
  `estimated` int NOT NULL,
  `duration` int NOT NULL,
  `seq_no` int NOT NULL,
  `state` tinyint NOT NULL,
  `is_current` tinyint NOT NULL,
  `type` tinyint NOT NULL,
  `protocol` varchar(40) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `dt_from` datetime DEFAULT NULL,
  `dt_until` datetime DEFAULT NULL,
  `dt_created` datetime DEFAULT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  `ready_def` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `scrum_sprint_tasks_item` (`ref_sprint_item`),
  KEY `scrum_sprint_tasks_category` (`ref_category`),
  KEY `scrum_sprint_tasks_classificat` (`ref_classification`),
  KEY `scrum_sprint_tasks_owner` (`ref_owner`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `scrum_sprint_tasks`
--


--
-- Table structure for table `scrum_sprints`
--

CREATE TABLE `scrum_sprints` (
  `id` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_group` int NOT NULL,
  `ref_team` int NOT NULL,
  `alias` varchar(20) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`),
  UNIQUE KEY `alias` (`alias`),
  KEY `scrum_sprints_owner` (`ref_owner`),
  KEY `scrum_sprints_group` (`ref_group`),
  KEY `scrum_sprints_team` (`ref_team`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `scrum_sprints`
--


--
-- Table structure for table `sol_lgpd_consents`
--

CREATE TABLE `sol_lgpd_consents` (
  `id` int NOT NULL,
  `ref_element` int NOT NULL,
  `state` tinyint NOT NULL,
  `origin` tinyint NOT NULL,
  `ts_consent` datetime NOT NULL,
  `ts_expiration` datetime DEFAULT NULL,
  `ts_revocation` datetime DEFAULT NULL,
  `name` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `cpf` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `email` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `ip` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sol_lgpd_consents_element` (`ref_element`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpd_consents`
--


--
-- Table structure for table `sol_lgpd_data_groups`
--

CREATE TABLE `sol_lgpd_data_groups` (
  `id` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_team` int NOT NULL,
  `ref_category` int NOT NULL,
  `ref_handling_form` int NOT NULL,
  `state` tinyint NOT NULL,
  `options` varchar(32) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`),
  KEY `sol_lgpd_data_groups_owner` (`ref_owner`),
  KEY `sol_lgpd_data_groups_team` (`ref_team`),
  KEY `sol_lgpd_data_groups_category` (`ref_category`),
  KEY `sol_lgpd_data_groups_handling` (`ref_handling_form`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpd_data_groups`
--


--
-- Table structure for table `sol_lgpd_data_mappings`
--

CREATE TABLE `sol_lgpd_data_mappings` (
  `ref_data` int DEFAULT NULL,
  `ref_lgpd` int DEFAULT NULL,
  `ref_data_group` int NOT NULL,
  KEY `sol_lgpd_data_mappings_data` (`ref_data`),
  KEY `sol_lgpd_data_mappings_lgpd` (`ref_lgpd`),
  KEY `sol_lgpd_data_mappings_group` (`ref_data_group`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpd_data_mappings`
--


--
-- Table structure for table `sol_lgpd_datas`
--

CREATE TABLE `sol_lgpd_datas` (
  `id` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_category` int NOT NULL,
  `state` tinyint NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`),
  KEY `sol_lgpd_datas_owner` (`ref_owner`),
  KEY `sol_lgpd_datas_cat` (`ref_category`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpd_datas`
--


--
-- Table structure for table `sol_lgpd_documents`
--

CREATE TABLE `sol_lgpd_documents` (
  `ref_lgpd` int NOT NULL,
  `ref_document` int NOT NULL,
  UNIQUE KEY `ref_lgpd` (`ref_lgpd`,`ref_document`),
  KEY `sol_lgpd_documents_lgpd` (`ref_lgpd`),
  KEY `sol_lgpd_documents_document` (`ref_document`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpd_documents`
--


--
-- Table structure for table `sol_lgpd_elements`
--

CREATE TABLE `sol_lgpd_elements` (
  `id` int NOT NULL,
  `ref_category` int NOT NULL,
  `ref_team` int NOT NULL,
  `ref_owner` int NOT NULL,
  `state` tinyint NOT NULL,
  `name` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` varchar(4000) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sol_lgpds_elements_category` (`ref_category`),
  KEY `sol_lgpds_elements_team` (`ref_team`),
  KEY `sol_lgpds_elements_owner` (`ref_owner`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpd_elements`
--


--
-- Table structure for table `sol_lgpd_field_mappings`
--

CREATE TABLE `sol_lgpd_field_mappings` (
  `ref_field` int NOT NULL,
  `ref_lgpd` int NOT NULL,
  `ref_lgpd_data` int NOT NULL,
  `ref_data_group` int NOT NULL,
  `content` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  KEY `sol_lgpd_field_map_field` (`ref_field`),
  KEY `sol_lgpd_field_map_lgpd` (`ref_lgpd`),
  KEY `sol_lgpd_field_maps_lgpd_data` (`ref_lgpd_data`),
  KEY `sol_lgpd_field_maps_group` (`ref_data_group`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpd_field_mappings`
--


--
-- Table structure for table `sol_lgpd_form_configs`
--

CREATE TABLE `sol_lgpd_form_configs` (
  `ref_lgpd` int NOT NULL,
  `ref_report` int NOT NULL,
  `ref_occurrence_type` int NOT NULL,
  `show_type` tinyint NOT NULL,
  UNIQUE KEY `ref_lgpd` (`ref_lgpd`,`ref_report`,`ref_occurrence_type`),
  KEY `sol_lgpd_form_configs_lgpd` (`ref_lgpd`),
  KEY `sol_lgpd_form_configs_report` (`ref_report`),
  KEY `sol_lgpd_form_configs_occ_type` (`ref_occurrence_type`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpd_form_configs`
--


--
-- Table structure for table `sol_lgpd_forms`
--

CREATE TABLE `sol_lgpd_forms` (
  `ref_lgpd` int NOT NULL,
  `ref_occurrence_type` int NOT NULL,
  UNIQUE KEY `ref_lgpd` (`ref_lgpd`,`ref_occurrence_type`),
  KEY `sol_lgpd_forms_lgpd` (`ref_lgpd`),
  KEY `sol_lgpd_forms_occurrence_type` (`ref_occurrence_type`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpd_forms`
--


--
-- Table structure for table `sol_lgpd_group_configs`
--

CREATE TABLE `sol_lgpd_group_configs` (
  `ref_lgpd` int NOT NULL,
  `ref_report` int NOT NULL,
  `ref_data_group` int NOT NULL,
  `show_data_group` tinyint NOT NULL,
  UNIQUE KEY `ref_lgpd` (`ref_lgpd`,`ref_report`,`ref_data_group`),
  KEY `sol_lgpd_group_configs_lgpd` (`ref_lgpd`),
  KEY `sol_lgpd_group_configs_report` (`ref_report`),
  KEY `sol_lgpd_group_configs_group` (`ref_data_group`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpd_group_configs`
--


--
-- Table structure for table `sol_lgpd_group_mappings`
--

CREATE TABLE `sol_lgpd_group_mappings` (
  `ref_lgpd` int NOT NULL,
  `ref_data_group` int NOT NULL,
  UNIQUE KEY `ref_lgpd` (`ref_lgpd`,`ref_data_group`),
  KEY `sol_lgpd_group_mappings_lgpd` (`ref_lgpd`),
  KEY `sol_lgpd_group_mappings_group` (`ref_data_group`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpd_group_mappings`
--


--
-- Table structure for table `sol_lgpd_handling_form_fields`
--

CREATE TABLE `sol_lgpd_handling_form_fields` (
  `id` int NOT NULL,
  `ref_handling_form` int NOT NULL,
  `ref_option` int NOT NULL,
  `position` int NOT NULL,
  `type` tinyint NOT NULL,
  `options` varchar(32) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sol_lgpd_hand_form_f_hand_form` (`ref_handling_form`),
  KEY `sol_lgpd_hand_form_f_opt` (`ref_option`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpd_handling_form_fields`
--


--
-- Table structure for table `sol_lgpd_handling_forms`
--

CREATE TABLE `sol_lgpd_handling_forms` (
  `id` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_team` int NOT NULL,
  `ref_category` int NOT NULL,
  `state` tinyint NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `dt_created` date NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`),
  KEY `sol_lgpd_handling_forms_owner` (`ref_owner`),
  KEY `sol_lgpd_handling_forms_team` (`ref_team`),
  KEY `sol_lgpd_handling_forms_cat` (`ref_category`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpd_handling_forms`
--


--
-- Table structure for table `sol_lgpd_option_items`
--

CREATE TABLE `sol_lgpd_option_items` (
  `id` int NOT NULL,
  `ref_option` int NOT NULL,
  `position` int NOT NULL,
  `state` tinyint NOT NULL,
  `value` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sol_lgpd_option_items_option` (`ref_option`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpd_option_items`
--


--
-- Table structure for table `sol_lgpd_options`
--

CREATE TABLE `sol_lgpd_options` (
  `id` int NOT NULL,
  `ref_category` int NOT NULL,
  `state` tinyint NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sol_lgpd_options_category` (`ref_category`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpd_options`
--


--
-- Table structure for table `sol_lgpd_report_configs`
--

CREATE TABLE `sol_lgpd_report_configs` (
  `id` int NOT NULL,
  `ref_lgpd` int NOT NULL,
  `ref_report` int NOT NULL,
  `periodicity` tinyint NOT NULL,
  `consolidation` tinyint NOT NULL,
  `dt_start` date DEFAULT NULL,
  `options` varchar(32) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sol_lgpd_report_configs_lgpd` (`ref_lgpd`),
  KEY `sol_lgpd_report_configs_report` (`ref_report`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpd_report_configs`
--


--
-- Table structure for table `sol_lgpd_reports`
--

CREATE TABLE `sol_lgpd_reports` (
  `id` int NOT NULL,
  `ref_lgpd` int NOT NULL,
  `ref_owner` int NOT NULL,
  `classification` int NOT NULL,
  `state` tinyint NOT NULL,
  `type` tinyint NOT NULL,
  `dt_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `dt_start` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `dt_end` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `dt_finished` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`),
  KEY `sol_lgpd_reports_lgpd` (`ref_lgpd`),
  KEY `sol_lgpd_reports_owner` (`ref_owner`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpd_reports`
--


--
-- Table structure for table `sol_lgpd_risks`
--

CREATE TABLE `sol_lgpd_risks` (
  `ref_lgpd` int NOT NULL,
  `ref_risk` int NOT NULL,
  `ref_structure` int NOT NULL,
  UNIQUE KEY `ref_lgpd` (`ref_lgpd`,`ref_risk`,`ref_structure`),
  KEY `sol_lgpd_risks_lgpd` (`ref_lgpd`),
  KEY `sol_lgpd_risks_risk` (`ref_risk`),
  KEY `sol_lgpd_risks_structure` (`ref_structure`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpd_risks`
--


--
-- Table structure for table `sol_lgpds`
--

CREATE TABLE `sol_lgpds` (
  `id` int NOT NULL,
  `ref_controller` int NOT NULL,
  `ref_dpo` int NOT NULL,
  `ref_team` int NOT NULL,
  `ref_unit` int NOT NULL,
  `restriction` int NOT NULL,
  `state` tinyint NOT NULL,
  `description` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`),
  KEY `sol_lgpds_controller` (`ref_controller`),
  KEY `sol_lgpds_dpo` (`ref_dpo`),
  KEY `sol_lgpds_team` (`ref_team`),
  KEY `sol_lgpds_unit` (`ref_unit`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `sol_lgpds`
--


--
-- Table structure for table `svc_contract_requirements`
--

CREATE TABLE `svc_contract_requirements` (
  `id` int NOT NULL,
  `ref_contract` int NOT NULL,
  `ref_requirement` int NOT NULL,
  `ref_approver` int NOT NULL,
  `ref_document` int NOT NULL,
  `version` int NOT NULL,
  `origin` tinyint NOT NULL,
  `state` tinyint NOT NULL,
  `dt_from` date NOT NULL,
  `dt_limit` date NOT NULL,
  `dt_approval` date DEFAULT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `svc_cont_req_ref_contract` (`ref_contract`),
  KEY `svc_cont_req_ref_requirement` (`ref_requirement`),
  KEY `svc_cont_req_ref_approver` (`ref_approver`),
  KEY `svc_cont_req_ref_document` (`ref_document`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `svc_contract_requirements`
--


--
-- Table structure for table `svc_contracts`
--

CREATE TABLE `svc_contracts` (
  `id` int NOT NULL,
  `ref_provider` int NOT NULL,
  `ref_service` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_tags` int NOT NULL,
  `restriction` int NOT NULL,
  `state` tinyint NOT NULL,
  `contract_value` double NOT NULL,
  `dt_from` date NOT NULL,
  `dt_until` date DEFAULT NULL,
  `dt_signature` date NOT NULL,
  `dt_negotiation` date DEFAULT NULL,
  `dt_readjustment` date DEFAULT NULL,
  `currency` varchar(30) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `serial` varchar(32) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `contract_adjustment` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `invoice_day` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `ix_svc_contracts_prov` (`ref_provider`),
  KEY `ix_svc_contracts_serv` (`ref_service`),
  KEY `ix_svc_contracts_owner` (`ref_owner`),
  KEY `ix_svc_contracts_restrict` (`restriction`),
  KEY `svc_contracts_tags` (`ref_tags`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `svc_contracts`
--


--
-- Table structure for table `svc_evaluations`
--

CREATE TABLE `svc_evaluations` (
  `id` int NOT NULL,
  `ref_contract` int NOT NULL,
  `ref_provider` int NOT NULL,
  `ref_service` int NOT NULL,
  `ref_checklist` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_appraiser` int NOT NULL,
  `type` int NOT NULL,
  `state` int NOT NULL,
  `result` double NOT NULL,
  `dt_from` date DEFAULT NULL,
  `dt_until` date DEFAULT NULL,
  `dt_created` date NOT NULL,
  `dt_finished` date NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `feedback` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `svc_evaluat_ref_contract` (`ref_contract`),
  KEY `svc_evaluat_ref_provider` (`ref_provider`),
  KEY `svc_evaluat_ref_service` (`ref_service`),
  KEY `svc_evaluat_ref_checklist` (`ref_checklist`),
  KEY `svc_evaluat_ref_owner` (`ref_owner`),
  KEY `svc_evaluat_ref_appraiser` (`ref_appraiser`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `svc_evaluations`
--


--
-- Table structure for table `svc_payments`
--

CREATE TABLE `svc_payments` (
  `id` int NOT NULL,
  `ref_contract` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_approver` int NOT NULL,
  `nf` int DEFAULT NULL,
  `seq_no` int NOT NULL,
  `state` int NOT NULL,
  `score` double DEFAULT NULL,
  `v_nominal` double NOT NULL,
  `v_liquid` double DEFAULT NULL,
  `dt_from` date NOT NULL,
  `dt_until` date NOT NULL,
  `dt_payment` date DEFAULT NULL,
  `dt_due` date DEFAULT NULL,
  `dt_approved` date DEFAULT NULL,
  `n_ticket` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `info_approved` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  `info_paid` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`),
  KEY `svc_payments_contract` (`ref_contract`),
  KEY `svc_payments_owner` (`ref_owner`),
  KEY `svc_payments_approver` (`ref_approver`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `svc_payments`
--


--
-- Table structure for table `svc_provider_candidates`
--

CREATE TABLE `svc_provider_candidates` (
  `ref_provider` int NOT NULL,
  `ref_service` int NOT NULL,
  UNIQUE KEY `ref_provider` (`ref_provider`,`ref_service`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `svc_provider_candidates`
--


--
-- Table structure for table `svc_provider_contacts`
--

CREATE TABLE `svc_provider_contacts` (
  `id` int NOT NULL,
  `ref_provider` int NOT NULL,
  `position` tinyint NOT NULL,
  `type` varchar(40) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `phone` varchar(40) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `email` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `ix_svc_provider_cont_prov` (`ref_provider`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `svc_provider_contacts`
--


--
-- Table structure for table `svc_providers`
--

CREATE TABLE `svc_providers` (
  `id` int NOT NULL,
  `ref_category` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_tags` int NOT NULL,
  `type` tinyint NOT NULL,
  `state` tinyint NOT NULL,
  `requirements_state` tinyint NOT NULL,
  `dt_last_performance` date DEFAULT NULL,
  `dt_next_performance` date DEFAULT NULL,
  `country` char(2) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `uf` varchar(10) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `cep` varchar(10) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `options` varchar(32) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `identity` varchar(40) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `legal_name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `public_name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `address` varchar(200) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `location` varchar(200) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `region` varchar(200) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `ix_svc_providers_category` (`ref_category`),
  KEY `ix_svc_providers_owner` (`ref_owner`),
  KEY `svc_providers_tags` (`ref_tags`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `svc_providers`
--


--
-- Table structure for table `svc_requirement_validations`
--

CREATE TABLE `svc_requirement_validations` (
  `id` int NOT NULL,
  `ref_service_requirement` int NOT NULL,
  `ref_contract` int NOT NULL,
  `state` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `svc_req_val_requirement` (`ref_service_requirement`),
  KEY `svc_req_val_contract` (`ref_contract`),
  KEY `svc_req_val_state` (`state`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `svc_requirement_validations`
--


--
-- Table structure for table `svc_service_requirements`
--

CREATE TABLE `svc_service_requirements` (
  `id` int NOT NULL,
  `ref_service` int NOT NULL,
  `validity_limit` int NOT NULL,
  `type` tinyint NOT NULL,
  `validity_unit` tinyint NOT NULL,
  `option` tinyint NOT NULL,
  `state` tinyint NOT NULL,
  `requirement_type` tinyint NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  PRIMARY KEY (`id`),
  KEY `svc_serv_req_ref_service` (`ref_service`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `svc_service_requirements`
--


--
-- Table structure for table `svc_topic_results`
--

CREATE TABLE `svc_topic_results` (
  `ref_evaluation` int NOT NULL,
  `ref_checklist_topics` int NOT NULL,
  `ref_scale_items` int NOT NULL,
  `result` int NOT NULL,
  `feedback` varchar(4000) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  UNIQUE KEY `ref_evaluation` (`ref_evaluation`,`ref_checklist_topics`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `svc_topic_results`
--


--
-- Table structure for table `vfs_files`
--

CREATE TABLE `vfs_files` (
  `id` int NOT NULL,
  `ref_folder` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_model` int NOT NULL,
  `ref_team` int NOT NULL,
  `restriction` int NOT NULL,
  `family` smallint NOT NULL,
  `dt_created` date NOT NULL,
  `name` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `vfs_files_restriction` (`restriction`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `vfs_files`
--

INSERT INTO `vfs_files` VALUES (1,3,1,0,0,0,133,'2022-10-14','#46269',''),(2,3,1,0,0,0,133,'2022-10-14','#45981',''),(3,3,1,0,0,0,133,'2022-10-14','#45706',''),(4,3,1,0,0,0,133,'2022-10-14','#45821',''),(5,3,1,0,0,0,133,'2022-10-14','#45818',''),(6,3,1,0,0,0,133,'2022-10-14','#45813',''),(7,3,1,0,0,0,133,'2022-10-14','#45811',''),(8,3,1,0,0,0,133,'2022-10-14','#45815',''),(9,3,1,0,0,0,133,'2022-10-14','#48393',''),(10,3,1,0,0,0,133,'2022-10-14','#48236',''),(11,3,1,0,0,0,133,'2022-10-14','#50275',''),(12,3,1,0,0,0,133,'2022-10-14','#45806',''),(13,3,1,0,0,0,133,'2022-10-14','#45808',''),(14,3,1,0,0,0,133,'2022-10-14','#46129',''),(15,3,1,0,0,0,133,'2022-10-14','#45817',''),(16,3,1,0,0,0,133,'2022-10-14','#45816',''),(17,3,1,0,0,0,133,'2022-10-14','#45810',''),(18,3,1,0,0,0,133,'2022-10-14','#45982',''),(19,3,1,0,0,0,133,'2022-10-14','#45809',''),(20,3,1,0,0,0,133,'2022-10-14','#48242',''),(21,3,1,0,0,0,133,'2022-10-14','#56928',''),(22,3,1,0,0,0,133,'2022-10-14','#56813',''),(23,3,1,0,0,0,133,'2022-10-14','#55613',''),(24,3,1,0,0,0,133,'2022-10-14','#55296',''),(25,3,1,0,0,0,133,'2022-10-14','#55321',''),(26,3,1,0,0,0,133,'2022-10-14','#53737',''),(27,3,1,0,0,0,133,'2022-10-14','#52392',''),(28,3,1,0,0,0,133,'2022-10-14','#52394',''),(29,3,1,0,0,0,133,'2022-10-14','#52395',''),(30,3,1,0,0,0,133,'2022-10-14','#52396',''),(31,3,1,0,0,0,133,'2022-10-14','#52335','');

--
-- Table structure for table `vfs_folders`
--

CREATE TABLE `vfs_folders` (
  `id` int NOT NULL,
  `ref_parent` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_team` int NOT NULL,
  `restriction` int NOT NULL,
  `ts_created` timestamp NULL DEFAULT NULL,
  `name` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `vfs_folders_restriction` (`restriction`),
  KEY `vfs_folders_team` (`ref_team`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `vfs_folders`
--

INSERT INTO `vfs_folders` VALUES (1,0,0,0,0,NULL,'<ROOT>',''),(2,0,4,0,0,NULL,'<ROOT>',''),(3,0,1,0,0,NULL,'<ROOT>','');

--
-- Table structure for table `vfs_previews`
--

CREATE TABLE `vfs_previews` (
  `id` int NOT NULL,
  `data` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `vfs_previews`
--


--
-- Table structure for table `vfs_recent_files`
--

CREATE TABLE `vfs_recent_files` (
  `ref_user` int NOT NULL,
  `ref_file` int NOT NULL,
  `dt_access` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  UNIQUE KEY `ref_user` (`ref_user`,`ref_file`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `vfs_recent_files`
--

INSERT INTO `vfs_recent_files` VALUES (1,1,'2022-10-14 01:31:01'),(1,2,'2022-10-14 01:31:01'),(1,3,'2022-10-14 01:31:01'),(1,4,'2022-10-14 01:31:02'),(1,5,'2022-10-14 01:31:02'),(1,6,'2022-10-14 01:31:02'),(1,7,'2022-10-14 01:31:02'),(1,8,'2022-10-14 01:31:02'),(1,9,'2022-10-14 01:31:03'),(1,10,'2022-10-14 01:31:03'),(1,11,'2022-10-14 01:31:03'),(1,12,'2022-10-14 01:31:03'),(1,13,'2022-10-14 01:31:03'),(1,14,'2022-10-14 01:31:03'),(1,15,'2022-10-14 01:31:04'),(1,16,'2022-10-14 01:31:04'),(1,17,'2022-10-14 01:31:04'),(1,18,'2022-10-14 01:31:04'),(1,19,'2022-10-14 01:31:05'),(1,20,'2022-10-14 01:31:05'),(1,21,'2022-10-14 01:31:05'),(1,22,'2022-10-14 01:31:05'),(1,23,'2022-10-14 01:31:06'),(1,24,'2022-10-14 01:31:06'),(1,25,'2022-10-14 01:31:06'),(1,26,'2022-10-14 01:31:06'),(1,27,'2022-10-14 01:31:06'),(1,28,'2022-10-14 01:31:06'),(1,29,'2022-10-14 01:31:07'),(1,30,'2022-10-14 01:31:07'),(1,31,'2022-10-14 01:31:07');

--
-- Table structure for table `vfs_roots`
--

CREATE TABLE `vfs_roots` (
  `id` int NOT NULL,
  `ref_source` int NOT NULL,
  `family` smallint NOT NULL,
  `scope` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ref_source` (`ref_source`,`family`,`scope`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `vfs_roots`
--

INSERT INTO `vfs_roots` VALUES (1,0,14,0),(3,1,133,0),(2,4,14,2);

--
-- Table structure for table `wd_bindings`
--

CREATE TABLE `wd_bindings` (
  `id` int NOT NULL,
  `ref_from_task` int NOT NULL,
  `ref_to_task` int NOT NULL,
  `label_width` int NOT NULL,
  `label_height` int NOT NULL,
  `from_x` int NOT NULL,
  `from_y` int NOT NULL,
  `to_x` int NOT NULL,
  `to_y` int NOT NULL,
  `from_handle` tinyint NOT NULL,
  `to_handle` tinyint NOT NULL,
  `fl_deleted` tinyint NOT NULL,
  `message_type` tinyint NOT NULL,
  `text_color` varchar(7) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `anchor` varchar(40) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `label` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `font_style` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `line_segments` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ref_from_task` (`ref_from_task`,`ref_to_task`),
  KEY `wd_bindings_from_task` (`ref_from_task`),
  KEY `wd_bindings_to_task` (`ref_to_task`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `wd_bindings`
--


--
-- Table structure for table `wd_workflows`
--

CREATE TABLE `wd_workflows` (
  `id` int NOT NULL,
  `ref_owner` int NOT NULL,
  `ref_team` int NOT NULL,
  `restriction` int NOT NULL,
  `ref_folder` int NOT NULL,
  `dt_created` date NOT NULL,
  `name` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `wd_workflows_owner` (`ref_owner`),
  KEY `wd_workflows_team` (`ref_team`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `wd_workflows`
--


--
-- Table structure for table `web_embeddings`
--

CREATE TABLE `web_embeddings` (
  `ref_owner` int NOT NULL,
  `dt_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `uuid` varchar(40) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `name` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `source` varchar(250) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `web_embeddings`
--


--
-- Table structure for table `ws_contracts`
--

CREATE TABLE `ws_contracts` (
  `id` int NOT NULL,
  `state` tinyint NOT NULL,
  `alias` varchar(64) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `domain` varchar(80) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `name` varchar(160) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `info` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `alias` (`alias`),
  KEY `ix_ws_contracts_domain` (`domain`),
  KEY `ix_ws_contracts_alias` (`alias`),
  KEY `ix_ws_contracts_state` (`state`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ws_contracts`
--

INSERT INTO `ws_contracts` VALUES (1,0,'5aeee49b-f498-47ba-9dbe-ae8db3b64e70','$SYSTEM','$SYSTEM','');

--
-- Table structure for table `ws_sessions`
--

CREATE TABLE `ws_sessions` (
  `id` int NOT NULL,
  `ref_contract` int NOT NULL,
  `ref_access` int NOT NULL,
  `request_count` int NOT NULL,
  `state` tinyint NOT NULL,
  `started` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `closed` timestamp NULL DEFAULT NULL,
  `timeout` timestamp NULL DEFAULT NULL,
  `alias` varchar(64) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `alias` (`alias`),
  KEY `ix_ws_sessions_contract` (`ref_contract`),
  KEY `ix_ws_sessions_access` (`ref_access`),
  KEY `ix_ws_sessions_alias` (`alias`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

--
-- Dumping data for table `ws_sessions`
--



