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

START TRANSACTION;













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

--
-- Table structure for table `customers_catalog_items`
--

CREATE TABLE `customers_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;

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

--
-- Table structure for table `portfolio_customers`
--

CREATE TABLE `portfolio_customers` (
  `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',
  `customer_type_id` int NOT NULL COMMENT 'Related to catalogs item',
  `code` varchar(100) DEFAULT NULL,
  `first_name` varchar(75) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `middle_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'Could be null',
  `last_name` varchar(50) DEFAULT NULL COMMENT 'Could be null',
  `country_id` int NOT NULL COMMENT 'Related to country table',
  `document_type` int NOT NULL COMMENT 'Related to catalogs table = DOCTYPE',
  `document_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '0',
  `customer_complemento` varchar(5) DEFAULT NULL COMMENT 'The complement',
  `gender_id` int DEFAULT NULL COMMENT 'Related to catalogs items = GENDER',
  `birthday` date DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `social_media` text,
  `phones` varchar(150) DEFAULT NULL,
  `address` varchar(512) DEFAULT NULL,
  `references` mediumtext,
  `photo` text,
  `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;

--
-- Indexes for dumped tables
--

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

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

--
-- AUTO_INCREMENT for dumped tables
--

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

