-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 14-10-2021 a las 11:07:36
-- Versión del servidor: 5.7.24
-- Versión de PHP: 7.4.20

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Base de datos: `core_services`
--

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

--
-- Estructura de tabla para la tabla `service`
--

CREATE TABLE `service` (
  `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 'global_branch_office',
  `razon_social` varchar(250) NOT NULL,
  `actividad` varchar(200) NOT NULL,
  `responsable` varchar(200) NOT NULL,
  `cedula` varchar(35) NOT NULL,
  `direccion` varchar(200) NOT NULL,
  `sucursal` varchar(200) NOT NULL,
  `ciudad` varchar(200) NOT NULL,
  `telefonos` varchar(200) NOT NULL,
  `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=latin1;

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

--
-- Estructura de tabla para la tabla `service_sell`
--

CREATE TABLE `service_sell` (
  `id` int(11) NOT NULL,
  `service_id` varchar(50) NOT NULL COMMENT 'related to service table',
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table ',
  `service_date` date NOT NULL,
  `fullname` varchar(250) NOT NULL,
  `nit` varchar(50) DEFAULT NULL,
  `total` decimal(10,4) NOT NULL,
  `currency_id` int(11) NOT NULL COMMENT 'related to currency table',
  `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=latin1;

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

--
-- Estructura de tabla para la tabla `service_sell_detail`
--

CREATE TABLE `service_sell_detail` (
  `id` int(11) NOT NULL,
  `service_id` varchar(50) NOT NULL COMMENT 'related to service table',
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `service_sell_id` int(11) NOT NULL COMMENT 'Related to service sell table',
  `services_id` int(11) NOT NULL COMMENT 'related to service_services table',
  `description` text,
  `price` decimal(10,4) NOT NULL,
  `currency_id` int(11) NOT NULL,
  `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=latin1;

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

--
-- Estructura de tabla para la tabla `service_services`
--

CREATE TABLE `service_services` (
  `id` int(11) NOT NULL,
  `service_id` varchar(50) NOT NULL COMMENT 'related to service table',
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `category_id` int(11) NOT NULL COMMENT 'related to catalogs items',
  `description` text NOT NULL,
  `measurement_id` int(11) NOT NULL COMMENT 'related to catalogs items',
  `pricebrand` decimal(10,4) NOT NULL,
  `currency_id` int(11) NOT NULL COMMENT 'related to currency table',
  `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=latin1;

--
-- Índices para tablas volcadas
--

--
-- Indices de la tabla `service`
--
ALTER TABLE `service`
  ADD PRIMARY KEY (`relative`);

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

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

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

--
-- AUTO_INCREMENT de las tablas volcadas
--

--
-- AUTO_INCREMENT de la tabla `service_sell`
--
ALTER TABLE `service_sell`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `service_sell_detail`
--
ALTER TABLE `service_sell_detail`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `service_services`
--
ALTER TABLE `service_services`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
