-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `core_advertisements`
--

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

--
-- Table structure for table `global_advertisements`
--

CREATE TABLE `global_advertisements` (
  `relative` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'The unique relative',
  `users_sid` varchar(50) NOT NULL COMMENT 'Related to global_users',
  `categories` tinytext NOT NULL COMMENT 'Categories, separated by commas, related to catalogs category table',
  `content_type` tinytext NOT NULL COMMENT 'The content type separated by commas related to catalogs items table',
  `only_text_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'The basic content',
  `rich_resume_contentt` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'The resume content with rich text',
  `rich_full_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'The full content with rich text',
  `attachment_type` enum('I','C') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'I=Images, C=Catalogs PDF',
  `attachments` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci COMMENT 'Many files separated by commas',
  `keywords` tinytext NOT NULL COMMENT 'Keywords separated by commas',
  `contact_way` enum('W','F','N','E','L') NOT NULL DEFAULT 'W' COMMENT 'W=Whatsapp, F=Facebook, N=Just number, E=Email, L=Link',
  `contact_informationv` tinytext NOT NULL,
  `status` enum('A','X') NOT NULL DEFAULT 'A' COMMENT 'A=Active, X=Deleted',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

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

--
-- Table structure for table `global_advertisements_favorites`
--

CREATE TABLE `global_advertisements_favorites` (
  `relative` varchar(50) NOT NULL COMMENT 'The unique UUID',
  `users_sid` varchar(50) NOT NULL COMMENT 'Related to users table',
  `global_advertisements_id` int NOT NULL COMMENT 'Related to global_advertisements table',
  `status` enum('A','X') NOT NULL DEFAULT 'A' COMMENT 'A=Active, X=Deleted',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

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

--
-- Table structure for table `global_advertisements_flag`
--

CREATE TABLE `global_advertisements_flag` (
  `relative` varchar(50) NOT NULL COMMENT 'The unique UUID',
  `users_sidv` varchar(50) NOT NULL COMMENT 'Related to users table',
  `global_advertisements_id` int NOT NULL COMMENT 'Related to global_advertisements table',
  `reason_id` int NOT NULL COMMENT 'Related to reason ID on catalogs items table',
  `flags` int NOT NULL DEFAULT '0' COMMENT 'The flags quantity',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

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

--
-- Table structure for table `global_advertisements_published`
--

CREATE TABLE `global_advertisements_published` (
  `relative` varchar(50) NOT NULL COMMENT 'Unique UUID',
  `users_sid` varchar(50) NOT NULL COMMENT 'Related to users table',
  `global_advertisements_id` varchar(50) NOT NULL COMMENT 'Related to global_advertisements table',
  `published_since` date NOT NULL COMMENT 'Start date',
  `published_until` date NOT NULL COMMENT 'Final date',
  `times_published` smallint NOT NULL COMMENT 'Times published',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

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

--
-- Table structure for table `global_catalog_items`
--

CREATE TABLE `global_catalog_items` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'global_users',
  `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` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci 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 DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

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

--
-- Table structure for table `global_person`
--

CREATE TABLE `global_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,
  `whatsapp_number` enum('Y','N') NOT NULL DEFAULT 'Y',
  `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=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `global_person`
--

INSERT INTO `global_person` (`id`, `users_sid`, `first_name`, `last_name`, `phone_number`, `whatsapp_number`, `country_id`, `status`, `created_at`, `updated_at`) VALUES
(1, '69abe0de-7812-41bd-9124-6a7238aee7d1', 'José', 'Aparicio', '76108443', 'Y', 27, 'A', '2021-06-24 16:09:51', '2021-10-22 09:39:28');

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

--
-- Table structure for table `global_template`
--

CREATE TABLE `global_template` (
  `relative` varchar(50) NOT NULL COMMENT 'The unique UUID',
  `users_sid` varchar(50) NOT NULL COMMENT 'Related to users sid',
  `content_type` tinyint NOT NULL COMMENT 'The content type separated by commas related to catalogs items table',
  `label` varchar(50) NOT NULL,
  `type` enum('ST','LT','A') NOT NULL COMMENT 'ST=Small text, LT=Long text, A=Ammount, ',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `global_advertisements`
--
ALTER TABLE `global_advertisements`
  ADD PRIMARY KEY (`relative`),
  ADD UNIQUE KEY `core_advertisements.relative` (`relative`);

--
-- Indexes for table `global_advertisements_favorites`
--
ALTER TABLE `global_advertisements_favorites`
  ADD PRIMARY KEY (`relative`),
  ADD UNIQUE KEY `relative` (`relative`);

--
-- Indexes for table `global_advertisements_flag`
--
ALTER TABLE `global_advertisements_flag`
  ADD PRIMARY KEY (`relative`),
  ADD UNIQUE KEY `relative` (`relative`);

--
-- Indexes for table `global_advertisements_published`
--
ALTER TABLE `global_advertisements_published`
  ADD PRIMARY KEY (`relative`),
  ADD UNIQUE KEY `global_advertisements_published.relative` (`relative`);

--
-- Indexes for table `global_catalog_items`
--
ALTER TABLE `global_catalog_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `value` (`value`);

--
-- Indexes for table `global_person`
--
ALTER TABLE `global_person`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `global_template`
--
ALTER TABLE `global_template`
  ADD PRIMARY KEY (`relative`),
  ADD UNIQUE KEY `relative` (`relative`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `global_catalog_items`
--
ALTER TABLE `global_catalog_items`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `global_person`
--
ALTER TABLE `global_person`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
COMMIT;

