-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 16-12-2022 a las 09:37:30
-- Versión del servidor: 8.0.31-0ubuntu0.20.04.2
-- Versión de PHP: 7.4.3

START TRANSACTION;



--
-- Base de datos: `core_employee`
--

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `core_employee_catalog_items`
--

CREATE TABLE `core_employee_catalog_items` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'global_users',
  `global_branch_office_id` varchar(50) DEFAULT NULL COMMENT 'global_branch_office',
  `value` int NOT NULL,
  `label` varchar(250) NOT NULL,
  `lang` varchar(5) NOT NULL,
  `catalog_code` varchar(50) NOT NULL,
  `catalog_code_dep` varchar(50) NOT NULL,
  `catalog_id_dep` int NOT NULL,
  `description` varchar(512) NOT NULL,
  `svg_image` varchar(150) DEFAULT NULL,
  `status` varchar(2) NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=FEDERATED DEFAULT CHARSET=utf8mb3 CONNECTION='mysql://root:Ma!9an1s@localhost:3306/core/global_catalog_items';

CREATE TABLE `core_employee_currency` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL,
  `currency` varchar(50) NOT NULL,
  `code` varchar(15) NOT NULL,
  `usd_dollar` enum('Y','N') NOT NULL DEFAULT 'N',
  `global_countries_id` int NOT NULL COMMENT 'global_countries',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=FEDERATED DEFAULT CHARSET=utf8mb3 CONNECTION='mysql://root:Ma!9an1s@localhost:3306/core/global_currency';


CREATE TABLE `core_employee_person` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL,
  `first_name` varchar(50) NOT NULL COMMENT 'The first and middle name',
  `last_name` varchar(75) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'Last name',
  `phone_number` varchar(200) DEFAULT NULL,
  `intern` varchar(75) DEFAULT NULL COMMENT '	Intern number',
  `cargo_id` int NOT NULL COMMENT 'Related to catalogs',
  `area_id` int NOT NULL COMMENT 'Related to catalogs',
  `country_id` int DEFAULT NULL COMMENT 'Related to country table',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP
) ENGINE=FEDERATED DEFAULT CHARSET=utf8mb3 CONNECTION='mysql://root:Ma!9an1s@localhost:3306/core/global_person';


CREATE TABLE `core_employee_users` (
  `id` bigint NOT NULL,
  `sid` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'uuid()',
  `person_id` int NOT NULL COMMENT 'related to person table',
  `global_branch_office_id` varchar(50) DEFAULT NULL COMMENT 'global_branch_office',
  `profile_picture` varchar(50) DEFAULT NULL COMMENT 'The complete filename',
  `email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'email',
  `password` tinytext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'The password',
  `remember_token` text COMMENT 'The Token',
  `ttl` int NOT NULL DEFAULT '172800' COMMENT 'The time logged in',
  `wrong_login_attempt` tinyint NOT NULL DEFAULT '0' COMMENT 'Times wrong',
  `date_wrong_login_attempt` date DEFAULT NULL COMMENT 'Date when wrong',
  `client_ip` varchar(50) DEFAULT NULL COMMENT 'the clients IP',
  `status` enum('A','X','B') NOT NULL,
  `created_at` timestamp NOT NULL COMMENT 'When the user were created',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'When the user were updated'
) ENGINE=FEDERATED DEFAULT CHARSET=utf8mb3 CONNECTION='mysql://root:Ma!9an1s@localhost:3306/core/global_users';


CREATE TABLE `employee_catalog_items` (
  `id` int NOT NULL,
  `catalogs_id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL,
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to branch office',
  `value` int NOT NULL,
  `label` varchar(250) NOT NULL,
  `lang` varchar(5) NOT NULL,
  `catalog_code` varchar(50) NOT NULL,
  `catalog_code_dep` varchar(50) NOT NULL,
  `catalog_id_dep` int NOT NULL,
  `description` varchar(512) NOT NULL,
  `svg_image` varchar(150) DEFAULT NULL,
  `status` varchar(2) NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `enterprise_employee`
--

CREATE TABLE `enterprise_employee` (
  `relative` varchar(50) NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'Related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'Related to branch office on core',
  `code` varchar(100) DEFAULT NULL,
  `first_name` varchar(250) NOT NULL,
  `last_name` varchar(250) NOT NULL,
  `documento` varchar(50) NOT NULL DEFAULT '0',
  `email` varchar(100) DEFAULT NULL,
  `phones` varchar(150) DEFAULT NULL,
  `address` varchar(512) DEFAULT NULL,
  `references` mediumtext,
  `photo` varchar(250) DEFAULT NULL COMMENT 'Photo from customer',
  `status` varchar(2) NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Índices para tablas volcadas
--

--
-- Indices de la tabla `employee_catalog_items`
--
ALTER TABLE `employee_catalog_items`
  ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `enterprise_employee`
--
ALTER TABLE `enterprise_employee`
  ADD PRIMARY KEY (`relative`),
  ADD UNIQUE KEY `relative` (`relative`);

--
-- AUTO_INCREMENT de las tablas volcadas
--

--
-- AUTO_INCREMENT de la tabla `employee_catalog_items`
--
ALTER TABLE `employee_catalog_items`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;
COMMIT;

