CREATE TABLE `failed_jobs` (
  `id` bigint UNSIGNED NOT NULL,
  `uuid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `jobs`
--

CREATE TABLE `jobs` (
  `id` bigint UNSIGNED NOT NULL,
  `queue` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` tinyint UNSIGNED NOT NULL,
  `reserved_at` int UNSIGNED DEFAULT NULL,
  `available_at` int UNSIGNED NOT NULL,
  `created_at` int UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `sivir_bolivian_invoice`
--

CREATE TABLE `sivir_bolivian_invoice` (
  `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',
  `nit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Numero de identificacion tributaria',
  `economic_activity_id` mediumint NOT NULL COMMENT 'Related to catalogs = ACTIVITIES',
  `ley_id` mediumint DEFAULT NULL COMMENT 'Related to catalogs = LISTALEYENDASFACTURA',
  `leyenda` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Leyenda debajo de la factura',
  `codigo_modalidad` int NOT NULL DEFAULT '2',
  `codigo_sucursal` tinyint NOT NULL DEFAULT '0',
  `tipo_factura_id` int NOT NULL COMMENT 'Related to catalogs items = "TIPOFACTURA"',
  `page_format` enum('A4','A7') NOT NULL DEFAULT 'A4' COMMENT 'A4=popular page format,\r\nA7=For thermal printer',
  `include_logo` enum('Y','N') NOT NULL DEFAULT 'N' COMMENT 'Include the logo in the report or not',
  `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 `sivir_cafc_code`
--

CREATE TABLE `sivir_cafc_code` (
  `relative` varchar(50) NOT NULL COMMENT 'UUID data',
  `users_sid` varchar(50) NOT NULL COMMENT 'Related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'Related to branch table',
  `cafc_code` varchar(50) NOT NULL COMMENT 'CAFC Code',
  `tipo_factura_id` int NOT NULL COMMENT 'Related to catalogs items = "TIPOFACTURA"',
  `cafc_from` int NOT NULL COMMENT 'number from',
  `cafc_to` int NOT NULL COMMENT 'range to',
  `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 `sivir_catalog_items`
--

CREATE TABLE `sivir_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,
  `orden` int DEFAULT 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,
  `fob` enum('Y','N') NOT NULL DEFAULT 'N',
  `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 CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

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

--
-- Table structure for table `sivir_configuration`
--

CREATE TABLE `sivir_configuration` (
  `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',
  `decimals` smallint NOT NULL,
  `currency_id` int NOT NULL DEFAULT '1' COMMENT 'Related to currency table',
  `zofra` enum('Y','N') NOT NULL DEFAULT 'N',
  `inventory_method` enum('PEPS','UEPS','PEPP','UEPP') NOT NULL DEFAULT 'UEPS',
  `iva` decimal(10,2) NOT NULL,
  `round_price` enum('Y','N') NOT NULL DEFAULT 'Y' COMMENT 'Except the .50 ammount',
  `internal_control` enum('Y','N') NOT NULL DEFAULT 'N' COMMENT 'Just control the inventory, do not worry about the invoice',
  `show_due_date` enum('Y','N') NOT NULL DEFAULT 'N' COMMENT 'Show or not the due date on the sell',
  `supermarket_mode` enum('Y','N') NOT NULL DEFAULT 'N' COMMENT 'Enable the super market mode?',
  `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 `sivir_coupons`
--

CREATE TABLE `sivir_coupons` (
  `id` int NOT NULL COMMENT 'Autoincrement',
  `users_sid` varchar(50) NOT NULL COMMENT 'Related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'Related to branch table',
  `coupon_group` varchar(50) NOT NULL COMMENT 'The coupon name',
  `quantity_generated` int NOT NULL DEFAULT '1' COMMENT 'For the automaticaly generated',
  `product_id` varchar(50) DEFAULT NULL COMMENT 'Related to product table relative column',
  `amount` decimal(10,5) NOT NULL DEFAULT '0.00000' COMMENT 'The coupon ammount',
  `currency_id` int NOT NULL COMMENT 'Related to currency table',
  `expiration_date` date NOT NULL COMMENT 'The expiration date',
  `coupon_status` enum('V','U') NOT NULL DEFAULT 'V' COMMENT 'V=Valid, U=Used',
  `status` enum('A','X') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci 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 `sivir_cuis`
--

CREATE TABLE `sivir_cuis` (
  `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',
  `sell_point_id` varchar(50) NOT NULL COMMENT 'Related to sell point table',
  `codigo_punto_venta` int NOT NULL,
  `nombre_punto_venta` varchar(200) NOT NULL,
  `cuis` varchar(50) NOT NULL,
  `cuis_expiration_datetime` datetime NOT NULL,
  `message` varchar(150) 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=utf8mb3;

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

--
-- Table structure for table `sivir_deliver_input`
--

CREATE TABLE `sivir_deliver_input` (
  `relative` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `id` bigint NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to global_branch_office',
  `person_id` int NOT NULL COMMENT 'Related to person table',
  `deliver_reason` text NOT NULL COMMENT 'The complete reason',
  `total_items` decimal(15,5) NOT NULL COMMENT 'The total items',
  `date_delivered` date NOT NULL COMMENT 'The date delivered',
  `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;

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

--
-- Table structure for table `sivir_deliver_items`
--

CREATE TABLE `sivir_deliver_items` (
  `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 table',
  `provisional` varchar(50) DEFAULT NULL COMMENT ' The provisional uuid for the sale ',
  `deliver_input_id` bigint DEFAULT NULL COMMENT 'related to deliver table',
  `product_id` varchar(50) NOT NULL COMMENT 'related to product table',
  `product_code` varchar(50) DEFAULT NULL,
  `product_fullname` varchar(250) NOT NULL,
  `quantity` decimal(15,5) NOT NULL,
  `observations` text,
  `numeroSerie` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci COMMENT 'Serial number',
  `numeroImei` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci COMMENT 'Imei number',
  `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 `sivir_enterprise`
--

CREATE TABLE `sivir_enterprise` (
  `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',
  `fullname` varchar(250) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Enterprise name',
  `owner` varchar(250) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'The owner',
  `address` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'The address',
  `phones` varchar(150) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'The phones',
  `country` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Country',
  `city` tinytext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'City, as a text',
  `photo` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci COMMENT 'Image as attachment',
  `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 `sivir_gift_card`
--

CREATE TABLE `sivir_gift_card` (
  `id` int NOT NULL COMMENT 'ID Autoincrement',
  `users_sid` varchar(50) NOT NULL COMMENT 'Related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'Related to branch office',
  `gc_group` varchar(50) NOT NULL COMMENT 'The Gift card group for gift card',
  `quantity_generated` int NOT NULL DEFAULT '1' COMMENT 'For the automaticaly generated',
  `gc_serial` varchar(50) NOT NULL COMMENT 'The gift card alphanumeric serial unique',
  `amount` decimal(15,5) NOT NULL DEFAULT '0.00000' COMMENT 'The gift card amount total',
  `currency_id` int NOT NULL COMMENT 'Related to currency table',
  `expiration_date` date DEFAULT NULL COMMENT 'The expiration date for the gift card',
  `balance` decimal(15,5) NOT NULL DEFAULT '0.00000' COMMENT 'The total balance (El Saldo total)',
  `gc_status` enum('V','E','C','EO') NOT NULL DEFAULT 'V' COMMENT 'V=Valid, E=Expired, C=Cancelled, EO=Employees only',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'The date time, current',
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

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

--
-- Table structure for table `sivir_mass_mailing`
--

CREATE TABLE `sivir_mass_mailing` (
  `id` int 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 table',
  `event_number` int DEFAULT NULL,
  `invoices` text COMMENT 'Non related, separated by commas',
  `codigo_punto_venta` int DEFAULT NULL COMMENT 'Sellpoint code',
  `zofra` enum('Y','N') DEFAULT 'N' COMMENT 'Its zofra?',
  `tipo_emision` smallint DEFAULT '1' COMMENT '1: Online 2: Offline 3: Masiva',
  `codigoDescripcion` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `codigoEstado` int DEFAULT NULL,
  `codigoRecepcion` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT 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=utf8mb3;

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

--
-- Table structure for table `sivir_payment_way`
--

CREATE TABLE `sivir_payment_way` (
  `id` int 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 table',
  `payment_id` int NOT NULL COMMENT 'Related to catalogs items (PAYMENT)',
  `multiple` enum('Y','N') NOT NULL DEFAULT 'N' COMMENT 'Multiple payment or single payment (N means single)',
  `payments_related` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'The payments number, separated by comma, related to catalogs items (PAYMENT)',
  `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 `sivir_products`
--

CREATE TABLE `sivir_products` (
  `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 global_branch_office',
  `product_kind` enum('PCV','PCV0','IAF') NOT NULL DEFAULT 'PCV' COMMENT 'PCV = Regular product with inventory  Task actions \r\n\r\n        \r\n      \r\n PCV0 = Special product without inventory  Task actions \r\n\r\n        \r\n      \r\n IAF = Regular product with inventory but cant sell',
  `fullname` varchar(250) NOT NULL,
  `description` text NOT NULL,
  `code` varchar(50) NOT NULL,
  `category_id` int NOT NULL COMMENT 'Related to Catalogs item, catalog code = CATEGORY',
  `subcategory_id` int DEFAULT NULL COMMENT 'Related to Catalogs item = CATEGORY | SUBCATEGORY	',
  `brand_id` int NOT NULL COMMENT 'Related to catalogs items = BRAND',
  `images` text CHARACTER SET latin1 COLLATE latin1_swedish_ci COMMENT 'Max 5 images, Many URL separated by | on each data',
  `barcode` varchar(50) DEFAULT NULL,
  `enabled` enum('Y','N') NOT NULL DEFAULT 'Y' COMMENT 'Enable the product',
  `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;

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

--
-- Table structure for table `sivir_products_assistant`
--

CREATE TABLE `sivir_products_assistant` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'Related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'Related to catalogs = BRANCH',
  `provisional` varchar(50) DEFAULT NULL,
  `product_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'Related to product table',
  `assistant_id` smallint NOT NULL COMMENT 'Related to catalogs = ASSISTANT	',
  `specification` 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=utf8mb3;

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

--
-- Table structure for table `sivir_products_catalog_in_bolivian`
--

CREATE TABLE `sivir_products_catalog_in_bolivian` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'Related to users sid',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'Related to branch table',
  `codigo_producto` varchar(50) NOT NULL,
  `codigo_actividad` varchar(50) NOT NULL,
  `producto` text 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=utf8mb3;

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

--
-- Table structure for table `sivir_products_code_approved`
--

CREATE TABLE `sivir_products_code_approved` (
  `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',
  `product_id` varchar(50) NOT NULL COMMENT 'Related to products relative',
  `sincode_id` varchar(50) NOT NULL COMMENT 'related to sivir_products_catalog_in_bolivian table',
  `sin_code` varchar(50) 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=utf8mb3;

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

--
-- Table structure for table `sivir_products_discount`
--

CREATE TABLE `sivir_products_discount` (
  `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 global_branch_office',
  `groupby` enum('*','C','P') NOT NULL DEFAULT '*' COMMENT 'Group by',
  `category_id` int DEFAULT NULL COMMENT 'category from catalogs items',
  `product_id` varchar(50) DEFAULT NULL COMMENT 'related to products table',
  `limited_time` enum('Y','N') NOT NULL DEFAULT 'N' COMMENT 'yes or no',
  `starts_date` date DEFAULT NULL,
  `ends_date` date DEFAULT NULL,
  `kind` enum('T','VA') CHARACTER SET armscii8 COLLATE armscii8_bin NOT NULL COMMENT 'T = Total\r\nVA = Valor agregado',
  `math` enum('#','%') NOT NULL DEFAULT '%' COMMENT '#=Descuento numeral %=Descuento porcentual',
  `discount` decimal(10,5) 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;

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

--
-- Table structure for table `sivir_products_kardex`
--

CREATE TABLE `sivir_products_kardex` (
  `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 global_branch_office	',
  `product_id` varchar(50) NOT NULL COMMENT 'related to products table	',
  `iet` enum('I','E','T') NOT NULL DEFAULT 'E',
  `quantity` decimal(15,5) NOT NULL,
  `measurement_id` int NOT NULL COMMENT 'Related to Catalogs',
  `detail` text,
  `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;

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

--
-- Table structure for table `sivir_products_lot`
--

CREATE TABLE `sivir_products_lot` (
  `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 global_branch_office',
  `product_id` varchar(50) NOT NULL COMMENT 'related to products table',
  `warehouse_id` varchar(50) NOT NULL COMMENT 'Related to warehouse table',
  `physical_location` mediumtext,
  `lot` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `measurement_id` int NOT NULL COMMENT 'Related to catalogs prod (MEASUREMENT)',
  `initial_quantity` decimal(10,2) NOT NULL DEFAULT '0.00',
  `quantity` decimal(10,2) NOT NULL,
  `unit_cost` decimal(15,5) NOT NULL,
  `currency_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL COMMENT 'Related to global currency',
  `total_price` decimal(15,5) NOT NULL,
  `expires` enum('Y','N') NOT NULL DEFAULT 'N',
  `expiration_date` date DEFAULT 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;

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

--
-- Table structure for table `sivir_products_lot_history`
--

CREATE TABLE `sivir_products_lot_history` (
  `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 global_branch_office',
  `product_id` varchar(50) NOT NULL COMMENT 'related to products table',
  `warehouse_id` varchar(50) NOT NULL COMMENT 'Related to warehouse table',
  `physical_location` text,
  `lot` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `measurement_id` int NOT NULL COMMENT 'Related to catalogs prod (MEASUREMENT)',
  `quantity` decimal(10,2) NOT NULL,
  `unit_cost` decimal(15,5) NOT NULL,
  `currency_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL COMMENT 'Related to global currency',
  `total_price` decimal(15,5) 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;

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

--
-- Table structure for table `sivir_products_price`
--

CREATE TABLE `sivir_products_price` (
  `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 table',
  `product_id` varchar(50) NOT NULL COMMENT 'related to product table',
  `price` decimal(15,5) NOT NULL,
  `currency_id` varchar(50) 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=utf8mb3;

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

--
-- Table structure for table `sivir_products_price_history`
--

CREATE TABLE `sivir_products_price_history` (
  `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 table',
  `product_id` varchar(50) NOT NULL COMMENT 'related to product table',
  `price` decimal(15,5) NOT NULL,
  `currency_id` varchar(50) 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=utf8mb3;

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

--
-- Table structure for table `sivir_products_sell_price`
--

CREATE TABLE `sivir_products_sell_price` (
  `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 table',
  `product_id` varchar(50) NOT NULL COMMENT 'related to products table',
  `unit_cost` decimal(15,5) NOT NULL,
  `quantity` decimal(15,5) NOT NULL DEFAULT '0.00000',
  `fob` decimal(15,5) DEFAULT NULL,
  `costs` decimal(15,5) DEFAULT NULL,
  `profit` decimal(15,5) NOT NULL,
  `price` decimal(15,5) NOT NULL,
  `currency_id` varchar(50) 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=utf8mb3;

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

--
-- Table structure for table `sivir_products_stock`
--

CREATE TABLE `sivir_products_stock` (
  `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 global_branch_office',
  `product_id` varchar(50) NOT NULL COMMENT 'related to products table',
  `quantity` decimal(10,2) NOT NULL,
  `measurement_id` int NOT NULL COMMENT 'Related to catalogs prod (MEASUREMENT)',
  `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;

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

--
-- Table structure for table `sivir_products_stock_adjustment`
--

CREATE TABLE `sivir_products_stock_adjustment` (
  `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 global_branch_office',
  `product_id` varchar(50) NOT NULL COMMENT 'related to products table',
  `previous_quantity` decimal(10,2) NOT NULL,
  `quantity` decimal(10,2) NOT NULL,
  `measurement_id` int NOT NULL COMMENT 'Related to catalogs prod (MEASUREMENT)',
  `type` enum('I','E') NOT NULL DEFAULT 'I',
  `lot_id` varchar(50) NOT NULL COMMENT 'Related to lot table',
  `drops_id` int NOT NULL COMMENT 'Related to catalogs = ''DROPS''',
  `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;

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

--
-- Table structure for table `sivir_products_stock_history`
--

CREATE TABLE `sivir_products_stock_history` (
  `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 global_branch_office',
  `product_id` varchar(50) NOT NULL COMMENT 'related to products table',
  `quantity` decimal(10,2) NOT NULL,
  `measurement_id` int NOT NULL COMMENT 'Related to catalogs prod (MEASUREMENT)',
  `price` decimal(10,5) NOT NULL,
  `currency_id` varchar(50) NOT NULL COMMENT 'Related to global currency',
  `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;

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

--
-- Table structure for table `sivir_purchase`
--

CREATE TABLE `sivir_purchase` (
  `id` bigint 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 table',
  `relative` varchar(50) NOT NULL,
  `supplier_id` varchar(50) NOT NULL COMMENT 'related to supplier database and supplier vendor table',
  `type` int NOT NULL DEFAULT '1' COMMENT 'Invoice type',
  `kind` enum('FCV','FCVZF','DIM','DUI','OD') CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'FCV' COMMENT 'FCV=Factura local nacional, (FCVFZ) Factura compra venta en zona franca DIM, DUI, OD = Otro documento',
  `voucher` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Numero de comprobante',
  `invoice_nit` varchar(100) DEFAULT NULL,
  `autorization_number` varchar(100) DEFAULT NULL,
  `control_code` varchar(50) DEFAULT NULL,
  `total_items` int DEFAULT NULL,
  `packages` int DEFAULT NULL,
  `weight` decimal(10,4) DEFAULT NULL,
  `purchase_date` date NOT NULL,
  `comments` text,
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `sivir_purchase_costs`
--

CREATE TABLE `sivir_purchase_costs` (
  `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 table',
  `purchase_id` varchar(50) DEFAULT NULL COMMENT 'related to sivir purchase',
  `costs_id` int NOT NULL COMMENT 'related to catalogs items',
  `cost` decimal(15,5) NOT NULL,
  `currency_id` varchar(50) 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=utf8mb3;

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

--
-- Table structure for table `sivir_purchase_products`
--

CREATE TABLE `sivir_purchase_products` (
  `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 'elated to branch office table',
  `purchase_id` int DEFAULT NULL COMMENT 'related to sivir_purchase',
  `fob` decimal(10,5) DEFAULT NULL,
  `costs` decimal(10,5) DEFAULT NULL,
  `product_id` varchar(50) NOT NULL COMMENT 'related to products table',
  `quantity` decimal(10,5) NOT NULL,
  `measurement_id` int NOT NULL COMMENT 'related to catalogs table',
  `purchase_price` decimal(10,5) NOT NULL,
  `currency_id` int DEFAULT NULL COMMENT 'related to currency table',
  `cost_aditional` decimal(10,5) DEFAULT NULL,
  `warehouse_id` varchar(50) NOT NULL COMMENT 'Related to warehouse table',
  `physical_location` mediumtext,
  `lot` varchar(50) DEFAULT NULL,
  `expires` enum('Y','N') NOT NULL DEFAULT 'N',
  `expiration_date` date DEFAULT 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;

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

--
-- Table structure for table `sivir_sell`
--

CREATE TABLE `sivir_sell` (
  `relative` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `id` bigint NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to global_branch_office',
  `sellpoint_id` varchar(50) NOT NULL COMMENT 'related to sellpoint table',
  `payment_type` int NOT NULL DEFAULT '1' COMMENT 'Payment kind, intern control',
  `payment_detail` text COMMENT 'The payment detail',
  `customer_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL COMMENT 'Related to portfolio customers, this could be null for the special clients',
  `document_type` int NOT NULL,
  `customer_full_name` varchar(150) NOT NULL DEFAULT '''Sin nombre''',
  `customer_nit` varchar(50) NOT NULL DEFAULT '0',
  `customer_complemento` varchar(5) DEFAULT NULL COMMENT 'The CI complement',
  `customer_email` varchar(250) DEFAULT NULL COMMENT 'This is for send the invoice in xml format',
  `discount_all_products` decimal(15,5) NOT NULL DEFAULT '0.00000' COMMENT 'The sum for all products discount',
  `descuentoAdicional` decimal(15,5) NOT NULL DEFAULT '0.00000' COMMENT 'Additional discount, for the hole sell ',
  `discount_total` decimal(15,5) NOT NULL,
  `total` decimal(15,5) NOT NULL,
  `currency_id` int NOT NULL COMMENT 'related to currency table',
  `exchange_used` text NOT NULL COMMENT 'Must have all the exchange rate from currencies',
  `codigoExcepcion` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'En caso de que el NIT sea invalido o sea fuera de linea',
  `sended` enum('F','C','P') NOT NULL DEFAULT 'F' COMMENT 'Where to send:\r\nF = ended\r\nC = ready to finish\r\nP = proforma',
  `date_movement` date 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;

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

--
-- Table structure for table `sivir_sell_aditional_discount`
--

CREATE TABLE `sivir_sell_aditional_discount` (
  `id` int 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 table',
  `sell_id` int DEFAULT NULL COMMENT 'Related to sell table',
  `provisional` varchar(50) DEFAULT NULL COMMENT 'The provisional UUID for the new sell',
  `ammount` decimal(10,5) NOT NULL COMMENT 'This should be the 100% of the sell, in most cases',
  `currency_id` int NOT NULL COMMENT 'Related to currency table, could be null at the begining when the sell its only by provisional code	',
  `reason` varchar(200) DEFAULT NULL COMMENT 'The reason for the aditional disccount',
  `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 `sivir_sell_invoice`
--

CREATE TABLE `sivir_sell_invoice` (
  `relative` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `id` bigint NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to global_branch_office',
  `sell_id` bigint NOT NULL COMMENT 'Related to sivir sell table',
  `sellpoint_id` varchar(50) NOT NULL COMMENT 'related to sellpoint table',
  `payment_type` int NOT NULL DEFAULT '1' COMMENT 'Payment kind, intern control',
  `payment_detail` text COMMENT 'The payment detail',
  `cuis` tinytext NOT NULL COMMENT 'CUIS',
  `cufd` tinytext NOT NULL COMMENT 'CUFD per day',
  `cafc` varchar(50) DEFAULT NULL COMMENT 'Codigo CAFC para facturas en contingencia',
  `codigo_control` varchar(50) DEFAULT NULL,
  `cuf` tinytext CHARACTER SET latin1 COLLATE latin1_swedish_ci,
  `legend` mediumtext NOT NULL,
  `law` mediumtext NOT NULL,
  `zofra` enum('Y','N') NOT NULL DEFAULT 'N',
  `numeroParteRecepcion` mediumtext COMMENT 'numeroParteRecepcion en caso de ZOFRA',
  `tipo_factura_id` int NOT NULL DEFAULT '1' COMMENT 'Related to catalogs items = "TIPOFACTURA"	',
  `tipo_emision` int NOT NULL DEFAULT '1' COMMENT '1 = Online 2 = Offline 3 = Masiva',
  `codigo_sucursal` tinyint NOT NULL DEFAULT '0' COMMENT 'Codigo de la sucursal',
  `estado` enum('A','C','V') CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'V' COMMENT 'A=Anulado, V=Valido, C=Caja',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `milliseconds` smallint DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `sivir_sell_invoice_cancel`
--

CREATE TABLE `sivir_sell_invoice_cancel` (
  `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',
  `sell_invoice_id` int NOT NULL COMMENT 'Related to sivir sell invoice table',
  `codigo_motivo_id` int NOT NULL COMMENT 'Related to catalogs items = "REASONOFCANCELLATION"',
  `tipo_factura_id` int NOT NULL COMMENT 'Related to catalogs items = "TIPOFACTURA"',
  `codigoDescripcion` varchar(200) NOT NULL COMMENT 'Codigo de descripcion',
  `codigoEstado` int NOT NULL DEFAULT '0' COMMENT 'el codigo del estado',
  `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 `sivir_sell_invoice_status`
--

CREATE TABLE `sivir_sell_invoice_status` (
  `relative` varchar(50) NOT NULL COMMENT 'UUID data',
  `users_sid` varchar(50) NOT NULL COMMENT 'Related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'Related to branch table',
  `invoice_id` int NOT NULL COMMENT 'Related to invoice table',
  `codigoDescripcion` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'Descripcion del codigo',
  `codigoEstado` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'Codigo del estado',
  `codigoRecepcion` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'Codigo de recepcion',
  `codigo` varchar(10) DEFAULT NULL COMMENT 'Codigo del error',
  `descripcion` mediumtext COMMENT 'Descripcion del error',
  `attempts` int DEFAULT '0' COMMENT 'Numero de intentos',
  `timeout` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Fuera de plazo',
  `sended` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Sended or not boolean',
  `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 `sivir_sell_note`
--

CREATE TABLE `sivir_sell_note` (
  `relative` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `id` bigint NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to global_branch_office',
  `sell_id` bigint NOT NULL COMMENT 'Related to sivir sell table',
  `sellpoint_id` varchar(50) NOT NULL COMMENT 'related to sellpoint table',
  `payment_type` int NOT NULL DEFAULT '1' COMMENT 'Payment kind, intern control',
  `zofra` enum('Y','N') NOT NULL DEFAULT 'N',
  `codigo_sucursal` tinyint NOT NULL DEFAULT '0' COMMENT 'Codigo de la sucursal',
  `estado` enum('A','C','V') CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'V' COMMENT 'A=Anulado, V=Valido, C=Caja',
  `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;

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

--
-- Table structure for table `sivir_sell_payment_way`
--

CREATE TABLE `sivir_sell_payment_way` (
  `id` int 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 table',
  `sell_id` int DEFAULT NULL COMMENT 'Related to sell table',
  `provisional` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'The provisional UUID for the new sell',
  `payment_id` int NOT NULL DEFAULT '1' COMMENT 'Related to catalogs items (PAYMENT), the most common its the (1)',
  `payment_data` varchar(250) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'The payment way data, for example the VISA number',
  `payment_date` date DEFAULT NULL,
  `ammount` decimal(15,5) NOT NULL DEFAULT '0.00000' COMMENT 'This should be the 100% of the sell, in most cases',
  `currency_id` int DEFAULT NULL COMMENT 'Related to currency table, could be null at the begining when the sell its only by provisional code',
  `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 `sivir_sell_point`
--

CREATE TABLE `sivir_sell_point` (
  `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 global_branch_office',
  `descripcion` varchar(50) NOT NULL,
  `nombre_punto_venta` varchar(250) NOT NULL,
  `sellpoint_kind_id` int NOT NULL DEFAULT '2' COMMENT 'Related to catalogs items TIPOPUNTOVENTA',
  `could_close` enum('Y','N') CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'Y' COMMENT 'Could finish the sell?',
  `allow_credits` enum('Y','N') CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'N' COMMENT 'Allow to create credits on this sell point...?',
  `allow_expenses` enum('Y','N') CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'N' COMMENT 'Allow expenses on this sell point?',
  `could_register_other_incomes` enum('Y','N') NOT NULL DEFAULT 'Y' COMMENT 'Could register other incommes?',
  `could_homologate_product_on_sell` enum('Y','N') CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'N' COMMENT 'Could homologate a new product on the sell?',
  `could_sell_empty_inventory` enum('Y','N') NOT NULL DEFAULT 'N' COMMENT 'Could sell products without inventory?',
  `could_make_proforma` enum('Y','N') NOT NULL DEFAULT 'N' COMMENT 'Could make proforma?',
  `users_allowed` longtext NOT NULL,
  `codigo_punto_venta` varchar(25) CHARACTER SET latin1 COLLATE latin1_swedish_ci 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;

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

--
-- Table structure for table `sivir_sell_point_closed`
--

CREATE TABLE `sivir_sell_point_closed` (
  `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 global_branch_office',
  `sell_point_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL COMMENT 'related to sellpoint table',
  `date_closed` date NOT NULL COMMENT 'The day that was opened',
  `exchange_open` text NOT NULL COMMENT 'JSON stringlify',
  `incomes_on_sellpoint` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL COMMENT 'JSON stringlify',
  `expenses_on_sellpoint` text NOT NULL COMMENT 'JSON stringlify',
  `payment_pending_on_sellpoint` text NOT NULL COMMENT 'JSON stringlify',
  `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;

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

--
-- Table structure for table `sivir_sell_point_cufd`
--

CREATE TABLE `sivir_sell_point_cufd` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to global_branch_office',
  `sellpoint_id` varchar(50) NOT NULL COMMENT 'related to sellpoint table',
  `codigo_cufd` mediumtext NOT NULL,
  `codigo_control` varchar(200) NOT NULL,
  `direccion` text NOT NULL,
  `fecha_vigencia` datetime NOT NULL,
  `has_been_increased` enum('Y','N') CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT 'N' COMMENT 'If the cufd has been increased',
  `reason_for_increase` varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL COMMENT 'The reason',
  `days_increased` smallint DEFAULT NULL COMMENT 'how long',
  `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;

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

--
-- Table structure for table `sivir_sell_point_expenses`
--

CREATE TABLE `sivir_sell_point_expenses` (
  `id` int NOT NULL COMMENT 'Autoincrement',
  `users_sid` varchar(50) NOT NULL COMMENT 'Related to users sid',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'Related to branch table',
  `sell_point_id` varchar(50) NOT NULL COMMENT 'Related to sellpoint table',
  `expense_date` date NOT NULL COMMENT 'The date of the expense',
  `amount` decimal(10,5) NOT NULL COMMENT 'The expense amount',
  `currency_id` int NOT NULL COMMENT 'Related to currency table',
  `expenses_id` int NOT NULL COMMENT 'Related to catalogs = EXPENSES',
  `comments` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'The reason of the expense',
  `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 `sivir_sell_point_external_income`
--

CREATE TABLE `sivir_sell_point_external_income` (
  `relative` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'UUID',
  `users_sid` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Related to users table',
  `global_branch_office_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'related to global_branch_office',
  `sell_point_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'related to sellpoint table',
  `date_movement` date NOT NULL COMMENT 'Date of the movement',
  `income_reason` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'The external income reason detailed',
  `payment_type` int NOT NULL DEFAULT '1' COMMENT 'Payment kind, intern control',
  `amount` decimal(15,5) NOT NULL COMMENT 'The income amount',
  `currency_id` int NOT NULL COMMENT '	Related to currency table',
  `attachments` text CHARACTER SET latin1 COLLATE latin1_general_ci,
  `status` enum('A','X') CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

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

--
-- Table structure for table `sivir_sell_point_movement`
--

CREATE TABLE `sivir_sell_point_movement` (
  `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 global_branch_office',
  `sellpoint_id` varchar(50) NOT NULL COMMENT 'related to sellpoint table',
  `date_movement` date NOT NULL COMMENT 'Current date',
  `type` enum('I','E','P') NOT NULL DEFAULT 'I' COMMENT 'I=Ingreso E=Egreso P=Pendiente de pago',
  `amount` decimal(15,5) NOT NULL,
  `currency_id` int NOT NULL COMMENT 'Related to currency table',
  `reason` mediumtext,
  `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;

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

--
-- Table structure for table `sivir_sell_point_open`
--

CREATE TABLE `sivir_sell_point_open` (
  `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 global_branch_office',
  `sellpoint_id` varchar(50) NOT NULL COMMENT 'related to sellpoint table',
  `date_open` date NOT NULL COMMENT 'The day that was opened',
  `exchange_open` text NOT NULL COMMENT 'JSON stringlify',
  `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;

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

--
-- Table structure for table `sivir_sell_sold`
--

CREATE TABLE `sivir_sell_sold` (
  `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 table',
  `provisional` varchar(50) DEFAULT NULL COMMENT ' The provisional uuid for the sale ',
  `sell_id` bigint DEFAULT NULL COMMENT 'related to sivir_sell table',
  `product_id` varchar(50) NOT NULL COMMENT 'related to product table',
  `product_code` varchar(50) DEFAULT NULL,
  `product_fullname` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `price` decimal(15,5) NOT NULL,
  `quantity` decimal(15,5) NOT NULL,
  `total_price` decimal(15,5) NOT NULL,
  `discount` decimal(15,5) DEFAULT '0.00000',
  `numeroSerie` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci COMMENT 'Serial number',
  `numeroImei` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci COMMENT 'Imei number',
  `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 `sivir_sell_sold_lot_used`
--

CREATE TABLE `sivir_sell_sold_lot_used` (
  `relative` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'The UUID',
  `users_sid` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Related to users table',
  `global_branch_office_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Related to branch office table',
  `sell_id` bigint NOT NULL COMMENT 'related to sivir_sell table	',
  `product_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'related to product table',
  `product_lot_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Related to sivir_products_lot table',
  `lot` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL COMMENT 'The lot number or data',
  `quantity` decimal(15,5) NOT NULL COMMENT 'The lot quantity used',
  `status` enum('A','X') CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

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

--
-- Table structure for table `sivir_significant_event`
--

CREATE TABLE `sivir_significant_event` (
  `id` int 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 table',
  `cufd` varchar(200) NOT NULL,
  `cufdEvento` varchar(200) NOT NULL,
  `codigoMotivoEvento` varchar(200) DEFAULT NULL COMMENT 'Codigo motivo del evento',
  `descripcion` varchar(200) DEFAULT NULL COMMENT 'Descripcion del evento',
  `fechaHoraInicioEvento` timestamp NOT NULL,
  `fechaHoraFinEvento` timestamp NOT NULL,
  `codigoRecepcionEventoSignificativo` varchar(25) 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=utf8mb3;

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

--
-- Table structure for table `sivir_store_credit`
--

CREATE TABLE `sivir_store_credit` (
  `relative` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Uuid data',
  `users_sid` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Related to users table',
  `global_branch_office_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Related to branch table',
  `customer_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Related to portfolio customers, this could be null for the special clients	',
  `credit_reason` varchar(150) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'The credit reason, sell number in some cases',
  `sell_id` bigint DEFAULT NULL COMMENT 'Related to sell id, not mandatory',
  `sellpoint_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL COMMENT 'Related to the sellpoint',
  `ammount` decimal(15,5) NOT NULL COMMENT 'The credit total ammount',
  `currency_id` int NOT NULL COMMENT 'Related to currency table',
  `how_many_payments` int NOT NULL COMMENT 'The quantity number',
  `payment_intervals` int NOT NULL COMMENT 'Interval payment days',
  `first_payment_date` date NOT NULL COMMENT 'The first payment date',
  `paid_complete` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Is the complete credit paid?',
  `status` enum('A','X') CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

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

--
-- Table structure for table `sivir_store_credit_payments_made`
--

CREATE TABLE `sivir_store_credit_payments_made` (
  `relative` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'UUID',
  `users_sid` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Related to users table',
  `global_branch_office_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Related to branch table',
  `store_credit_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Related to store credit table',
  `store_credit_payments_todo_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Related to store credit payments todo table',
  `sellpoint_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'related to sellpoint table',
  `payment_type` int NOT NULL DEFAULT '1' COMMENT 'Payment kind, intern control',
  `payment_ammount` decimal(15,5) NOT NULL COMMENT 'The payment made ammount',
  `currency_id` int NOT NULL COMMENT 'Related to currency table',
  `payment_made_date` date NOT NULL COMMENT 'The real date, no the register date',
  `status` enum('A','X') CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

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

--
-- Table structure for table `sivir_store_credit_payments_todo`
--

CREATE TABLE `sivir_store_credit_payments_todo` (
  `relative` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'UUID',
  `users_sid` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Related to users table',
  `global_branch_office_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Related to branch table',
  `store_credit_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Related to store credit',
  `total_ammount` decimal(15,5) NOT NULL COMMENT 'The payment total ammount',
  `currency_id` int NOT NULL COMMENT 'Related to currency table',
  `payment_duedate` date NOT NULL COMMENT 'The due date for the payment',
  `paid` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Its paid completed?',
  `status` enum('A','X') CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

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

--
-- Table structure for table `sivir_sync_by_day`
--

CREATE TABLE `sivir_sync_by_day` (
  `id` int NOT NULL,
  `users_sid` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Related to users table',
  `global_branch_office_id` varchar(50) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Related to branch table',
  `day` date NOT NULL COMMENT 'The date for sync',
  `status` enum('A','X') CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

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

--
-- Table structure for table `sivir_system_behavior`
--

CREATE TABLE `sivir_system_behavior` (
  `relative` varchar(50) NOT NULL COMMENT 'UUID data',
  `users_sid` varchar(50) NOT NULL COMMENT 'Related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'Related to branch table',
  `token` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'System token',
  `codigo_sistema` tinytext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'system code',
  `qr_url` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Url para el QR de la factura',
  `codigo_ambiente` tinyint NOT NULL COMMENT 'Codigo ambiebte del sistema',
  `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 `warehouse`
--

CREATE TABLE `warehouse` (
  `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 global_branch_office	',
  `warehouse` varchar(200) NOT NULL,
  `location` text NOT NULL,
  `type_id` int NOT NULL COMMENT 'Related to catalogs',
  `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;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);

--
-- Indexes for table `jobs`
--
ALTER TABLE `jobs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `jobs_queue_index` (`queue`);

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

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

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

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

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

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

--
-- Indexes for table `sivir_deliver_input`
--
ALTER TABLE `sivir_deliver_input`
  ADD PRIMARY KEY (`relative`);

--
-- Indexes for table `sivir_deliver_items`
--
ALTER TABLE `sivir_deliver_items`
  ADD PRIMARY KEY (`relative`);

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

--
-- Indexes for table `sivir_gift_card`
--
ALTER TABLE `sivir_gift_card`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `sivir_gift_card.gc_serial` (`gc_serial`);

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

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

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

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

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

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

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

--
-- Indexes for table `sivir_products_kardex`
--
ALTER TABLE `sivir_products_kardex`
  ADD PRIMARY KEY (`relative`),
  ADD UNIQUE KEY `global_kardex.relative` (`relative`) USING BTREE;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- Indexes for table `sivir_sell_point_closed`
--
ALTER TABLE `sivir_sell_point_closed`
  ADD PRIMARY KEY (`relative`);

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

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

--
-- Indexes for table `sivir_sell_point_external_income`
--
ALTER TABLE `sivir_sell_point_external_income`
  ADD PRIMARY KEY (`relative`);

--
-- Indexes for table `sivir_sell_point_movement`
--
ALTER TABLE `sivir_sell_point_movement`
  ADD PRIMARY KEY (`relative`),
  ADD UNIQUE KEY `sell_point_movement.relative` (`relative`) USING BTREE;

--
-- Indexes for table `sivir_sell_point_open`
--
ALTER TABLE `sivir_sell_point_open`
  ADD PRIMARY KEY (`relative`),
  ADD UNIQUE KEY `sell_point_movement.relative` (`relative`) USING BTREE;

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

--
-- Indexes for table `sivir_sell_sold_lot_used`
--
ALTER TABLE `sivir_sell_sold_lot_used`
  ADD PRIMARY KEY (`relative`);

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

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

--
-- Indexes for table `sivir_store_credit_payments_made`
--
ALTER TABLE `sivir_store_credit_payments_made`
  ADD PRIMARY KEY (`relative`);

--
-- Indexes for table `sivir_store_credit_payments_todo`
--
ALTER TABLE `sivir_store_credit_payments_todo`
  ADD PRIMARY KEY (`relative`);

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

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

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `jobs`
--
ALTER TABLE `jobs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

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

--
-- AUTO_INCREMENT for table `sivir_coupons`
--
ALTER TABLE `sivir_coupons`
  MODIFY `id` int NOT NULL AUTO_INCREMENT COMMENT 'Autoincrement';

--
-- AUTO_INCREMENT for table `sivir_gift_card`
--
ALTER TABLE `sivir_gift_card`
  MODIFY `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID Autoincrement';

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

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

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

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

--
-- AUTO_INCREMENT for table `sivir_purchase`
--
ALTER TABLE `sivir_purchase`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

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

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

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

--
-- AUTO_INCREMENT for table `sivir_sell_point_expenses`
--
ALTER TABLE `sivir_sell_point_expenses`
  MODIFY `id` int NOT NULL AUTO_INCREMENT COMMENT 'Autoincrement';

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

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