-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Apr 02, 2026 at 04:35 PM
-- Server version: 10.3.39-MariaDB
-- PHP Version: 8.1.34

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 */;

--
-- Database: `latincon_dms`
--

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

--
-- Table structure for table `agepolicies`
--

CREATE TABLE `agepolicies` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `age_id` char(2) NOT NULL,
  `start` smallint(2) UNSIGNED NOT NULL,
  `end` smallint(2) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ages`
--

CREATE TABLE `ages` (
  `id` char(2) NOT NULL,
  `label_name` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `airportguides`
--

CREATE TABLE `airportguides` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `contact_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `alldates`
--

CREATE TABLE `alldates` (
  `date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `all__allotmentdetails`
--

CREATE TABLE `all__allotmentdetails` (
  `id` int(10) UNSIGNED NOT NULL,
  `allotment_id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `all__allotmentdocuments`
--

CREATE TABLE `all__allotmentdocuments` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(50) NOT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp(),
  `uuid` char(36) NOT NULL,
  `extension` varchar(6) NOT NULL,
  `allotment_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `all__allotmentmails`
--

CREATE TABLE `all__allotmentmails` (
  `allotment_id` int(10) UNSIGNED NOT NULL,
  `mailerqueue_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `all__allotments`
--

CREATE TABLE `all__allotments` (
  `id` int(10) UNSIGNED NOT NULL,
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `datefrom` date DEFAULT NULL,
  `dateto` date DEFAULT NULL,
  `releasedays` smallint(5) UNSIGNED NOT NULL,
  `autorelease` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `note` varchar(90) DEFAULT NULL,
  `guidestatus` tinyint(3) DEFAULT NULL,
  `driverstatus` tinyint(3) DEFAULT NULL,
  `escortstatus` tinyint(3) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `all__allotmentstatuses`
--

CREATE TABLE `all__allotmentstatuses` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL,
  `short` char(2) NOT NULL DEFAULT '',
  `color` varchar(6) NOT NULL DEFAULT 'ffffff',
  `requested` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `unrequested` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `unlinked` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `canceled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `priority` tinyint(2) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `all__allotmentstatusoptions`
--

CREATE TABLE `all__allotmentstatusoptions` (
  `id` int(10) UNSIGNED NOT NULL,
  `short` varchar(45) NOT NULL,
  `description` varchar(100) DEFAULT NULL,
  `defaultcheck` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `all__allotmentstatus_options`
--

CREATE TABLE `all__allotmentstatus_options` (
  `allotmentstatus_id` tinyint(3) UNSIGNED NOT NULL,
  `allotmentstatusoption_id` int(10) UNSIGNED NOT NULL,
  `active` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `all__allotmentupdates`
--

CREATE TABLE `all__allotmentupdates` (
  `allotmentdetail_id` int(10) UNSIGNED NOT NULL,
  `quantity` smallint(5) UNSIGNED NOT NULL,
  `updatetime` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `confirmation` varchar(45) NOT NULL,
  `status` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `all__mailtemplates`
--

CREATE TABLE `all__mailtemplates` (
  `mailertemplate_id` smallint(5) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `isrelease` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `isrequest` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `isupdate` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `amenities`
--

CREATE TABLE `amenities` (
  `id` smallint(4) UNSIGNED NOT NULL,
  `amenitycategory_id` char(3) NOT NULL,
  `code` char(6) NOT NULL,
  `icon` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `amenitycategories`
--

CREATE TABLE `amenitycategories` (
  `id` char(3) NOT NULL,
  `name` varchar(45) DEFAULT NULL,
  `supplier` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `amenitycategorydetails`
--

CREATE TABLE `amenitycategorydetails` (
  `amenitycategory_id` char(3) NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `name` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `amenitydetails`
--

CREATE TABLE `amenitydetails` (
  `amenity_id` smallint(4) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(45) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `appcategories`
--

CREATE TABLE `appcategories` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL,
  `maxsize` int(10) UNSIGNED NOT NULL,
  `unique` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `mandatory` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `position` smallint(4) UNSIGNED NOT NULL DEFAULT 0,
  `format` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `isratecondition` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `id_inapp` int(10) UNSIGNED DEFAULT NULL,
  `appcategorytype_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `appcategorysection_id` tinyint(3) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `appcategories_tpnotecategories`
--

CREATE TABLE `appcategories_tpnotecategories` (
  `appcategory_id` smallint(5) UNSIGNED NOT NULL,
  `tpnotecategory_id` smallint(5) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='for text sync from DMS to TP';

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

--
-- Table structure for table `appcategorydetails`
--

CREATE TABLE `appcategorydetails` (
  `appcat_id` smallint(5) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `name` varchar(250) DEFAULT NULL,
  `description` longtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `appcategoryframeworks`
--

CREATE TABLE `appcategoryframeworks` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL,
  `appcategorytype_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(100) NOT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `appcategoryframework_appcategories`
--

CREATE TABLE `appcategoryframework_appcategories` (
  `appcategoryframework_id` smallint(5) UNSIGNED NOT NULL,
  `appcategory_id` smallint(5) UNSIGNED NOT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `appcategorysections`
--

CREATE TABLE `appcategorysections` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `appcategorytypedetails`
--

CREATE TABLE `appcategorytypedetails` (
  `appcategorytype_id` tinyint(3) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(150) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `appcategorytypes`
--

CREATE TABLE `appcategorytypes` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `comment` varchar(150) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `appcategory_content`
--

CREATE TABLE `appcategory_content` (
  `id` int(10) UNSIGNED NOT NULL,
  `appcategory_id` smallint(5) UNSIGNED NOT NULL,
  `content_id` int(10) UNSIGNED NOT NULL,
  `default` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `appcategory_services`
--

CREATE TABLE `appcategory_services` (
  `appcategory_id` smallint(5) UNSIGNED NOT NULL,
  `service_id` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `apps`
--

CREATE TABLE `apps` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `name` varchar(150) DEFAULT NULL,
  `description` varchar(300) DEFAULT NULL,
  `enabled` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `app_media`
--

CREATE TABLE `app_media` (
  `app_id` smallint(5) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `published` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `app_mediatemplates`
--

CREATE TABLE `app_mediatemplates` (
  `id` int(10) UNSIGNED NOT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL,
  `mediatemplate_id` int(10) UNSIGNED NOT NULL,
  `isthumb` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `isslide` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakuarticlecollectiondetails`
--

CREATE TABLE `bakuarticlecollectiondetails` (
  `id` int(10) NOT NULL,
  `bakuarticlecollection_id` int(10) UNSIGNED DEFAULT NULL,
  `bakusection_id` smallint(5) UNSIGNED DEFAULT NULL,
  `content_id` int(10) UNSIGNED DEFAULT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakuarticlecollections`
--

CREATE TABLE `bakuarticlecollections` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(200) DEFAULT NULL,
  `default` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakucontentdetails`
--

CREATE TABLE `bakucontentdetails` (
  `bakucontent_id` int(10) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `description` longtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakucontents`
--

CREATE TABLE `bakucontents` (
  `id` int(11) UNSIGNED NOT NULL,
  `bakuversion_id` int(11) UNSIGNED NOT NULL,
  `bakudate_id` int(11) UNSIGNED DEFAULT NULL,
  `supplier_id` int(11) UNSIGNED DEFAULT NULL,
  `product_id` int(11) UNSIGNED DEFAULT NULL,
  `location_id` int(11) UNSIGNED DEFAULT NULL,
  `content_id` int(11) UNSIGNED DEFAULT NULL,
  `position` tinyint(3) UNSIGNED DEFAULT NULL,
  `istext` tinyint(1) UNSIGNED DEFAULT NULL,
  `ismedia` tinyint(1) UNSIGNED DEFAULT NULL,
  `appcategory_id` smallint(5) UNSIGNED DEFAULT NULL,
  `tempprevcontent_id` int(11) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakucontent_media`
--

CREATE TABLE `bakucontent_media` (
  `bakucontent_id` int(10) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL DEFAULT 255,
  `template_id` int(10) UNSIGNED NOT NULL DEFAULT 39,
  `appmediatemplate_id` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakudategps`
--

CREATE TABLE `bakudategps` (
  `id` int(10) UNSIGNED NOT NULL,
  `bakudate_id` int(10) UNSIGNED NOT NULL,
  `gps_id` int(10) UNSIGNED DEFAULT NULL,
  `latitude` decimal(18,15) NOT NULL,
  `longitude` decimal(18,14) NOT NULL,
  `position` tinyint(4) DEFAULT NULL,
  `icon` varchar(255) DEFAULT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `waypoint` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `isoptional` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakudategpsdetails`
--

CREATE TABLE `bakudategpsdetails` (
  `bakudategps_id` int(10) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakudates`
--

CREATE TABLE `bakudates` (
  `id` int(10) UNSIGNED NOT NULL,
  `bakuversion_id` int(10) UNSIGNED NOT NULL,
  `date` date NOT NULL,
  `verified` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakudetails`
--

CREATE TABLE `bakudetails` (
  `id` int(11) UNSIGNED NOT NULL,
  `bakuversion_id` int(10) UNSIGNED NOT NULL,
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `location_id` smallint(5) UNSIGNED DEFAULT NULL,
  `bsl_id` int(11) UNSIGNED DEFAULT NULL,
  `bookingdetail_id` int(11) UNSIGNED DEFAULT NULL,
  `fromdate` date NOT NULL,
  `todate` date NOT NULL,
  `verified` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `pcmdetail_id` int(11) UNSIGNED DEFAULT NULL,
  `psl_id` int(11) UNSIGNED DEFAULT NULL,
  `seq` smallint(6) UNSIGNED NOT NULL DEFAULT 0,
  `sl_status` char(2) DEFAULT NULL,
  `pkg_source` char(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakupcmconfiguration`
--

CREATE TABLE `bakupcmconfiguration` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `showheader` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `showservices` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakus`
--

CREATE TABLE `bakus` (
  `id` int(10) UNSIGNED NOT NULL,
  `uuid` char(36) DEFAULT NULL,
  `name` varchar(250) NOT NULL,
  `endcustomername` varchar(250) DEFAULT NULL,
  `customer_id` smallint(5) UNSIGNED DEFAULT NULL,
  `endcustomer_id` int(10) UNSIGNED DEFAULT NULL,
  `language_id` tinyint(4) NOT NULL,
  `bakustatus_id` tinyint(3) UNSIGNED NOT NULL DEFAULT 1,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `pkgServices` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `pkgHeader` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `iuser_id` smallint(5) UNSIGNED DEFAULT NULL,
  `protected` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Triggers `bakus`
--
DELIMITER $$
CREATE TRIGGER `before_insert_bakus` BEFORE INSERT ON `bakus` FOR EACH ROW BEGIN
  IF new.uuid IS NULL THEN
    SET new.uuid = uuid();
  END IF;
END
$$
DELIMITER ;

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

--
-- Table structure for table `bakusectioncategories`
--

CREATE TABLE `bakusectioncategories` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `name` varchar(25) DEFAULT NULL,
  `icon` varchar(50) DEFAULT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `iscategory` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakusectioncategorydetails`
--

CREATE TABLE `bakusectioncategorydetails` (
  `bakusectioncategory_id` smallint(5) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(25) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakusectiondetails`
--

CREATE TABLE `bakusectiondetails` (
  `bakusection_id` smallint(5) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakusections`
--

CREATE TABLE `bakusections` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `name` varchar(20) NOT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `detailinmap` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `detailpage` varchar(100) DEFAULT NULL,
  `publicpage` varchar(100) DEFAULT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL,
  `icon` varchar(50) DEFAULT NULL,
  `withContent` tinyint(1) UNSIGNED DEFAULT NULL,
  `forSupplier` tinyint(1) UNSIGNED DEFAULT NULL,
  `forProduct` tinyint(1) UNSIGNED DEFAULT NULL,
  `forLocation` tinyint(1) UNSIGNED DEFAULT NULL,
  `sectioncategory_id` smallint(5) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakusection_appcategories`
--

CREATE TABLE `bakusection_appcategories` (
  `bakusection_id` smallint(5) UNSIGNED NOT NULL,
  `appcategory_id` smallint(5) UNSIGNED NOT NULL,
  `categorytitle` tinyint(1) UNSIGNED DEFAULT 0,
  `position` tinyint(2) UNSIGNED DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakusection_services`
--

CREATE TABLE `bakusection_services` (
  `bakusection_id` smallint(5) UNSIGNED NOT NULL,
  `service_id` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakusection_statuses`
--

CREATE TABLE `bakusection_statuses` (
  `bakusection_id` smallint(5) UNSIGNED NOT NULL,
  `bakustatus_id` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakustatusdetails`
--

CREATE TABLE `bakustatusdetails` (
  `bakustatus_id` tinyint(3) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(25) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakustatuses`
--

CREATE TABLE `bakustatuses` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(20) NOT NULL,
  `color` varchar(6) NOT NULL DEFAULT 'ffffff',
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `bakusection_id` smallint(5) UNSIGNED NOT NULL COMMENT 'Baku Startpage'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakuversionmediaquotedetails`
--

CREATE TABLE `bakuversionmediaquotedetails` (
  `bakuversionmediaquote_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `description` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakuversions`
--

CREATE TABLE `bakuversions` (
  `id` int(10) UNSIGNED NOT NULL,
  `baku_id` int(10) UNSIGNED NOT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `isactive` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `ispublished` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `media_id` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakuversions_media`
--

CREATE TABLE `bakuversions_media` (
  `id` int(10) UNSIGNED NOT NULL,
  `bakuversion_id` int(10) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakuversions_mediaquotes`
--

CREATE TABLE `bakuversions_mediaquotes` (
  `id` int(10) UNSIGNED NOT NULL,
  `bakuversions_media_id` int(10) UNSIGNED NOT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `content_id` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakuversion_bookings`
--

CREATE TABLE `bakuversion_bookings` (
  `bakuversion_id` int(10) UNSIGNED NOT NULL,
  `booking_id` int(11) UNSIGNED DEFAULT NULL,
  `pcm_id` int(11) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bakuversion_sections`
--

CREATE TABLE `bakuversion_sections` (
  `bakuversion_id` int(10) UNSIGNED NOT NULL,
  `bakusection_id` smallint(5) UNSIGNED NOT NULL,
  `optional` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `lastupdate` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `baku_articles`
--

CREATE TABLE `baku_articles` (
  `baku_id` int(10) UNSIGNED NOT NULL,
  `bakusection_id` smallint(5) UNSIGNED NOT NULL,
  `content_id` int(10) UNSIGNED DEFAULT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bankaccounts`
--

CREATE TABLE `bankaccounts` (
  `id` int(10) UNSIGNED NOT NULL,
  `legalname` varchar(255) DEFAULT NULL,
  `bankaccountcol` varchar(45) DEFAULT NULL,
  `tributename` varchar(45) DEFAULT NULL,
  `creditperiot` varchar(45) DEFAULT NULL,
  `clientaccount` varchar(45) DEFAULT NULL,
  `bankaccountname` varchar(45) DEFAULT NULL,
  `identificationnumber` varchar(45) DEFAULT NULL,
  `bank_id` tinyint(4) UNSIGNED NOT NULL,
  `paymenttype_id` tinyint(4) UNSIGNED NOT NULL,
  `identificationtype_id` tinyint(4) UNSIGNED NOT NULL,
  `currency_id` char(3) NOT NULL,
  `defaultAccount` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `modified` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `banks`
--

CREATE TABLE `banks` (
  `id` tinyint(4) UNSIGNED NOT NULL,
  `name` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `be__booking`
--

CREATE TABLE `be__booking` (
  `id` int(10) UNSIGNED NOT NULL,
  `booking_id` int(11) UNSIGNED DEFAULT NULL,
  `full_reference` char(15) NOT NULL,
  `name` varchar(100) DEFAULT NULL,
  `traveldate` date DEFAULT NULL,
  `status` char(2) DEFAULT NULL,
  `customer_id` smallint(5) UNSIGNED DEFAULT NULL,
  `updatedby` smallint(5) UNSIGNED DEFAULT NULL,
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(),
  `createdby` smallint(5) UNSIGNED DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `be__bookingdetails`
--

CREATE TABLE `be__bookingdetails` (
  `id` int(10) UNSIGNED NOT NULL,
  `booking_id` int(10) UNSIGNED NOT NULL,
  `bookingdetail_id` int(11) UNSIGNED DEFAULT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `day` smallint(6) DEFAULT NULL,
  `seq` smallint(6) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `enddate` date DEFAULT NULL,
  `status` char(2) DEFAULT NULL COMMENT 'status id from TP',
  `statusid` tinyint(3) UNSIGNED DEFAULT NULL COMMENT 'status id from DMS',
  `optional` tinyint(1) DEFAULT 0,
  `cost` decimal(12,4) NOT NULL DEFAULT 0.0000,
  `tpcanceled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `updatedby` smallint(5) UNSIGNED DEFAULT NULL,
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(),
  `createdby` smallint(5) UNSIGNED DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `be__externalreservation`
--

CREATE TABLE `be__externalreservation` (
  `id` int(10) UNSIGNED NOT NULL,
  `bookingdetail_id` int(11) UNSIGNED NOT NULL,
  `channel_id` int(10) UNSIGNED NOT NULL,
  `bsl_id` int(11) UNSIGNED DEFAULT NULL COMMENT 'Tourplan service line id, in case the reservation was sent to tourplan',
  `roomconfiguration_id` int(11) UNSIGNED DEFAULT NULL,
  `reservationid` int(11) UNSIGNED DEFAULT NULL,
  `reservationcode` text DEFAULT NULL,
  `cost` decimal(12,4) UNSIGNED DEFAULT NULL,
  `statusid` tinyint(3) UNSIGNED DEFAULT NULL,
  `canceled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `canceledby` varchar(45) DEFAULT NULL,
  `canceledtime` timestamp NULL DEFAULT NULL,
  `createdby` smallint(5) UNSIGNED DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp(),
  `responsereference` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bookingdetailsconfig`
--

CREATE TABLE `bookingdetailsconfig` (
  `bsl_id` int(11) UNSIGNED NOT NULL,
  `cost` decimal(12,4) DEFAULT NULL,
  `sell` decimal(12,4) DEFAULT NULL,
  `agent` decimal(12,4) DEFAULT NULL,
  `retail` decimal(12,4) DEFAULT NULL,
  `adult` smallint(5) UNSIGNED DEFAULT 0 COMMENT 'or pax',
  `child` smallint(5) UNSIGNED DEFAULT 0 COMMENT 'child',
  `childshare` smallint(5) UNSIGNED DEFAULT 0 COMMENT 'child share',
  `infant` smallint(5) UNSIGNED DEFAULT 0 COMMENT 'infant',
  `teamleader` smallint(5) UNSIGNED DEFAULT 0 COMMENT 'team leader',
  `driver` smallint(5) UNSIGNED DEFAULT 0 COMMENT 'driver',
  `guide` smallint(5) UNSIGNED DEFAULT 0,
  `single` smallint(5) UNSIGNED DEFAULT 0,
  `double` smallint(5) UNSIGNED DEFAULT 0,
  `twin` smallint(5) UNSIGNED DEFAULT 0,
  `triple` smallint(5) UNSIGNED DEFAULT 0,
  `quadruple` smallint(5) UNSIGNED DEFAULT 0,
  `other` smallint(5) UNSIGNED DEFAULT 0,
  `scuqty` smallint(5) UNSIGNED DEFAULT 0,
  `scufoc` smallint(5) UNSIGNED DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bookingdetailstatuses`
--

CREATE TABLE `bookingdetailstatuses` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL,
  `color` varchar(6) NOT NULL DEFAULT 'ffffff'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bookingdetailstatusoptions`
--

CREATE TABLE `bookingdetailstatusoptions` (
  `id` int(10) UNSIGNED NOT NULL,
  `short` varchar(45) NOT NULL,
  `description` varchar(100) DEFAULT NULL,
  `defaultcheck` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bookingdetailstatus_options`
--

CREATE TABLE `bookingdetailstatus_options` (
  `bookingdetailstatus_id` tinyint(3) UNSIGNED NOT NULL,
  `bookingdetailstatusoption_id` int(10) UNSIGNED NOT NULL,
  `active` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bookingdetail_pax`
--

CREATE TABLE `bookingdetail_pax` (
  `bookingdetail_bsl` int(11) UNSIGNED NOT NULL,
  `pax_id` int(11) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bookings`
--

CREATE TABLE `bookings` (
  `id` int(11) UNSIGNED NOT NULL,
  `full_reference` char(15) NOT NULL,
  `name` varchar(100) DEFAULT NULL,
  `traveldate` date DEFAULT NULL,
  `status` char(2) DEFAULT NULL,
  `customer_id` smallint(5) UNSIGNED DEFAULT NULL,
  `agent_name` varchar(60) DEFAULT NULL,
  `agent_reference` varchar(60) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bookingstatusdetails`
--

CREATE TABLE `bookingstatusdetails` (
  `bookingstatus_id` tinyint(3) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `description` varchar(55) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bookingstatuses`
--

CREATE TABLE `bookingstatuses` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL,
  `color` varchar(6) NOT NULL DEFAULT 'ffffff'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bookingstatusoptions`
--

CREATE TABLE `bookingstatusoptions` (
  `id` int(10) UNSIGNED NOT NULL,
  `short` varchar(45) NOT NULL,
  `description` varchar(100) DEFAULT NULL,
  `defaultcheck` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bookingstatus_options`
--

CREATE TABLE `bookingstatus_options` (
  `bookingstatus_id` tinyint(3) UNSIGNED NOT NULL,
  `bookingstatusoption_id` int(10) UNSIGNED NOT NULL,
  `active` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bookingtypedetails`
--

CREATE TABLE `bookingtypedetails` (
  `bookingtype_id` tinyint(3) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `description` varchar(55) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `bookingtypes`
--

CREATE TABLE `bookingtypes` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL,
  `color` varchar(6) NOT NULL DEFAULT 'ffffff',
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `service_id` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `booking_details`
--

CREATE TABLE `booking_details` (
  `id` int(11) UNSIGNED NOT NULL,
  `booking_id` int(11) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `bsl_id` int(11) UNSIGNED NOT NULL,
  `date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `day` smallint(6) DEFAULT NULL,
  `seq` smallint(6) DEFAULT NULL,
  `pickup_date` date DEFAULT NULL,
  `pickup_time` time DEFAULT NULL,
  `pickup_location` varchar(240) DEFAULT NULL,
  `dropoff_date` date DEFAULT NULL,
  `dropoff_time` time DEFAULT NULL,
  `dropoff_location` varchar(240) DEFAULT NULL,
  `pax` smallint(5) DEFAULT NULL,
  `sl_status` char(2) DEFAULT NULL,
  `optional` char(1) DEFAULT NULL,
  `pkg_pcm_id` int(11) DEFAULT NULL,
  `pkg_source` char(1) DEFAULT NULL,
  `osr_vtext` varchar(100) DEFAULT NULL,
  `trans_consolidation` tinyint(3) DEFAULT NULL,
  `trans_transporter` varchar(60) DEFAULT NULL,
  `infant_count` smallint(5) UNSIGNED DEFAULT 0,
  `remarks` varchar(240) DEFAULT NULL,
  `child_count` smallint(5) UNSIGNED DEFAULT 0,
  `cost` decimal(12,4) DEFAULT NULL,
  `adult_count` smallint(5) UNSIGNED DEFAULT 0,
  `linked_psl_id` int(11) NOT NULL DEFAULT 0,
  `linked_pcm_id` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Triggers `booking_details`
--
DELIMITER $$
CREATE TRIGGER `bkdetupdtrigger` BEFORE UPDATE ON `booking_details` FOR EACH ROW BEGIN
            SET @json = "{";
            SET @used = false;
IF EXISTS (
                Select products.id
                From products
                    Inner Join suppliers
                        On suppliers.id = products.supplier_id
Inner Join service_options
On service_options.service_id = products.service_id
                    Inner Join serviceoptions
On service_options.serviceoption_id = serviceoptions.id
Where serviceoptions.short = 'istransfer'
And service_options.active = 1
                    And suppliers.code In ('TRAASI', 'REGASI')
                    And products.id IN (new.product_id, old.product_id)
            )
            THEN
                SET @json = CONCAT(@json, '"Date":"', new.date, '"');
                
                IF (old.pickup_date<>new.pickup_date OR
                    old.pickup_time<>new.pickup_time OR
                    old.pickup_location<>new.pickup_location)
                THEN
                    SET @used = true;
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"oPUDate":"', old.pickup_date, ' ', old.pickup_time,'"');
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"nPUDate":"', new.pickup_date, ' ', new.pickup_time, '"');
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"oPULoc":"', old.pickup_location, '"');
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"nPULoc":"', new.pickup_location, '"');
                END IF;

                
                IF (old.dropoff_date<>new.dropoff_date
                    OR old.dropoff_time<>new.dropoff_time
                    OR old.dropoff_location<>new.dropoff_location)
                THEN
                    SET @used = true;
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"oDODate":"', old.dropoff_date, ' ', old.dropoff_time,'"');
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"nDODate":"', new.dropoff_date, ' ', new.dropoff_time, '"');
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"oDOLoc":"', old.dropoff_location, '"');
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"nDOLoc":"', new.dropoff_location, '"');
                END IF;
                
                
                IF (old.pax<>new.pax
                    OR old.infant_count<>new.infant_count
                    OR old.child_count<>new.child_count
                    OR old.adult_count<>new.adult_count)
                THEN
                    SET @used = true;
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"oPax":"', old.pax, '"');
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"nPax":"', new.pax, '"');
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"oInfant":"', old.infant_count, '"');
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"nInfant":"', new.infant_count, '"');
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"oChild":"', old.child_count, '"');
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"nChild":"', new.child_count, '"');
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"oAdult":"', old.adult_count, '"');
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"nAdult":"', new.adult_count, '"');
                END IF;

                
                IF (old.sl_status <> new.sl_status
                    AND (
                        (old.sl_status = 'RQ' AND new.sl_status NOT IN ('CP', 'CX', 'OP', 'UA', 'UP'))
                        OR
                        (old.sl_status NOT IN ('CP', 'CX', 'OP', 'UA', 'UP') AND new.sl_status IN ('CP', 'CX', 'OP', 'UA', 'UP'))
                    )
                )
                THEN
                    SET @used = true;
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"oStatus":"', old.sl_status, '"');
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"nStatus":"', new.sl_status, '"');
                END IF;

                
                IF (old.product_id<>new.product_id)
                THEN
                    SET @used = true;
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"oProduct":"', old.product_id, '"');
                    SET @json = CONCAT(@json, ',');
                    SET @json = CONCAT(@json, '"nProduct":"', new.product_id, '"');
                END IF;
                SET @json = CONCAT(@json, '}');
            END IF;

            
            IF (@used)
            THEN
    INSERT INTO tpbkdetailchanges (bookingdetail_id, `data`) VALUES (NEW.id, @json);
            END IF;

        END
$$
DELIMITER ;

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

--
-- Table structure for table `changelogdetails`
--

CREATE TABLE `changelogdetails` (
  `changelog_id` bigint(20) UNSIGNED NOT NULL,
  `table_name` varchar(64) NOT NULL,
  `column_name` varchar(64) NOT NULL,
  `oldvalue` varchar(255) NOT NULL,
  `newvalue` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `changelogs`
--

CREATE TABLE `changelogs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `action` varchar(20) NOT NULL,
  `description` varchar(255) NOT NULL,
  `modified` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `reference` varchar(64) NOT NULL,
  `reference_id` int(10) UNSIGNED NOT NULL,
  `iuser_id` smallint(5) UNSIGNED DEFAULT NULL,
  `exuser_id` smallint(5) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__api_request_params`
--

CREATE TABLE `chn__api_request_params` (
  `id` int(10) UNSIGNED NOT NULL,
  `param_key` varchar(50) NOT NULL,
  `datatype_id` int(10) UNSIGNED NOT NULL,
  `lpos` smallint(5) UNSIGNED NOT NULL DEFAULT 1,
  `rpos` smallint(5) UNSIGNED NOT NULL DEFAULT 2,
  `operation_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__channels`
--

CREATE TABLE `chn__channels` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(45) NOT NULL,
  `description` varchar(45) DEFAULT NULL,
  `user` varchar(255) DEFAULT NULL,
  `pass` varchar(255) DEFAULT NULL,
  `key` varchar(255) DEFAULT NULL,
  `token` varchar(255) DEFAULT NULL,
  `enabled` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__comparisonoperator`
--

CREATE TABLE `chn__comparisonoperator` (
  `id` int(10) UNSIGNED NOT NULL,
  `label_displayname` varchar(50) NOT NULL,
  `function` tinyint(1) UNSIGNED NOT NULL,
  `php_operator` varchar(100) NOT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__conditional_output_values`
--

CREATE TABLE `chn__conditional_output_values` (
  `id` int(10) UNSIGNED NOT NULL,
  `comparisonoperator_id` int(10) UNSIGNED NOT NULL,
  `conditional_value` varchar(255) NOT NULL,
  `conditional_result` varchar(255) DEFAULT NULL,
  `customoutput_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__conditional_stdoutput_values`
--

CREATE TABLE `chn__conditional_stdoutput_values` (
  `id` int(10) UNSIGNED NOT NULL,
  `request_id` int(10) UNSIGNED NOT NULL,
  `stdoutput_id` int(10) UNSIGNED NOT NULL,
  `comparisonoperator_id` int(10) UNSIGNED NOT NULL,
  `conditional_value` varchar(150) NOT NULL,
  `conditional_result` varchar(250) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__custom_header`
--

CREATE TABLE `chn__custom_header` (
  `id` int(10) UNSIGNED NOT NULL,
  `header_param` int(10) UNSIGNED DEFAULT NULL,
  `apply_function` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `function_name` varchar(150) DEFAULT NULL,
  `encrypt` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `default_encrypt` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `parent_header` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__custom_output`
--

CREATE TABLE `chn__custom_output` (
  `id` int(10) UNSIGNED NOT NULL,
  `output_id` int(10) UNSIGNED NOT NULL,
  `request_id` int(10) UNSIGNED NOT NULL,
  `response_id` int(10) UNSIGNED DEFAULT NULL,
  `reference_id` int(10) UNSIGNED DEFAULT NULL,
  `array_property_to_filter` tinyint(1) UNSIGNED DEFAULT NULL,
  `filter_node_id` int(10) UNSIGNED DEFAULT NULL,
  `property_to_match` int(10) UNSIGNED DEFAULT NULL,
  `output_format` varchar(50) DEFAULT NULL,
  `default_value` varchar(100) DEFAULT NULL,
  `dont_map` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__custom_standardoutput`
--

CREATE TABLE `chn__custom_standardoutput` (
  `id` int(10) UNSIGNED NOT NULL,
  `standardoutput_id` int(10) UNSIGNED NOT NULL,
  `request_id` int(10) UNSIGNED NOT NULL,
  `response_id` int(10) UNSIGNED DEFAULT NULL,
  `reference_id` int(10) UNSIGNED DEFAULT NULL,
  `array_property_to_filter` tinyint(1) UNSIGNED DEFAULT NULL,
  `filter_node_id` int(10) UNSIGNED DEFAULT NULL,
  `property_to_match` varchar(50) DEFAULT NULL,
  `output_format` varchar(50) DEFAULT NULL,
  `default_value` varchar(100) DEFAULT NULL,
  `dont_map` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__filterresponse`
--

CREATE TABLE `chn__filterresponse` (
  `id` int(10) UNSIGNED NOT NULL,
  `response_id` int(10) UNSIGNED DEFAULT NULL,
  `filter_value` varchar(150) DEFAULT NULL,
  `comparisonoperator_id` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__filter_std_response`
--

CREATE TABLE `chn__filter_std_response` (
  `id` int(10) UNSIGNED NOT NULL,
  `response_id` int(10) UNSIGNED DEFAULT NULL,
  `filter_value` varchar(150) NOT NULL,
  `comparisonoperator_id` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__inputformat`
--

CREATE TABLE `chn__inputformat` (
  `id` int(10) UNSIGNED NOT NULL,
  `datatype_id` int(10) UNSIGNED NOT NULL,
  `operation_id` int(10) UNSIGNED NOT NULL,
  `key` varchar(150) NOT NULL,
  `lpos` smallint(5) UNSIGNED NOT NULL,
  `rpos` smallint(5) UNSIGNED NOT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL,
  `encrypt` tinyint(1) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__logs`
--

CREATE TABLE `chn__logs` (
  `id` int(10) UNSIGNED NOT NULL,
  `endpoint` varchar(255) NOT NULL,
  `operation_id` int(10) UNSIGNED NOT NULL,
  `request_id` int(10) UNSIGNED NOT NULL,
  `bookingdetail_id` int(11) NOT NULL,
  `supplier_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `request` longtext DEFAULT NULL,
  `request_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `response` longtext DEFAULT NULL,
  `response_date` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(),
  `output` longtext DEFAULT NULL,
  `output_date` datetime DEFAULT NULL,
  `status_code` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__operations`
--

CREATE TABLE `chn__operations` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(50) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__operation_requests`
--

CREATE TABLE `chn__operation_requests` (
  `operation_id` int(10) UNSIGNED NOT NULL,
  `request_id` int(10) UNSIGNED NOT NULL,
  `position` smallint(10) NOT NULL DEFAULT 1,
  `ismultiplerequest` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `operation_id_loopedcount` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__output`
--

CREATE TABLE `chn__output` (
  `id` int(10) UNSIGNED NOT NULL,
  `key` varchar(150) NOT NULL,
  `datatype_id` int(10) UNSIGNED NOT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL,
  `lpos` smallint(5) UNSIGNED NOT NULL,
  `rpos` smallint(5) UNSIGNED NOT NULL,
  `operation_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__output_fn`
--

CREATE TABLE `chn__output_fn` (
  `id` int(10) UNSIGNED NOT NULL,
  `output_id` int(10) UNSIGNED NOT NULL,
  `operation_id` int(10) UNSIGNED NOT NULL,
  `request_id` int(10) UNSIGNED NOT NULL,
  `function_name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__output_fn_params`
--

CREATE TABLE `chn__output_fn_params` (
  `id` int(10) UNSIGNED NOT NULL,
  `outputfn_id` int(10) UNSIGNED NOT NULL,
  `responseparam_id` int(10) UNSIGNED DEFAULT NULL,
  `default_value` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__parameters`
--

CREATE TABLE `chn__parameters` (
  `id` int(10) UNSIGNED NOT NULL,
  `request_id` int(10) UNSIGNED DEFAULT NULL,
  `key` varchar(255) NOT NULL,
  `inputformat_id` int(10) UNSIGNED DEFAULT NULL,
  `datatypeout_id` int(10) UNSIGNED NOT NULL DEFAULT 1,
  `value` varchar(255) DEFAULT NULL,
  `table` varchar(64) DEFAULT NULL,
  `field` varchar(64) DEFAULT NULL,
  `merge_children` tinyint(1) NOT NULL DEFAULT 0,
  `encrypt` tinyint(1) NOT NULL DEFAULT 0,
  `outputformat` varchar(25) DEFAULT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `use_key` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `lpos` smallint(5) UNSIGNED NOT NULL DEFAULT 2,
  `rpos` smallint(10) UNSIGNED NOT NULL DEFAULT 3,
  `api_key_name` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__productmap`
--

CREATE TABLE `chn__productmap` (
  `channel_id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `id` int(10) UNSIGNED DEFAULT NULL,
  `code` varchar(255) DEFAULT NULL,
  `rateid` int(10) UNSIGNED DEFAULT NULL,
  `ratecode` varchar(255) DEFAULT NULL,
  `ratename` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__requestheaders`
--

CREATE TABLE `chn__requestheaders` (
  `id` int(10) UNSIGNED NOT NULL,
  `key` varchar(255) NOT NULL,
  `value` varchar(255) NOT NULL,
  `table` varchar(150) NOT NULL,
  `field` varchar(150) NOT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `encrypted` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `request_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__requests`
--

CREATE TABLE `chn__requests` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(45) NOT NULL,
  `endpoint` varchar(255) NOT NULL,
  `httpmethod_id` tinyint(3) UNSIGNED NOT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 1,
  `url_id` int(10) UNSIGNED NOT NULL,
  `useparaminurl` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__responses`
--

CREATE TABLE `chn__responses` (
  `id` int(10) UNSIGNED NOT NULL,
  `request_id` int(10) UNSIGNED NOT NULL,
  `key` varchar(255) NOT NULL,
  `datatype_id` int(10) UNSIGNED NOT NULL,
  `lpos` smallint(5) UNSIGNED NOT NULL DEFAULT 65534,
  `rpos` smallint(5) UNSIGNED NOT NULL DEFAULT 65535
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__standardoutput`
--

CREATE TABLE `chn__standardoutput` (
  `id` int(10) UNSIGNED NOT NULL,
  `key` varchar(100) NOT NULL,
  `datatype_id` int(10) UNSIGNED NOT NULL,
  `enum_value_type` enum('AddressType','AlertCode','AlertType','AmenityType','AreaType','BaggageType','BedType','BookabilityType','CategoryRating','CategoryUnit','ChargeBasisType','ChargeType','Codec','ContentSourceType','Country','DeliveryFormat','DeliveryMethod','DocumentType','EmailType','ErrorCode','FeeCode','FilterType','GenderType','HashAlgorithm','ImageFormat','Inclusivity','IsoCurrency','Language','LengthUnit','LinkType','LocationCodeType','MealPlanCode','MIMEType','PaymentType','PhoneType','PriceType','ProductCodeType','ProductStatus','PropertyAttributeType','PropertyAttributeUnit','PropertyAttributeValueType','PropertyClassification','PropertyType','PublicKeyType','RatePlanType','RateRuleType','RedemptionMethod','RoomAttributeType','RoomAttributeUnit','RoomAttributeValueType','SeatAttributeType','SeatAttributeUnit','SeatAttributeValueType','ServiceAvailabilityType','SortingOrder','SortingType','StatusType','TaxCode','Theme','TravellerRelationship','TravellerType','TravelType','VideoFormat','WeightUnit') DEFAULT NULL,
  `enabled` tinyint(1) NOT NULL,
  `lpos` smallint(5) NOT NULL,
  `rpos` smallint(5) NOT NULL,
  `operation_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__stdoutput_fn`
--

CREATE TABLE `chn__stdoutput_fn` (
  `id` int(10) UNSIGNED NOT NULL,
  `stdoutput_id` int(10) UNSIGNED NOT NULL,
  `request_id` int(10) UNSIGNED NOT NULL,
  `function_name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__stdoutput_fn_params`
--

CREATE TABLE `chn__stdoutput_fn_params` (
  `id` int(10) UNSIGNED NOT NULL,
  `stdoutputfn_id` int(10) UNSIGNED NOT NULL,
  `responseparam_id` int(10) UNSIGNED DEFAULT NULL,
  `default_value` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__successcriteria`
--

CREATE TABLE `chn__successcriteria` (
  `id` int(10) UNSIGNED NOT NULL,
  `response_id` int(10) UNSIGNED NOT NULL,
  `comparisonoperator_id` int(10) UNSIGNED NOT NULL,
  `comparisonvalue` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__suppliermap`
--

CREATE TABLE `chn__suppliermap` (
  `channel_id` int(10) UNSIGNED NOT NULL,
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `id` int(10) UNSIGNED DEFAULT NULL,
  `code` varchar(255) DEFAULT NULL,
  `hastax` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `chnpricing` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `chn__urls`
--

CREATE TABLE `chn__urls` (
  `id` int(10) UNSIGNED NOT NULL,
  `value` varchar(150) NOT NULL,
  `channel_id` int(10) UNSIGNED NOT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contactaddresses`
--

CREATE TABLE `contactaddresses` (
  `id` int(10) UNSIGNED NOT NULL,
  `contact_id` int(10) UNSIGNED NOT NULL,
  `contacttype_id` tinyint(3) UNSIGNED NOT NULL,
  `contactcountries_id` char(2) NOT NULL,
  `addresslineone` varchar(255) DEFAULT NULL,
  `addresslinetwo` varchar(255) DEFAULT NULL,
  `contactaddressescol` varchar(45) DEFAULT NULL,
  `zip` varchar(45) NOT NULL,
  `city` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contactcompanies`
--

CREATE TABLE `contactcompanies` (
  `contacts_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contactcountries`
--

CREATE TABLE `contactcountries` (
  `id` char(2) NOT NULL,
  `cca3` char(3) NOT NULL,
  `currency_code` varchar(3) NOT NULL,
  `callingcode` varchar(7) NOT NULL,
  `region` varchar(8) NOT NULL,
  `subregion` varchar(25) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contactcountrydetails`
--

CREATE TABLE `contactcountrydetails` (
  `contactcountry_id` char(2) NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contactemails`
--

CREATE TABLE `contactemails` (
  `id` int(10) UNSIGNED NOT NULL,
  `contact_id` int(10) UNSIGNED NOT NULL,
  `contacttype_id` tinyint(5) UNSIGNED NOT NULL,
  `emailaddress` varchar(254) NOT NULL,
  `defaultemail` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contactpersons`
--

CREATE TABLE `contactpersons` (
  `contacts_id` int(10) UNSIGNED NOT NULL,
  `firstname` varchar(120) NOT NULL,
  `lastname` varchar(45) DEFAULT NULL,
  `media_id` int(10) UNSIGNED DEFAULT NULL,
  `title` char(5) DEFAULT NULL,
  `language` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contactphones`
--

CREATE TABLE `contactphones` (
  `id` int(10) UNSIGNED NOT NULL,
  `contact_id` int(10) UNSIGNED NOT NULL,
  `contacttype_id` tinyint(3) UNSIGNED NOT NULL,
  `countrycode` varchar(7) NOT NULL,
  `number` varchar(15) DEFAULT NULL,
  `extension` smallint(6) DEFAULT NULL,
  `phone` varchar(120) DEFAULT NULL,
  `defaultphone` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contactroles`
--

CREATE TABLE `contactroles` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `labels_name` varchar(50) DEFAULT NULL,
  `tpcode` char(2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contacts`
--

CREATE TABLE `contacts` (
  `id` int(10) UNSIGNED NOT NULL,
  `pbk_id` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contacttypes`
--

CREATE TABLE `contacttypes` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL,
  `position` tinyint(3) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contentcond`
--

CREATE TABLE `contentcond` (
  `id` int(10) UNSIGNED NOT NULL,
  `content_id` int(10) UNSIGNED NOT NULL,
  `marketconditions` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `customerconditions` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `usetitle` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `general` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contentconddaterange`
--

CREATE TABLE `contentconddaterange` (
  `contentcond_id` int(10) UNSIGNED NOT NULL,
  `datefrom` date DEFAULT NULL,
  `dateto` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contentcond_customers`
--

CREATE TABLE `contentcond_customers` (
  `contentcond_id` int(10) UNSIGNED NOT NULL,
  `customer_id` smallint(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contentcond_markets`
--

CREATE TABLE `contentcond_markets` (
  `contentcond_id` int(10) UNSIGNED NOT NULL,
  `referencecountry_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contentcond_priceperiods`
--

CREATE TABLE `contentcond_priceperiods` (
  `contentcond_id` int(10) UNSIGNED NOT NULL,
  `priceperiod_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contentdetailhistory`
--

CREATE TABLE `contentdetailhistory` (
  `id` int(10) UNSIGNED NOT NULL,
  `content_id` int(10) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` longtext NOT NULL,
  `iuser_id` smallint(5) UNSIGNED NOT NULL,
  `timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
  `app_id` smallint(5) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contentdetails`
--

CREATE TABLE `contentdetails` (
  `content_id` int(10) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `description` longtext DEFAULT NULL,
  `reviewedate` timestamp NULL DEFAULT current_timestamp(),
  `reviewed` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `reviewedby` smallint(5) UNSIGNED DEFAULT NULL,
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contents`
--

CREATE TABLE `contents` (
  `id` int(10) UNSIGNED NOT NULL,
  `parent_id` int(10) UNSIGNED DEFAULT NULL,
  `version` smallint(5) UNSIGNED NOT NULL DEFAULT 1,
  `protected` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(3) UNSIGNED NOT NULL DEFAULT 1,
  `createdby` smallint(5) UNSIGNED DEFAULT NULL,
  `templccat` int(10) UNSIGNED DEFAULT NULL,
  `templcid` int(10) UNSIGNED DEFAULT NULL,
  `templctype` char(3) DEFAULT NULL,
  `deleted` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `istpnote` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `tempproductid` int(10) UNSIGNED DEFAULT NULL COMMENT 'for the insertion of new tp notes',
  `templocationid` smallint(5) UNSIGNED DEFAULT NULL,
  `format` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contenttypes`
--

CREATE TABLE `contenttypes` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `content_countries`
--

CREATE TABLE `content_countries` (
  `content_id` int(10) UNSIGNED NOT NULL,
  `country_id` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `content_customers`
--

CREATE TABLE `content_customers` (
  `content_id` int(10) UNSIGNED NOT NULL,
  `customer_id` smallint(5) UNSIGNED NOT NULL,
  `default` smallint(3) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `content_localities`
--

CREATE TABLE `content_localities` (
  `content_id` int(10) UNSIGNED NOT NULL,
  `locality_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `content_locations`
--

CREATE TABLE `content_locations` (
  `content_id` int(10) UNSIGNED NOT NULL,
  `location_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `content_media`
--

CREATE TABLE `content_media` (
  `content_id` int(10) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `default` tinyint(3) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `content_products`
--

CREATE TABLE `content_products` (
  `content_id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `content_regions`
--

CREATE TABLE `content_regions` (
  `content_id` int(10) UNSIGNED NOT NULL,
  `region_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `content_suppliers`
--

CREATE TABLE `content_suppliers` (
  `content_id` int(10) UNSIGNED NOT NULL,
  `supplier_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `content_tags`
--

CREATE TABLE `content_tags` (
  `content_id` int(10) UNSIGNED NOT NULL,
  `tag_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contracts`
--

CREATE TABLE `contracts` (
  `id` int(10) UNSIGNED NOT NULL,
  `supplier_id` smallint(5) UNSIGNED DEFAULT NULL,
  `created` timestamp NULL DEFAULT NULL,
  `modified` timestamp NULL DEFAULT NULL,
  `sellfrom` date NOT NULL,
  `sellto` date NOT NULL,
  `year` smallint(5) UNSIGNED NOT NULL,
  `iuser_id` int(11) NOT NULL,
  `contractstatus_id` tinyint(3) UNSIGNED NOT NULL,
  `contracttype_id` tinyint(4) UNSIGNED NOT NULL,
  `contact_id` int(10) UNSIGNED DEFAULT NULL,
  `pricecode_id` tinyint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contractstatuses`
--

CREATE TABLE `contractstatuses` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL,
  `finalized` tinyint(1) UNSIGNED NOT NULL,
  `definite` tinyint(1) UNSIGNED NOT NULL,
  `color` varchar(25) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contracttypes`
--

CREATE TABLE `contracttypes` (
  `id` tinyint(4) UNSIGNED NOT NULL,
  `labels_name` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `countries`
--

CREATE TABLE `countries` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `code` char(3) NOT NULL,
  `parent_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `isparent` tinyint(3) UNSIGNED NOT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `lc_enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `countryappcontentreviewed`
--

CREATE TABLE `countryappcontentreviewed` (
  `country_id` tinyint(3) UNSIGNED NOT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL,
  `user_id` smallint(5) UNSIGNED NOT NULL,
  `contenttype_id` tinyint(3) UNSIGNED NOT NULL,
  `changedat` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `countryappenabled`
--

CREATE TABLE `countryappenabled` (
  `country_id` tinyint(3) UNSIGNED NOT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL,
  `user_id` smallint(5) UNSIGNED NOT NULL,
  `comment` varchar(250) NOT NULL,
  `changedat` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `enabled` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `countrycontentposition`
--

CREATE TABLE `countrycontentposition` (
  `content_id` int(10) UNSIGNED NOT NULL,
  `country_id` tinyint(3) UNSIGNED NOT NULL,
  `appcategory_id` smallint(5) UNSIGNED NOT NULL,
  `position` tinyint(2) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `countrydetails`
--

CREATE TABLE `countrydetails` (
  `country_id` tinyint(3) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(45) NOT NULL,
  `nts_id` int(11) DEFAULT NULL,
  `updated` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `country_media`
--

CREATE TABLE `country_media` (
  `country_id` tinyint(3) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `template_id` int(10) UNSIGNED NOT NULL,
  `appmediatemplate_id` int(10) UNSIGNED NOT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `country_tags`
--

CREATE TABLE `country_tags` (
  `country_id` tinyint(3) UNSIGNED NOT NULL,
  `tag_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `country_videos`
--

CREATE TABLE `country_videos` (
  `country_id` tinyint(3) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `hd` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `language_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `parentmedia_id` int(10) UNSIGNED DEFAULT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `currencies`
--

CREATE TABLE `currencies` (
  `id` char(3) NOT NULL,
  `name` varchar(65) NOT NULL,
  `number` smallint(3) UNSIGNED NOT NULL,
  `minor` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `currencyrates`
--

CREATE TABLE `currencyrates` (
  `fromcurrency_id` int(10) UNSIGNED NOT NULL,
  `tocurrency_id` int(10) UNSIGNED NOT NULL,
  `rate` decimal(23,17) NOT NULL,
  `ratefrom` date NOT NULL,
  `rateto` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `customeranalysis`
--

CREATE TABLE `customeranalysis` (
  `customer_id` smallint(5) UNSIGNED NOT NULL,
  `analysis1` varchar(2) DEFAULT NULL,
  `analysis2` varchar(2) DEFAULT NULL,
  `analysis3` varchar(2) DEFAULT NULL,
  `analysis4` varchar(2) DEFAULT NULL,
  `analysis5` varchar(2) DEFAULT NULL,
  `analysis6` varchar(2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `customeroptions`
--

CREATE TABLE `customeroptions` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `short` varchar(45) NOT NULL,
  `description` varchar(100) DEFAULT NULL,
  `defaultcheck` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `system` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `customers`
--

CREATE TABLE `customers` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `name` varchar(90) NOT NULL,
  `code` char(6) NOT NULL,
  `lccustomer_id` smallint(6) UNSIGNED DEFAULT NULL,
  `lcpricing` tinyint(1) UNSIGNED DEFAULT 0,
  `lc_enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED DEFAULT 1,
  `ref__country_id` int(10) UNSIGNED DEFAULT NULL,
  `drm_id` int(10) UNSIGNED DEFAULT NULL,
  `iata` varchar(10) DEFAULT NULL,
  `logo` varchar(250) DEFAULT NULL,
  `tplogin` varchar(60) DEFAULT NULL,
  `tppassword` varchar(120) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `customer_exclusiveproducts`
--

CREATE TABLE `customer_exclusiveproducts` (
  `customer_id` smallint(5) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `customer_options`
--

CREATE TABLE `customer_options` (
  `customer_id` smallint(5) UNSIGNED NOT NULL,
  `customeroption_id` smallint(5) UNSIGNED NOT NULL,
  `active` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Stand-in structure for view `dmcs`
-- (See below for the actual view)
--
CREATE TABLE `dmcs` (
`id` tinyint(3) unsigned
,`name` varchar(45)
,`dmsdbhost` varchar(255)
,`dmsdbname` varchar(64)
,`dmsdbuser` varchar(80)
,`dmsdbpass` varchar(255)
,`memdbhost` varchar(255)
,`memdbname` varchar(64)
,`memdbuser` varchar(80)
,`memdbpass` varchar(255)
,`enabled` tinyint(1) unsigned
);

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

--
-- Table structure for table `driverdocuments`
--

CREATE TABLE `driverdocuments` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(50) NOT NULL,
  `driverdocumenttype_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `description` text DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp(),
  `driver_id` smallint(5) UNSIGNED NOT NULL,
  `uuid` char(36) NOT NULL,
  `extension` varchar(6) NOT NULL,
  `expiration` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `driverdocumenttypes`
--

CREATE TABLE `driverdocumenttypes` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `label_name` varchar(50) NOT NULL,
  `required` tinyint(1) UNSIGNED NOT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `drivers`
--

CREATE TABLE `drivers` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `transporter_id` smallint(5) UNSIGNED NOT NULL,
  `contact_id` int(10) UNSIGNED NOT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `driver_contactemails`
--

CREATE TABLE `driver_contactemails` (
  `driver_id` smallint(5) UNSIGNED NOT NULL,
  `contactemail_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `driver_contactphones`
--

CREATE TABLE `driver_contactphones` (
  `driver_id` smallint(5) UNSIGNED NOT NULL,
  `contactphone_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `driver_languages`
--

CREATE TABLE `driver_languages` (
  `driver_id` smallint(5) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `endcustomers`
--

CREATE TABLE `endcustomers` (
  `id` int(10) UNSIGNED NOT NULL,
  `contact_id` int(10) UNSIGNED NOT NULL,
  `changed` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `endcustomer_bookings`
--

CREATE TABLE `endcustomer_bookings` (
  `endcustomer_id` int(10) UNSIGNED NOT NULL,
  `bookingtype` char(4) NOT NULL,
  `booking_no` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `exaccesses`
--

CREATE TABLE `exaccesses` (
  `bit` bigint(20) UNSIGNED NOT NULL COMMENT 'Has to be 2^n!',
  `language_id` tinyint(4) UNSIGNED NOT NULL DEFAULT 0,
  `name` varchar(45) NOT NULL,
  `description` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `exmenucategories`
--

CREATE TABLE `exmenucategories` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `name` varchar(25) NOT NULL,
  `enabled` tinyint(3) UNSIGNED NOT NULL DEFAULT 1,
  `lpos` smallint(5) UNSIGNED DEFAULT NULL,
  `rpos` smallint(5) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `exmenus`
--

CREATE TABLE `exmenus` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL,
  `type` tinyint(3) UNSIGNED NOT NULL,
  `icon` varchar(25) NOT NULL DEFAULT '',
  `position` tinyint(3) UNSIGNED DEFAULT NULL,
  `parent` smallint(5) UNSIGNED DEFAULT NULL,
  `url` varchar(2047) DEFAULT NULL,
  `exmenucategory_id` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
  `transport` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `exmenu_exaccesses`
--

CREATE TABLE `exmenu_exaccesses` (
  `exmenu_id` smallint(5) UNSIGNED NOT NULL,
  `exaccess_bit` bigint(20) UNSIGNED DEFAULT NULL,
  `param` varchar(10) DEFAULT NULL,
  `required` tinyint(1) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `expasswordresets`
--

CREATE TABLE `expasswordresets` (
  `exuser_id` smallint(5) UNSIGNED NOT NULL,
  `uuid` binary(16) NOT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp(),
  `attempts` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `exurlparameters`
--

CREATE TABLE `exurlparameters` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `parameter` varchar(10) NOT NULL,
  `url` varchar(255) NOT NULL,
  `ispublic` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `exusers`
--

CREATE TABLE `exusers` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED DEFAULT NULL,
  `first` varchar(50) NOT NULL,
  `last` varchar(50) NOT NULL,
  `pass` varchar(32) NOT NULL,
  `email` varchar(50) NOT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 1,
  `uuid` binary(16) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `exuser_supplieraccesses`
--

CREATE TABLE `exuser_supplieraccesses` (
  `exuser_id` smallint(5) UNSIGNED NOT NULL,
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `exaccess_bit` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `exuser_terms`
--

CREATE TABLE `exuser_terms` (
  `exuser_id` smallint(5) UNSIGNED NOT NULL,
  `termtype_id` tinyint(3) UNSIGNED NOT NULL,
  `approved` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `gps`
--

CREATE TABLE `gps` (
  `id` int(11) UNSIGNED NOT NULL,
  `supplier_id` smallint(5) UNSIGNED DEFAULT NULL,
  `product_id` int(10) UNSIGNED DEFAULT NULL,
  `country_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `region_id` smallint(5) UNSIGNED DEFAULT NULL,
  `location_id` smallint(5) UNSIGNED DEFAULT NULL,
  `locality_id` smallint(5) UNSIGNED DEFAULT NULL,
  `latitude` decimal(18,15) NOT NULL,
  `longitude` decimal(18,14) NOT NULL,
  `zoom` tinyint(4) NOT NULL DEFAULT 12,
  `day` tinyint(3) UNSIGNED DEFAULT NULL,
  `position` smallint(5) UNSIGNED DEFAULT NULL,
  `icon` varchar(255) DEFAULT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `waypoint` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `app_id` smallint(5) UNSIGNED DEFAULT NULL,
  `tmp_id` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `gpsdetails`
--

CREATE TABLE `gpsdetails` (
  `gps_id` int(11) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `name` varchar(100) NOT NULL,
  `nts_id` int(11) UNSIGNED DEFAULT NULL,
  `updated` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `groups_mails`
--

CREATE TABLE `groups_mails` (
  `iusergroup_id` smallint(5) UNSIGNED NOT NULL,
  `mail_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `guidebookings`
--

CREATE TABLE `guidebookings` (
  `id` int(10) UNSIGNED NOT NULL,
  `guide_id` smallint(5) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `guides`
--

CREATE TABLE `guides` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `contact_id` int(10) UNSIGNED DEFAULT NULL,
  `expiration` date DEFAULT NULL,
  `disabled` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `history`
--

CREATE TABLE `history` (
  `id` int(10) UNSIGNED NOT NULL,
  `iuser_id` smallint(5) DEFAULT NULL,
  `exuser_id` smallint(5) DEFAULT NULL,
  `referencetable` varchar(50) NOT NULL,
  `referencevalue` int(11) UNSIGNED DEFAULT NULL,
  `changes` longtext DEFAULT NULL,
  `created` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `historytopics`
--

CREATE TABLE `historytopics` (
  `id` int(10) UNSIGNED NOT NULL,
  `tablename` varchar(50) NOT NULL,
  `label` varchar(50) DEFAULT NULL,
  `lpos` smallint(5) UNSIGNED DEFAULT NULL,
  `rpos` smallint(5) UNSIGNED DEFAULT NULL,
  `referencecolumn` varchar(50) NOT NULL,
  `searchcolumns` varchar(250) NOT NULL,
  `searchlabel` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `iaccesses`
--

CREATE TABLE `iaccesses` (
  `bit` bigint(20) UNSIGNED NOT NULL COMMENT 'Has to be 2^n!	',
  `language_id` tinyint(4) UNSIGNED NOT NULL DEFAULT 0,
  `name` varchar(45) NOT NULL,
  `description` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `identificationtypes`
--

CREATE TABLE `identificationtypes` (
  `id` tinyint(4) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `imenucategories`
--

CREATE TABLE `imenucategories` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `name` varchar(25) NOT NULL,
  `enabled` tinyint(3) UNSIGNED NOT NULL DEFAULT 1,
  `lpos` smallint(5) UNSIGNED DEFAULT NULL,
  `rpos` smallint(5) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `imenus`
--

CREATE TABLE `imenus` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL,
  `type` tinyint(3) UNSIGNED NOT NULL,
  `icon` varchar(25) DEFAULT NULL,
  `position` tinyint(3) UNSIGNED DEFAULT NULL,
  `parent` smallint(5) UNSIGNED DEFAULT NULL,
  `url` varchar(2047) DEFAULT NULL,
  `imenucategory_id` smallint(5) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `imenu_iaccesses`
--

CREATE TABLE `imenu_iaccesses` (
  `imenu_id` smallint(5) UNSIGNED NOT NULL,
  `iaccess_bit` bigint(20) UNSIGNED NOT NULL,
  `param` varchar(10) DEFAULT NULL,
  `required` tinyint(1) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ipasswordresets`
--

CREATE TABLE `ipasswordresets` (
  `iuser_id` smallint(5) UNSIGNED NOT NULL,
  `uuid` binary(16) NOT NULL,
  `attempts` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `created` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `isession_data`
--

CREATE TABLE `isession_data` (
  `session_id` varchar(32) NOT NULL DEFAULT '',
  `hash` varchar(32) NOT NULL DEFAULT '',
  `session_data` blob NOT NULL,
  `session_expire` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `itinerarymapdategps`
--

CREATE TABLE `itinerarymapdategps` (
  `id` int(10) UNSIGNED NOT NULL,
  `itinerarymapdate_id` int(10) UNSIGNED NOT NULL,
  `gps_id` int(10) UNSIGNED DEFAULT NULL,
  `latitude` decimal(18,15) NOT NULL,
  `longitude` decimal(18,14) NOT NULL,
  `position` tinyint(4) DEFAULT NULL,
  `icon` varchar(255) DEFAULT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `waypoint` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `isoptional` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `itinerarymapdategpsdetails`
--

CREATE TABLE `itinerarymapdategpsdetails` (
  `itinerarymapdategps_id` int(10) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `itinerarymapdates`
--

CREATE TABLE `itinerarymapdates` (
  `id` int(10) UNSIGNED NOT NULL,
  `itinerarymap_id` int(10) UNSIGNED NOT NULL,
  `date` date NOT NULL,
  `verified` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `itinerarymaps`
--

CREATE TABLE `itinerarymaps` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(80) DEFAULT NULL,
  `endcustomername` varchar(80) DEFAULT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `customer_id` smallint(5) UNSIGNED DEFAULT NULL,
  `iuser_id` smallint(5) UNSIGNED DEFAULT NULL,
  `booking_id` int(10) UNSIGNED NOT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated` timestamp NOT NULL DEFAULT current_timestamp(),
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `pkgServices` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `pkgHeader` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `carrental` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `iurlparameters`
--

CREATE TABLE `iurlparameters` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `parameter` varchar(10) NOT NULL,
  `url` varchar(255) NOT NULL,
  `ispublic` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `iusergroups`
--

CREATE TABLE `iusergroups` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `name` varchar(25) NOT NULL,
  `comment` varchar(45) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `short` varchar(3) NOT NULL,
  `countrycode` varchar(7) NOT NULL DEFAULT '',
  `phone` varchar(15) NOT NULL DEFAULT '',
  `extension` varchar(5) NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `iusers`
--

CREATE TABLE `iusers` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED DEFAULT NULL,
  `first` varchar(50) NOT NULL,
  `last` varchar(50) NOT NULL,
  `pass` varchar(32) NOT NULL,
  `email` varchar(255) NOT NULL,
  `job` varchar(50) NOT NULL DEFAULT '',
  `countrycode` varchar(7) NOT NULL DEFAULT '',
  `phone` varchar(15) NOT NULL DEFAULT '',
  `extension` varchar(5) NOT NULL DEFAULT '',
  `theme` varchar(100) NOT NULL DEFAULT 'fixed-topbar color-default fixed-sidebar theme-sdtl' COMMENT 'fixed-topbar color-default fixed-sidebar theme-sdtl',
  `iaccess_bit` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) NOT NULL DEFAULT 1,
  `uuid` binary(16) DEFAULT NULL,
  `socketkey` varchar(128) DEFAULT NULL,
  `wsconnected` tinyint(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `iuser_apps`
--

CREATE TABLE `iuser_apps` (
  `iuser_id` smallint(5) UNSIGNED NOT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `iuser_groups`
--

CREATE TABLE `iuser_groups` (
  `iuser_id` smallint(5) UNSIGNED NOT NULL,
  `iusergroup_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `iuser_roles`
--

CREATE TABLE `iuser_roles` (
  `iuser_id` smallint(5) UNSIGNED NOT NULL,
  `role_id` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `iuser_taskorder`
--

CREATE TABLE `iuser_taskorder` (
  `iuser_id` smallint(5) UNSIGNED NOT NULL,
  `task_id` int(10) UNSIGNED NOT NULL,
  `position` smallint(5) UNSIGNED DEFAULT NULL,
  `priority` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `labeldetails`
--

CREATE TABLE `labeldetails` (
  `label_id` varchar(50) NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `description` mediumtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `labels`
--

CREATE TABLE `labels` (
  `id` varchar(50) NOT NULL,
  `name` varchar(50) GENERATED ALWAYS AS (`id`) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `languages`
--

CREATE TABLE `languages` (
  `id` tinyint(4) UNSIGNED NOT NULL,
  `name` varchar(45) NOT NULL,
  `short` varchar(2) NOT NULL,
  `flag` varchar(255) DEFAULT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `lcproducttext_appcategories`
--

CREATE TABLE `lcproducttext_appcategories` (
  `producttextcategory_id` tinyint(4) NOT NULL,
  `appcategory_id` smallint(5) UNSIGNED NOT NULL,
  `main` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `lcsuppliertext_appcategories`
--

CREATE TABLE `lcsuppliertext_appcategories` (
  `suppliertextcategory_id` tinyint(4) NOT NULL,
  `appcategory_id` smallint(5) UNSIGNED NOT NULL,
  `main` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `lcsync`
--

CREATE TABLE `lcsync` (
  `id` char(1) NOT NULL,
  `last` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `lczonedescription_appcategories`
--

CREATE TABLE `lczonedescription_appcategories` (
  `zone` char(3) NOT NULL COMMENT 'CTR, REG, LOC, LCL',
  `appcategory_id` smallint(5) UNSIGNED NOT NULL,
  `main` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `localities`
--

CREATE TABLE `localities` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `location_id` smallint(5) UNSIGNED DEFAULT NULL,
  `code` char(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `port_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `inter` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `lc_enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `localityappcontentreviewed`
--

CREATE TABLE `localityappcontentreviewed` (
  `locality_id` smallint(5) UNSIGNED NOT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL,
  `user_id` smallint(5) UNSIGNED NOT NULL,
  `contenttype_id` tinyint(3) UNSIGNED NOT NULL,
  `changedat` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `localityappenabled`
--

CREATE TABLE `localityappenabled` (
  `locality_id` smallint(5) UNSIGNED NOT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL,
  `user_id` smallint(5) UNSIGNED NOT NULL,
  `comment` varchar(250) NOT NULL,
  `changedat` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `enabled` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `localitycontentposition`
--

CREATE TABLE `localitycontentposition` (
  `content_id` int(10) UNSIGNED NOT NULL,
  `locality_id` smallint(5) UNSIGNED NOT NULL,
  `appcategory_id` smallint(5) UNSIGNED NOT NULL,
  `position` tinyint(2) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `localitydetails`
--

CREATE TABLE `localitydetails` (
  `locality_id` smallint(5) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(45) NOT NULL,
  `nts_id` int(11) DEFAULT NULL,
  `updated` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `locality_media`
--

CREATE TABLE `locality_media` (
  `locality_id` smallint(5) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `template_id` int(10) UNSIGNED NOT NULL,
  `appmediatemplate_id` int(10) UNSIGNED NOT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `locality_tags`
--

CREATE TABLE `locality_tags` (
  `locality_id` smallint(5) UNSIGNED NOT NULL,
  `tag_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `locality_videos`
--

CREATE TABLE `locality_videos` (
  `locality_id` smallint(5) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `hd` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `language_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `parentmedia_id` int(10) UNSIGNED DEFAULT NULL,
  `app_id` smallint(6) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `locationappcontentreviewed`
--

CREATE TABLE `locationappcontentreviewed` (
  `location_id` smallint(5) UNSIGNED NOT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL,
  `user_id` smallint(5) UNSIGNED NOT NULL,
  `contenttype_id` tinyint(3) UNSIGNED NOT NULL,
  `changedat` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `locationappenabled`
--

CREATE TABLE `locationappenabled` (
  `location_id` smallint(5) UNSIGNED NOT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL,
  `user_id` smallint(5) UNSIGNED NOT NULL,
  `comment` varchar(250) NOT NULL,
  `changedat` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `enabled` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `locationcontentposition`
--

CREATE TABLE `locationcontentposition` (
  `content_id` int(10) UNSIGNED NOT NULL,
  `location_id` smallint(5) UNSIGNED NOT NULL,
  `appcategory_id` smallint(5) UNSIGNED NOT NULL,
  `position` tinyint(2) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `locationdetails`
--

CREATE TABLE `locationdetails` (
  `location_id` smallint(5) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(45) NOT NULL,
  `nts_id` int(11) DEFAULT 0,
  `updated` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `locations`
--

CREATE TABLE `locations` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `region_id` smallint(5) UNSIGNED DEFAULT NULL,
  `code` char(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `lc_enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `location_media`
--

CREATE TABLE `location_media` (
  `location_id` smallint(5) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `template_id` int(10) UNSIGNED NOT NULL,
  `appmediatemplate_id` int(10) UNSIGNED NOT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `location_tags`
--

CREATE TABLE `location_tags` (
  `location_id` smallint(5) UNSIGNED NOT NULL,
  `tag_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `location_videos`
--

CREATE TABLE `location_videos` (
  `location_id` smallint(5) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `hd` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `language_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `parentmedia_id` int(10) UNSIGNED DEFAULT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `luggagesolutiondetails`
--

CREATE TABLE `luggagesolutiondetails` (
  `luggagesolution_id` tinyint(3) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `description` varchar(55) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `luggagesolutions`
--

CREATE TABLE `luggagesolutions` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `maileraccounts`
--

CREATE TABLE `maileraccounts` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `mailer` varchar(8) NOT NULL DEFAULT 'smtp',
  `smtpauth` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `port` smallint(5) UNSIGNED NOT NULL,
  `smtpsecure` varchar(4) NOT NULL DEFAULT 'tls',
  `username` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `host` varchar(255) NOT NULL,
  `debug` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `oauth` tinyint(1) NOT NULL,
  `oauth_client_id` varchar(255) NOT NULL COMMENT 'Client ID de Google',
  `oauth_tenant_id` varchar(255) DEFAULT NULL COMMENT '	Tenant ID de Microsoft (o common)',
  `oauth_client_secret` varchar(255) NOT NULL COMMENT '	Client Secret de Google (encriptado)',
  `oauth_refresh_token` text NOT NULL COMMENT '	Refresh Token (encriptado',
  `oauth_type` varchar(20) NOT NULL COMMENT '	''password'' o ''oauth2'' para mantener compatibilidad con cuentas no-Google',
  `protected` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `maileraddresses`
--

CREATE TABLE `maileraddresses` (
  `id` int(10) UNSIGNED NOT NULL,
  `mailerqueue_id` int(10) UNSIGNED NOT NULL,
  `maileraddresstype_id` tinyint(3) UNSIGNED NOT NULL,
  `address` varchar(255) NOT NULL,
  `name` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `maileradresstypes`
--

CREATE TABLE `maileradresstypes` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(45) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `mailerqueue`
--

CREATE TABLE `mailerqueue` (
  `id` int(10) UNSIGNED NOT NULL,
  `fromname` varchar(255) DEFAULT NULL,
  `subject` varchar(255) NOT NULL,
  `body` longtext NOT NULL,
  `altbody` mediumtext NOT NULL,
  `maileraccount_id` tinyint(3) UNSIGNED NOT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp(),
  `sent` timestamp NULL DEFAULT NULL,
  `attempts` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `notified` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `mailertemplates`
--

CREATE TABLE `mailertemplates` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `name` varchar(50) NOT NULL,
  `subject_label` varchar(50) NOT NULL,
  `body` mediumtext NOT NULL,
  `altbody` mediumtext NOT NULL,
  `maileraccount_id` tinyint(3) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `mailertemplatevariables`
--

CREATE TABLE `mailertemplatevariables` (
  `mailertemplate_id` smallint(5) UNSIGNED NOT NULL,
  `variable` varchar(20) NOT NULL,
  `label_name` varchar(50) DEFAULT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL DEFAULT 255
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `mails`
--

CREATE TABLE `mails` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(250) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `mailstatuses`
--

CREATE TABLE `mailstatuses` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `label_name` varchar(50) NOT NULL,
  `icon` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `mapiconconversions`
--

CREATE TABLE `mapiconconversions` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `png` varchar(255) NOT NULL,
  `svg` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `notecategories`
--

CREATE TABLE `notecategories` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `name` varchar(45) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `notedetails`
--

CREATE TABLE `notedetails` (
  `note_id` int(10) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `description` mediumtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `notes`
--

CREATE TABLE `notes` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(80) NOT NULL,
  `notecategory_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `note_iusergroups`
--

CREATE TABLE `note_iusergroups` (
  `note_id` int(10) UNSIGNED NOT NULL,
  `iusergroup_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `note_iusers`
--

CREATE TABLE `note_iusers` (
  `note_id` int(10) UNSIGNED NOT NULL,
  `iuser_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `notificationcategories`
--

CREATE TABLE `notificationcategories` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `name` varchar(50) DEFAULT NULL,
  `color` varchar(20) NOT NULL,
  `icon` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `notifications`
--

CREATE TABLE `notifications` (
  `id` int(10) UNSIGNED NOT NULL,
  `token` varchar(36) NOT NULL,
  `iuser_id` smallint(5) UNSIGNED DEFAULT NULL COMMENT 'Notification DMS listener',
  `iusergroup_id` smallint(5) UNSIGNED DEFAULT NULL COMMENT 'Notification DMS group listener',
  `created_by` smallint(5) UNSIGNED DEFAULT NULL,
  `redirect_url` varchar(255) DEFAULT NULL COMMENT 'URL',
  `message_lbl` varchar(25) NOT NULL,
  `pushtime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `wasread` tinyint(1) UNSIGNED NOT NULL,
  `waspushed` tinyint(1) UNSIGNED NOT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp(),
  `exuser_id` smallint(5) UNSIGNED DEFAULT NULL COMMENT 'Notification Extranet listener',
  `app_id` smallint(5) UNSIGNED DEFAULT NULL COMMENT 'Notification App listener',
  `notificationcategory_id` smallint(5) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `not__notifications`
--

CREATE TABLE `not__notifications` (
  `id` int(10) UNSIGNED NOT NULL,
  `params` longtext NOT NULL,
  `iuser_id` smallint(5) UNSIGNED NOT NULL,
  `template_id` tinyint(3) UNSIGNED NOT NULL,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `delivered` timestamp NULL DEFAULT NULL,
  `viewed` timestamp NULL DEFAULT NULL,
  `deleted` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `not__templates`
--

CREATE TABLE `not__templates` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(50) NOT NULL,
  `body` mediumtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `not__templatevariables`
--

CREATE TABLE `not__templatevariables` (
  `template_id` tinyint(3) UNSIGNED NOT NULL,
  `variable` varchar(25) NOT NULL,
  `label_name` varchar(50) DEFAULT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL DEFAULT 128
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `occupations`
--

CREATE TABLE `occupations` (
  `id` char(2) NOT NULL,
  `label_name` varchar(50) NOT NULL,
  `pax` tinyint(1) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `others_texts`
--

CREATE TABLE `others_texts` (
  `id` int(11) UNSIGNED NOT NULL,
  `name` varchar(100) DEFAULT NULL,
  `description` varchar(250) DEFAULT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `othertextcontent_history`
--

CREATE TABLE `othertextcontent_history` (
  `othertext_id` int(11) UNSIGNED NOT NULL,
  `catuser_id` smallint(5) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `text` longtext NOT NULL,
  `last_changed` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `othertext_contents`
--

CREATE TABLE `othertext_contents` (
  `othertext_id` int(11) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `text` longtext NOT NULL,
  `updated` tinyint(1) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `othertext_images`
--

CREATE TABLE `othertext_images` (
  `othertext_id` int(11) UNSIGNED NOT NULL,
  `image_id` int(11) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `othertext_tags`
--

CREATE TABLE `othertext_tags` (
  `othertext_id` int(11) UNSIGNED NOT NULL,
  `tag` int(11) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `packages`
--

CREATE TABLE `packages` (
  `pcm_id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `bookon` tinyint(1) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `paxs`
--

CREATE TABLE `paxs` (
  `id` int(11) UNSIGNED NOT NULL,
  `pax_surname` varchar(60) DEFAULT NULL,
  `pax_title` char(10) DEFAULT NULL,
  `pax_forename` varchar(60) DEFAULT NULL,
  `pax_type` char(1) DEFAULT NULL,
  `child_age` int(11) UNSIGNED DEFAULT NULL,
  `edg_ind` char(1) DEFAULT NULL,
  `notes1` varchar(60) DEFAULT NULL,
  `notes2` varchar(60) DEFAULT NULL,
  `notes3` varchar(60) DEFAULT NULL,
  `notes4` varchar(60) DEFAULT NULL,
  `notes5` varchar(60) DEFAULT NULL,
  `cmd_id` int(11) UNSIGNED DEFAULT NULL,
  `date_birth` datetime DEFAULT NULL,
  `passport_number` varchar(30) DEFAULT NULL,
  `passport_name` varchar(60) DEFAULT NULL,
  `passport_nationality` varchar(30) DEFAULT NULL,
  `passport_issued` datetime DEFAULT NULL,
  `passport_place` varchar(30) DEFAULT NULL,
  `passport_expiry` datetime DEFAULT NULL,
  `pax_persist` bit(1) DEFAULT NULL,
  `is_customer` bit(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `paxtypes`
--

CREATE TABLE `paxtypes` (
  `type` varchar(2) NOT NULL,
  `tptype` varchar(3) NOT NULL,
  `tptypemin` varchar(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `paymentconditions`
--

CREATE TABLE `paymentconditions` (
  `id` int(10) UNSIGNED NOT NULL,
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `startdate` date DEFAULT NULL,
  `enddate` date DEFAULT NULL,
  `interval` smallint(5) UNSIGNED NOT NULL,
  `intervaltype` varchar(5) NOT NULL COMMENT 'DAY, WEEK, MONTH',
  `percentage` tinyint(3) UNSIGNED NOT NULL,
  `ispost` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `reqinvoice` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `paymentconditiontype_id` tinyint(3) UNSIGNED NOT NULL,
  `fit` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `group` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `paymentconditiontypes`
--

CREATE TABLE `paymentconditiontypes` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `label_name` varchar(50) NOT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL DEFAULT 255,
  `invert` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `invoice` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `paymenttypes`
--

CREATE TABLE `paymenttypes` (
  `id` tinyint(4) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pcms`
--

CREATE TABLE `pcms` (
  `id` int(11) UNSIGNED NOT NULL,
  `name` varchar(100) DEFAULT NULL,
  `traveldate` date DEFAULT NULL,
  `customer_id` smallint(5) UNSIGNED DEFAULT NULL,
  `agent_name` varchar(60) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pcm_details`
--

CREATE TABLE `pcm_details` (
  `id` int(11) UNSIGNED NOT NULL,
  `pcm_id` int(11) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `psl_id` int(11) UNSIGNED NOT NULL,
  `date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `day` smallint(6) DEFAULT NULL,
  `seq` smallint(6) DEFAULT NULL,
  `pickup_date` date DEFAULT NULL,
  `pickup_time` time DEFAULT NULL,
  `pickup_location` varchar(240) DEFAULT NULL,
  `dropoff_date` date DEFAULT NULL,
  `dropoff_time` time DEFAULT NULL,
  `dropoff_location` varchar(240) DEFAULT NULL,
  `sl_status` char(2) DEFAULT NULL,
  `optional` char(1) DEFAULT NULL,
  `pkg_pcm_id` int(11) DEFAULT NULL,
  `pkg_source` char(1) DEFAULT NULL,
  `osr_vtext` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ports`
--

CREATE TABLE `ports` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pri__pricecodes`
--

CREATE TABLE `pri__pricecodes` (
  `id` char(2) NOT NULL,
  `name` varchar(40) NOT NULL,
  `isoffer` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pri__pricecode_customers`
--

CREATE TABLE `pri__pricecode_customers` (
  `customer_id` smallint(5) UNSIGNED NOT NULL,
  `pricecode_id` char(2) NOT NULL,
  `position` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pri__priceperiods`
--

CREATE TABLE `pri__priceperiods` (
  `id` int(11) NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `pricecode_id` char(2) NOT NULL,
  `from` date NOT NULL,
  `to` date NOT NULL,
  `name` varchar(60) DEFAULT NULL,
  `season` varchar(60) DEFAULT NULL,
  `provision_id` char(1) NOT NULL,
  `minscu` int(11) DEFAULT NULL,
  `maxscu` int(11) DEFAULT NULL,
  `mon` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `tue` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `wed` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `thu` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `fri` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `sat` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `sun` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `currency_id` int(10) UNSIGNED NOT NULL,
  `public` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pri__priceperiodsalesdates`
--

CREATE TABLE `pri__priceperiodsalesdates` (
  `priceperiod_id` int(11) NOT NULL,
  `salefrom` date DEFAULT NULL,
  `saleto` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pri__priceperiodservices`
--

CREATE TABLE `pri__priceperiodservices` (
  `priceperiod_id` int(11) NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `comment` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pri__priceperiodshistory`
--

CREATE TABLE `pri__priceperiodshistory` (
  `priceperiod_id` int(11) NOT NULL,
  `date` datetime NOT NULL DEFAULT current_timestamp(),
  `iuser_id` smallint(5) UNSIGNED DEFAULT NULL,
  `enabled` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pri__priceperiodstayoffers`
--

CREATE TABLE `pri__priceperiodstayoffers` (
  `priceperiod_id` int(11) NOT NULL,
  `stay` smallint(5) UNSIGNED NOT NULL,
  `free` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pri__priceperiodtimeoffers`
--

CREATE TABLE `pri__priceperiodtimeoffers` (
  `priceperiod_id` int(11) NOT NULL,
  `quantity` smallint(5) UNSIGNED NOT NULL,
  `type` char(1) NOT NULL DEFAULT 'D'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pri__prices`
--

CREATE TABLE `pri__prices` (
  `priceperiod_id` int(11) NOT NULL,
  `position` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1-24 pax, 1-5 for extras, null for acc',
  `age_id` char(2) NOT NULL COMMENT 'AD=Adult, CH=Child, IN=Infant',
  `type_id` char(2) NOT NULL DEFAULT '-' COMMENT 'SS=Single, TW=Twin, TR=Triple, QU=Quadruple, AD=Additional',
  `price` decimal(19,4) NOT NULL,
  `isadditional` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `isextra` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pri__pricingruledetails`
--

CREATE TABLE `pri__pricingruledetails` (
  `id` int(11) UNSIGNED NOT NULL,
  `pricingrule_id` int(11) UNSIGNED NOT NULL,
  `servicefrom` date NOT NULL,
  `serviceto` date NOT NULL,
  `salefrom` date NOT NULL,
  `saleto` date NOT NULL,
  `percentage` decimal(8,4) NOT NULL,
  `rounding` varchar(1) NOT NULL,
  `roundingfactor` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pri__pricingrules`
--

CREATE TABLE `pri__pricingrules` (
  `id` int(11) UNSIGNED NOT NULL,
  `sequence` int(11) NOT NULL,
  `type` varchar(1) NOT NULL,
  `code` varchar(10) NOT NULL,
  `description` varchar(60) DEFAULT NULL,
  `location` varchar(3) DEFAULT NULL,
  `service` varchar(2) DEFAULT NULL,
  `supplier` varchar(6) DEFAULT NULL,
  `optioncode` varchar(6) DEFAULT NULL,
  `pricecode` varchar(2) DEFAULT NULL,
  `agent` varchar(6) DEFAULT NULL,
  `branch` varchar(2) DEFAULT NULL,
  `department` varchar(2) DEFAULT NULL,
  `levelname` varchar(60) DEFAULT NULL,
  `leveltext` varchar(1000) DEFAULT NULL,
  `applyTW` tinyint(4) DEFAULT NULL,
  `applySS` tinyint(4) DEFAULT NULL,
  `applyTR` tinyint(4) DEFAULT NULL,
  `applyQD` tinyint(4) DEFAULT NULL,
  `rateorigin` varchar(1) DEFAULT NULL,
  `rateplancode` varchar(20) DEFAULT NULL,
  `agentanalysis1` varchar(2) DEFAULT NULL,
  `agentanalysis2` varchar(2) DEFAULT NULL,
  `agentanalysis3` varchar(2) DEFAULT NULL,
  `agentanalysis4` varchar(2) DEFAULT NULL,
  `agentanalysis5` varchar(2) DEFAULT NULL,
  `agentanalysis6` varchar(2) DEFAULT NULL,
  `bkganalysis1` varchar(2) DEFAULT NULL,
  `bkganalysis2` varchar(2) DEFAULT NULL,
  `bkganalysis3` varchar(2) DEFAULT NULL,
  `bkganalysis4` varchar(2) DEFAULT NULL,
  `bkganalysis5` varchar(2) DEFAULT NULL,
  `bkganalysis6` varchar(2) DEFAULT NULL,
  `dbanalysis1` varchar(2) DEFAULT NULL,
  `dbanalysis2` varchar(2) DEFAULT NULL,
  `dbanalysis3` varchar(2) DEFAULT NULL,
  `dbanalysis4` varchar(2) DEFAULT NULL,
  `dbanalysis5` varchar(2) DEFAULT NULL,
  `dbanalysis6` varchar(2) DEFAULT NULL,
  `pcmanalysis1` varchar(2) DEFAULT NULL,
  `pcmanalysis2` varchar(2) DEFAULT NULL,
  `pcmanalysis3` varchar(2) DEFAULT NULL,
  `pcmanalysis4` varchar(2) DEFAULT NULL,
  `pcmanalysis5` varchar(2) DEFAULT NULL,
  `pcmanalysis6` varchar(2) DEFAULT NULL,
  `supplieranalysis1` varchar(2) DEFAULT NULL,
  `supplieranalysis2` varchar(2) DEFAULT NULL,
  `supplieranalysis3` varchar(2) DEFAULT NULL,
  `supplieranalysis4` varchar(2) DEFAULT NULL,
  `supplieranalysis5` varchar(2) DEFAULT NULL,
  `supplieranalysis6` varchar(2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pri__provisions`
--

CREATE TABLE `pri__provisions` (
  `id` char(1) NOT NULL,
  `label_name` varchar(50) DEFAULT NULL,
  `isprovisional` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `isclosed` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `ispricelist` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `productanalysis`
--

CREATE TABLE `productanalysis` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `analysis1` varchar(2) DEFAULT NULL,
  `analysis2` varchar(2) DEFAULT NULL,
  `analysis3` varchar(2) DEFAULT NULL,
  `analysis4` varchar(2) DEFAULT NULL,
  `analysis5` varchar(2) DEFAULT NULL,
  `analysis6` varchar(2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `productappcontentreviewed`
--

CREATE TABLE `productappcontentreviewed` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL,
  `user_id` smallint(5) UNSIGNED NOT NULL,
  `contenttype_id` tinyint(3) UNSIGNED NOT NULL,
  `changedat` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `productappenabled`
--

CREATE TABLE `productappenabled` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL,
  `user_id` smallint(5) UNSIGNED NOT NULL,
  `comment` varchar(250) NOT NULL,
  `changedat` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `enabled` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `productcontentposition`
--

CREATE TABLE `productcontentposition` (
  `content_id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `appcategory_id` smallint(5) UNSIGNED NOT NULL,
  `position` tinyint(2) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `productdestinations`
--

CREATE TABLE `productdestinations` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `country_id` tinyint(3) UNSIGNED NOT NULL,
  `region_id` smallint(5) UNSIGNED DEFAULT NULL,
  `location_id` smallint(5) UNSIGNED DEFAULT NULL,
  `locality_id` smallint(5) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `productdetails`
--

CREATE TABLE `productdetails` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `name` varchar(120) NOT NULL,
  `comment` varchar(120) DEFAULT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `productextradetails`
--

CREATE TABLE `productextradetails` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `name` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `productextras`
--

CREATE TABLE `productextras` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `position` tinyint(4) NOT NULL,
  `charge` char(1) NOT NULL DEFAULT 'P' COMMENT 'P=Pax, G=Group, S=SCU, F=FCU/SCU, R=Room, 0=Comp Pax, 1=Comp Pax Single, 2=Comp Group,3=Comp Group Single',
  `coding` varchar(60) NOT NULL DEFAULT '',
  `enabled` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `productoptions`
--

CREATE TABLE `productoptions` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `short` varchar(45) NOT NULL,
  `description` varchar(100) DEFAULT NULL,
  `defaultcheck` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `system` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `productpax`
--

CREATE TABLE `productpax` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `position` tinyint(4) NOT NULL,
  `from` smallint(6) NOT NULL DEFAULT 0,
  `to` smallint(6) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `id` int(10) UNSIGNED NOT NULL,
  `service_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `country_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `region_id` smallint(5) UNSIGNED DEFAULT NULL,
  `location_id` smallint(4) UNSIGNED DEFAULT NULL,
  `locality_id` smallint(4) UNSIGNED DEFAULT NULL,
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `opt_id` int(11) DEFAULT NULL,
  `code` char(6) DEFAULT NULL,
  `ac` char(1) NOT NULL COMMENT 'Y = Accomodation, A = Apartments, P = Package, I = Itinerary, N = Non-Accomodation, F = Manual Flight Service and \\" \\"',
  `fcu` char(6) DEFAULT NULL,
  `scu` char(6) DEFAULT NULL,
  `mpfcu` smallint(6) DEFAULT NULL,
  `periods` smallint(5) UNSIGNED NOT NULL,
  `periodbase` char(1) NOT NULL DEFAULT 'P' COMMENT 'P=24 hour Periods; D=Days',
  `classification` tinyint(4) DEFAULT NULL,
  `fitdefault` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `recommended` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `position` smallint(4) UNSIGNED DEFAULT NULL,
  `duration` smallint(5) UNSIGNED DEFAULT NULL COMMENT 'Depending on Service.\nIE: Packages in Nights, Transfers in Minutes\n',
  `crossseason` char(1) NOT NULL DEFAULT 'S' COMMENT 'A=Average, F=First, S=Split',
  `childpxb` tinyint(4) NOT NULL,
  `infantpxb` tinyint(4) NOT NULL,
  `seatin` tinyint(1) NOT NULL DEFAULT 0,
  `review` timestamp NULL DEFAULT NULL,
  `parent_id` int(10) UNSIGNED DEFAULT NULL,
  `tp_service_code` char(2) DEFAULT NULL,
  `message_code` char(2) DEFAULT NULL,
  `lc_enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `deleted` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `rooms` smallint(5) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `producttextcontent_history`
--

CREATE TABLE `producttextcontent_history` (
  `producttext_id` int(11) UNSIGNED NOT NULL,
  `catuser_id` smallint(5) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `text` longtext NOT NULL,
  `last_changed` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `producttext_contents`
--

CREATE TABLE `producttext_contents` (
  `producttext_id` int(11) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `text` longtext DEFAULT NULL,
  `updated` tinyint(1) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `product_additionalproducts`
--

CREATE TABLE `product_additionalproducts` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `addproduct_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `product_amenities`
--

CREATE TABLE `product_amenities` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `amenity_id` smallint(4) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `product_documents`
--

CREATE TABLE `product_documents` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `product_images`
--

CREATE TABLE `product_images` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `image_id` int(11) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `product_includedproducts`
--

CREATE TABLE `product_includedproducts` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `incproduct_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `product_media`
--

CREATE TABLE `product_media` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `template_id` int(10) UNSIGNED NOT NULL,
  `appmediatemplate_id` int(10) UNSIGNED NOT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `product_options`
--

CREATE TABLE `product_options` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `productoption_id` smallint(5) UNSIGNED NOT NULL,
  `active` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `product_tags`
--

CREATE TABLE `product_tags` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `tag_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `product_texts`
--

CREATE TABLE `product_texts` (
  `id` int(11) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(100) DEFAULT NULL,
  `description` varchar(250) DEFAULT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 0,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `is_lc` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `product_videos`
--

CREATE TABLE `product_videos` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `hd` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `language_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `parentmedia_id` int(10) UNSIGNED DEFAULT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `projects`
--

CREATE TABLE `projects` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `comment` varchar(255) NOT NULL,
  `iuser_id` smallint(5) UNSIGNED DEFAULT NULL,
  `parent_id` int(10) UNSIGNED DEFAULT NULL,
  `position` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `projecttemplates`
--

CREATE TABLE `projecttemplates` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `comment` varchar(255) DEFAULT NULL,
  `iuser_id` smallint(5) UNSIGNED DEFAULT NULL,
  `parent_id` int(10) UNSIGNED DEFAULT NULL,
  `project_id` int(10) UNSIGNED DEFAULT NULL,
  `position` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `projecttemplate_iusergroups`
--

CREATE TABLE `projecttemplate_iusergroups` (
  `projecttemplate_id` int(10) UNSIGNED NOT NULL,
  `iusergroup_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `projecttemplate_iusers`
--

CREATE TABLE `projecttemplate_iusers` (
  `projecttemplate_id` int(10) UNSIGNED NOT NULL,
  `iuser_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `project_bookings`
--

CREATE TABLE `project_bookings` (
  `project_id` int(10) UNSIGNED NOT NULL,
  `booking_id` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `booking_type` char(4) NOT NULL,
  `booking_no` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `project_contacts`
--

CREATE TABLE `project_contacts` (
  `project_id` int(10) UNSIGNED NOT NULL,
  `contact_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `project_iusergroups`
--

CREATE TABLE `project_iusergroups` (
  `project_id` int(10) UNSIGNED NOT NULL,
  `iusergroup_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `project_iusers`
--

CREATE TABLE `project_iusers` (
  `project_id` int(10) UNSIGNED NOT NULL,
  `iuser_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `referencedates`
--

CREATE TABLE `referencedates` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `rdate` date NOT NULL,
  `name` varchar(45) NOT NULL,
  `description` mediumtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ref__continentdetails`
--

CREATE TABLE `ref__continentdetails` (
  `ref__region_id` tinyint(3) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ref__continents`
--

CREATE TABLE `ref__continents` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ref__countries`
--

CREATE TABLE `ref__countries` (
  `id` int(10) UNSIGNED NOT NULL,
  `alpha_2` char(2) NOT NULL,
  `alpha_3` char(3) NOT NULL,
  `name` varchar(75) NOT NULL,
  `ref__region_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `ref__subregion_id` tinyint(3) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ref__countrydetails`
--

CREATE TABLE `ref__countrydetails` (
  `ref__country_id` int(10) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(75) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ref__country_currencies`
--

CREATE TABLE `ref__country_currencies` (
  `ref__country_id` int(10) UNSIGNED NOT NULL,
  `ref__currency_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ref__currencies`
--

CREATE TABLE `ref__currencies` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(80) NOT NULL,
  `code` char(3) NOT NULL,
  `minor` tinyint(4) NOT NULL,
  `symbol` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ref__datatypes`
--

CREATE TABLE `ref__datatypes` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(20) NOT NULL,
  `bytes` tinyint(3) UNSIGNED DEFAULT NULL,
  `isarray` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `named` tinyint(1) NOT NULL DEFAULT 0,
  `enumtype_ref` int(5) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ref__httpmethods`
--

CREATE TABLE `ref__httpmethods` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ref__subcontinentdetails`
--

CREATE TABLE `ref__subcontinentdetails` (
  `ref__subregion_id` tinyint(3) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(25) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ref__subcontinents`
--

CREATE TABLE `ref__subcontinents` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(25) NOT NULL,
  `ref__region_id` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ref__weekdays`
--

CREATE TABLE `ref__weekdays` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `label_name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `regionappcontentreviewed`
--

CREATE TABLE `regionappcontentreviewed` (
  `region_id` smallint(5) UNSIGNED NOT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL,
  `user_id` smallint(5) UNSIGNED NOT NULL,
  `contenttype_id` tinyint(3) UNSIGNED NOT NULL,
  `changedat` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `regionappenabled`
--

CREATE TABLE `regionappenabled` (
  `region_id` smallint(5) UNSIGNED NOT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL,
  `user_id` smallint(5) UNSIGNED NOT NULL,
  `comment` varchar(250) NOT NULL,
  `changedat` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `enabled` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `regioncontentposition`
--

CREATE TABLE `regioncontentposition` (
  `content_id` int(10) UNSIGNED NOT NULL,
  `region_id` smallint(5) UNSIGNED NOT NULL,
  `appcategory_id` smallint(5) UNSIGNED NOT NULL,
  `position` tinyint(2) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `regiondetails`
--

CREATE TABLE `regiondetails` (
  `region_id` smallint(5) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(45) NOT NULL,
  `nts_id` int(11) DEFAULT 0,
  `updated` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `regions`
--

CREATE TABLE `regions` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `country_id` tinyint(3) UNSIGNED NOT NULL,
  `code` char(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 0,
  `lc_enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `region_media`
--

CREATE TABLE `region_media` (
  `region_id` smallint(5) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `template_id` int(10) UNSIGNED NOT NULL,
  `appmediatemplate_id` int(10) UNSIGNED NOT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `region_tags`
--

CREATE TABLE `region_tags` (
  `region_id` smallint(5) UNSIGNED NOT NULL,
  `tag_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `region_videos`
--

CREATE TABLE `region_videos` (
  `region_id` smallint(5) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `hd` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `language_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `parentmedia_id` int(10) UNSIGNED DEFAULT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `replacement_products`
--

CREATE TABLE `replacement_products` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `rproduct_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `label_name` varchar(50) NOT NULL,
  `label_description` varchar(50) DEFAULT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `roles_iaccesses`
--

CREATE TABLE `roles_iaccesses` (
  `role_id` tinyint(3) UNSIGNED NOT NULL,
  `iaccess_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `roomconfigurationpaxs`
--

CREATE TABLE `roomconfigurationpaxs` (
  `roomconfiguration_id` int(11) UNSIGNED NOT NULL,
  `pax_id` int(11) UNSIGNED DEFAULT NULL,
  `type` varchar(2) NOT NULL,
  `qty` smallint(5) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `roomconfigurations`
--

CREATE TABLE `roomconfigurations` (
  `id` int(11) UNSIGNED NOT NULL,
  `bookingdetail_id` int(11) UNSIGNED DEFAULT NULL,
  `bsl_id` int(11) UNSIGNED DEFAULT NULL,
  `occupation` varchar(2) NOT NULL,
  `qty` smallint(5) UNSIGNED NOT NULL DEFAULT 1,
  `group` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `roompolicies`
--

CREATE TABLE `roompolicies` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `occupation_id` char(2) NOT NULL,
  `maxadults` tinyint(4) DEFAULT NULL,
  `maxtotal` tinyint(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `seasontypes`
--

CREATE TABLE `seasontypes` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `sea__public`
--

CREATE TABLE `sea__public` (
  `id` smallint(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `fromlocation_id` smallint(5) UNSIGNED DEFAULT NULL,
  `fromlocality_id` smallint(5) UNSIGNED DEFAULT NULL,
  `tolocation_id` smallint(5) UNSIGNED DEFAULT NULL,
  `tolocality_id` smallint(5) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `sea__public_apps`
--

CREATE TABLE `sea__public_apps` (
  `public_id` smallint(5) UNSIGNED NOT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `sea__public_languages`
--

CREATE TABLE `sea__public_languages` (
  `public_id` smallint(5) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `sea__related`
--

CREATE TABLE `sea__related` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `relproduct_id` int(10) UNSIGNED NOT NULL,
  `dmc_id` tinyint(3) UNSIGNED NOT NULL,
  `days` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `sea__statuses`
--

CREATE TABLE `sea__statuses` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `label_name` varchar(50) NOT NULL,
  `label_description` varchar(50) NOT NULL,
  `color` char(6) NOT NULL DEFAULT 'FFFFFF'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `sea__statusrules`
--

CREATE TABLE `sea__statusrules` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `status_id` tinyint(3) UNSIGNED NOT NULL,
  `available` varchar(10) DEFAULT NULL,
  `releasedays` varchar(25) DEFAULT NULL,
  `pax` varchar(10) DEFAULT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL DEFAULT 255
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `sections`
--

CREATE TABLE `sections` (
  `id` int(11) UNSIGNED NOT NULL,
  `booking_id` int(11) UNSIGNED DEFAULT NULL,
  `pcm_id` int(11) UNSIGNED DEFAULT NULL,
  `bookingdetail_id` int(11) UNSIGNED DEFAULT NULL,
  `pcmdetail_id` int(11) UNSIGNED DEFAULT NULL,
  `type` tinyint(3) UNSIGNED NOT NULL DEFAULT 1,
  `is_cover` tinyint(1) NOT NULL DEFAULT 0,
  `position` smallint(6) UNSIGNED NOT NULL DEFAULT 0,
  `day` smallint(5) NOT NULL DEFAULT 1,
  `pkg_id` int(11) UNSIGNED DEFAULT NULL,
  `pkg_section_id` int(11) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `section_imagedetail`
--

CREATE TABLE `section_imagedetail` (
  `id` int(11) UNSIGNED NOT NULL,
  `section_id` int(11) UNSIGNED NOT NULL,
  `image_id` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `position` smallint(5) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `section_otherdetail`
--

CREATE TABLE `section_otherdetail` (
  `id` int(11) UNSIGNED NOT NULL,
  `section_id` int(11) UNSIGNED NOT NULL,
  `text_id` int(11) UNSIGNED NOT NULL DEFAULT 0,
  `position` smallint(5) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `section_productdetail`
--

CREATE TABLE `section_productdetail` (
  `id` int(11) UNSIGNED NOT NULL,
  `section_id` int(11) UNSIGNED NOT NULL,
  `product_id` smallint(6) UNSIGNED NOT NULL,
  `text_id` int(11) UNSIGNED NOT NULL DEFAULT 0,
  `position` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
  `supp_text_id` int(11) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `section_services`
--

CREATE TABLE `section_services` (
  `id` int(11) UNSIGNED NOT NULL,
  `section_id` int(11) UNSIGNED NOT NULL,
  `position` smallint(5) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='In this table grouping additional services and included services. (tables section_services and section_servicesdetail)';

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

--
-- Table structure for table `section_servicesdetail`
--

CREATE TABLE `section_servicesdetail` (
  `section_services_id` int(11) UNSIGNED NOT NULL,
  `product_id` smallint(6) UNSIGNED NOT NULL,
  `text_id` int(11) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `serviceanalysis`
--

CREATE TABLE `serviceanalysis` (
  `service_id` tinyint(3) UNSIGNED NOT NULL,
  `productanalysis1` varchar(2) DEFAULT NULL,
  `productanalysis2` varchar(2) DEFAULT NULL,
  `productanalysis3` varchar(2) DEFAULT NULL,
  `productanalysis4` varchar(2) DEFAULT NULL,
  `productanalysis5` varchar(2) DEFAULT NULL,
  `productanalysis6` varchar(2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `servicecodes`
--

CREATE TABLE `servicecodes` (
  `code` char(2) NOT NULL,
  `name` varchar(40) DEFAULT NULL,
  `service_id` tinyint(3) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `servicedetails`
--

CREATE TABLE `servicedetails` (
  `service_id` tinyint(3) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(45) NOT NULL,
  `description` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `serviceoptions`
--

CREATE TABLE `serviceoptions` (
  `id` int(10) UNSIGNED NOT NULL,
  `short` varchar(45) NOT NULL,
  `description` varchar(100) DEFAULT NULL,
  `defaultcheck` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `system` tinyint(1) UNSIGNED DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `services`
--

CREATE TABLE `services` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `parentid` tinyint(3) UNSIGNED DEFAULT NULL,
  `icon` varchar(255) DEFAULT NULL,
  `image` varchar(255) DEFAULT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 1,
  `lite` tinyint(1) NOT NULL DEFAULT 0,
  `supplier` tinyint(1) NOT NULL DEFAULT 1,
  `comment` tinyint(1) NOT NULL DEFAULT 0,
  `ifsupplier` tinyint(1) NOT NULL DEFAULT 0,
  `color` char(6) NOT NULL DEFAULT '000000',
  `addservice` tinyint(1) UNSIGNED NOT NULL,
  `inclservice` tinyint(1) UNSIGNED NOT NULL,
  `ispickup` tinyint(1) UNSIGNED NOT NULL,
  `isdropoff` tinyint(1) UNSIGNED NOT NULL,
  `position` tinyint(3) UNSIGNED DEFAULT NULL,
  `tripdesc_grouped_srv_day` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `tripdesc_main_srv` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `tripdesc_grouped_srv_doc` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `isroute` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `bakudetailpage` varchar(100) DEFAULT NULL,
  `mpfcu` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `service_bakusections`
--

CREATE TABLE `service_bakusections` (
  `service_id` tinyint(3) UNSIGNED NOT NULL,
  `bakusection_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `service_options`
--

CREATE TABLE `service_options` (
  `service_id` tinyint(3) UNSIGNED NOT NULL,
  `serviceoption_id` int(10) UNSIGNED NOT NULL,
  `active` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ser__series`
--

CREATE TABLE `ser__series` (
  `id` int(10) UNSIGNED NOT NULL,
  `pcm_id` int(10) UNSIGNED NOT NULL,
  `customer_id` smallint(5) UNSIGNED NOT NULL,
  `iuser_id` smallint(5) UNSIGNED NOT NULL,
  `iusergroup_id` smallint(5) UNSIGNED DEFAULT NULL,
  `name` varchar(45) NOT NULL,
  `datefirst` date NOT NULL,
  `datelast` date NOT NULL,
  `weekday` tinyint(3) UNSIGNED NOT NULL COMMENT '0=Monday, 1=Tuesday, 2=Wednesday, 3=Thursday, 4=Friday, 5=Saturday, 6=Sunday',
  `frequency` tinyint(3) UNSIGNED NOT NULL,
  `frequencytype` varchar(4) NOT NULL DEFAULT 'DAY' COMMENT 'DAY or WEEK',
  `rooms` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `hasdriver` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `hasguide` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `hastourlead` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `releasedays` smallint(5) UNSIGNED NOT NULL,
  `autorelease` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `code` varchar(45) DEFAULT NULL,
  `paxmin` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `paxmax` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ser__seriesdetail_allotments`
--

CREATE TABLE `ser__seriesdetail_allotments` (
  `id` int(10) UNSIGNED NOT NULL,
  `seriesdetail_id` int(10) UNSIGNED NOT NULL,
  `allotment_id` int(10) UNSIGNED NOT NULL,
  `linked` tinyint(1) NOT NULL DEFAULT 1,
  `tocancel` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ser__seriesgroupdetails`
--

CREATE TABLE `ser__seriesgroupdetails` (
  `id` int(10) UNSIGNED NOT NULL,
  `seriesgroup_id` int(10) UNSIGNED NOT NULL,
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED DEFAULT NULL,
  `pcmdetail_id` int(10) UNSIGNED DEFAULT NULL,
  `bookingdetail_id` int(10) UNSIGNED DEFAULT NULL,
  `startdate` date NOT NULL,
  `enddate` date NOT NULL,
  `rooms` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
  `comment` varchar(255) DEFAULT NULL,
  `guide` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `driver` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `escort` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ser__seriesgroupdetailsales`
--

CREATE TABLE `ser__seriesgroupdetailsales` (
  `seriesgroupdetail_id` int(10) UNSIGNED NOT NULL,
  `occupations_id` char(2) NOT NULL,
  `quantity` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ser__seriesgroups`
--

CREATE TABLE `ser__seriesgroups` (
  `id` int(10) UNSIGNED NOT NULL,
  `serial_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(50) NOT NULL,
  `postfix` varchar(5) DEFAULT NULL,
  `position` smallint(5) UNSIGNED NOT NULL,
  `startdate` date NOT NULL,
  `pcm_id` int(10) UNSIGNED DEFAULT NULL,
  `booking_id` int(10) UNSIGNED DEFAULT NULL,
  `canceled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `paxmin` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `paxmax` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `reference` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ser__seriesgroup_bookingfilters`
--

CREATE TABLE `ser__seriesgroup_bookingfilters` (
  `seriesgroup_id` int(10) UNSIGNED NOT NULL,
  `booking_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ser__seriesgroup_bookings`
--

CREATE TABLE `ser__seriesgroup_bookings` (
  `seriesgroup_id` int(10) UNSIGNED NOT NULL,
  `booking_id` int(10) UNSIGNED NOT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ser__seriessupplieralts`
--

CREATE TABLE `ser__seriessupplieralts` (
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `altsupplier_id` smallint(5) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED DEFAULT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `session_data`
--

CREATE TABLE `session_data` (
  `session_id` varchar(32) NOT NULL DEFAULT '',
  `hash` varchar(32) NOT NULL DEFAULT '',
  `session_data` blob NOT NULL,
  `session_expire` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `key` varchar(20) NOT NULL,
  `value` varchar(255) NOT NULL,
  `settingstype_id` tinyint(3) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `settingtypes`
--

CREATE TABLE `settingtypes` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `socialmedia`
--

CREATE TABLE `socialmedia` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `contact_id` int(10) UNSIGNED NOT NULL,
  `socialmediatype_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `socialmediatypes`
--

CREATE TABLE `socialmediatypes` (
  `id` int(10) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL,
  `icon` varchar(40) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `sst_bookingdetailstatuses`
--

CREATE TABLE `sst_bookingdetailstatuses` (
  `bookingdetailstatus_id` tinyint(3) UNSIGNED NOT NULL,
  `tp__sst_code` char(2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supplieranalysis`
--

CREATE TABLE `supplieranalysis` (
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `analysis1` varchar(2) DEFAULT NULL,
  `analysis2` varchar(2) DEFAULT NULL,
  `analysis3` varchar(2) DEFAULT NULL,
  `analysis4` varchar(2) DEFAULT NULL,
  `analysis5` varchar(2) DEFAULT NULL,
  `analysis6` varchar(2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supplierappcontentreviewed`
--

CREATE TABLE `supplierappcontentreviewed` (
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL,
  `user_id` smallint(5) UNSIGNED NOT NULL,
  `contenttype_id` tinyint(3) UNSIGNED NOT NULL,
  `changedat` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supplierappenabled`
--

CREATE TABLE `supplierappenabled` (
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL,
  `user_id` smallint(5) UNSIGNED NOT NULL,
  `comment` varchar(250) NOT NULL,
  `changedat` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `enabled` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supplierbanks`
--

CREATE TABLE `supplierbanks` (
  `id` int(10) UNSIGNED NOT NULL,
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `bank_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `iban` varchar(34) DEFAULT NULL,
  `owner` varchar(60) DEFAULT NULL,
  `identification` varchar(30) DEFAULT NULL,
  `identificationtype_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `currency_id` char(3) DEFAULT NULL,
  `pos` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL,
  `deleterequest` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `created` timestamp NULL DEFAULT current_timestamp(),
  `updated` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supplierchanges`
--

CREATE TABLE `supplierchanges` (
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `name` varchar(100) DEFAULT NULL,
  `address` varchar(100) DEFAULT NULL,
  `legalname` varchar(100) DEFAULT NULL,
  `taxname` varchar(100) DEFAULT NULL,
  `created` timestamp NULL DEFAULT current_timestamp(),
  `updated` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `suppliercontactroles`
--

CREATE TABLE `suppliercontactroles` (
  `id` int(10) UNSIGNED NOT NULL,
  `contact_id` int(10) UNSIGNED NOT NULL,
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `contactrole_id` smallint(5) UNSIGNED DEFAULT NULL,
  `pbk_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'id from PBK table in Tourplan db'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `suppliercontactrole_contactemails`
--

CREATE TABLE `suppliercontactrole_contactemails` (
  `suppliercontactrole_id` int(10) UNSIGNED NOT NULL,
  `contactemail_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `suppliercontactrole_contactphones`
--

CREATE TABLE `suppliercontactrole_contactphones` (
  `suppliercontactrole_id` int(10) UNSIGNED NOT NULL,
  `contactphone_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `suppliercontentposition`
--

CREATE TABLE `suppliercontentposition` (
  `content_id` int(10) UNSIGNED NOT NULL,
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `appcategory_id` smallint(5) UNSIGNED NOT NULL,
  `position` tinyint(2) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supplieroptions`
--

CREATE TABLE `supplieroptions` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `short` varchar(45) NOT NULL,
  `description` varchar(100) DEFAULT NULL,
  `defaultcheck` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `system` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supplierpricefiles`
--

CREATE TABLE `supplierpricefiles` (
  `id` int(10) UNSIGNED NOT NULL,
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `name` varchar(250) NOT NULL,
  `extension` varchar(5) NOT NULL,
  `created` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `suppliers`
--

CREATE TABLE `suppliers` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `crm_id` int(10) UNSIGNED DEFAULT NULL,
  `code` char(6) DEFAULT NULL,
  `service_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `name` varchar(100) NOT NULL,
  `legalname` varchar(100) DEFAULT NULL,
  `classification` tinyint(4) DEFAULT NULL,
  `recommended` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `available` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `country_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `region_id` smallint(5) UNSIGNED DEFAULT NULL,
  `location_id` smallint(4) DEFAULT NULL,
  `locality_id` smallint(4) DEFAULT NULL,
  `modified` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `lc_enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `deleted` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `tp_service_code` char(2) DEFAULT NULL,
  `address` varchar(100) NOT NULL DEFAULT '',
  `taxname` varchar(100) DEFAULT NULL,
  `rooms` smallint(5) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `suppliers_restrictedmarkets`
--

CREATE TABLE `suppliers_restrictedmarkets` (
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `ref__country_id` int(10) UNSIGNED NOT NULL,
  `non` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `suppliertextcontent_history`
--

CREATE TABLE `suppliertextcontent_history` (
  `suppliertext_id` int(11) UNSIGNED NOT NULL,
  `catuser_id` smallint(5) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `text` longtext NOT NULL,
  `last_changed` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `suppliertext_contents`
--

CREATE TABLE `suppliertext_contents` (
  `suppliertext_id` int(11) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `text` longtext DEFAULT NULL,
  `updated` tinyint(1) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supplier_access`
--

CREATE TABLE `supplier_access` (
  `supplier_id` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
  `ara_Transportista` varchar(60) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supplier_amenities`
--

CREATE TABLE `supplier_amenities` (
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `amenity_id` smallint(4) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supplier_amenitychanges`
--

CREATE TABLE `supplier_amenitychanges` (
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `amenity_id` smallint(4) UNSIGNED NOT NULL,
  `type` tinyint(4) NOT NULL,
  `created` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supplier_documents`
--

CREATE TABLE `supplier_documents` (
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supplier_images`
--

CREATE TABLE `supplier_images` (
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `image_id` int(11) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supplier_media`
--

CREATE TABLE `supplier_media` (
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `template_id` int(10) UNSIGNED NOT NULL,
  `appmediatemplate_id` int(10) UNSIGNED NOT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supplier_mediareview`
--

CREATE TABLE `supplier_mediareview` (
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `deleted` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `created` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supplier_options`
--

CREATE TABLE `supplier_options` (
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `supplieroption_id` smallint(5) UNSIGNED NOT NULL,
  `active` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supplier_tags`
--

CREATE TABLE `supplier_tags` (
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `tag_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supplier_texts`
--

CREATE TABLE `supplier_texts` (
  `id` int(11) UNSIGNED NOT NULL,
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `name` varchar(100) DEFAULT NULL,
  `description` varchar(250) DEFAULT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 0,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `is_lc` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supplier_videos`
--

CREATE TABLE `supplier_videos` (
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL,
  `hd` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `language_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `parentmedia_id` int(10) UNSIGNED DEFAULT NULL,
  `app_id` smallint(5) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `taskcomments`
--

CREATE TABLE `taskcomments` (
  `task_id` int(10) UNSIGNED NOT NULL,
  `posted` timestamp NOT NULL DEFAULT current_timestamp(),
  `iuser_id` smallint(5) UNSIGNED NOT NULL,
  `comment` mediumtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tasks`
--

CREATE TABLE `tasks` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `comment` varchar(255) DEFAULT NULL,
  `completed` timestamp NULL DEFAULT NULL,
  `duedate` date DEFAULT NULL,
  `iuser_id` smallint(5) UNSIGNED DEFAULT NULL,
  `iusergroup_id` smallint(5) UNSIGNED DEFAULT NULL,
  `project_id` int(10) UNSIGNED DEFAULT NULL,
  `parent_id` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tasktemplates`
--

CREATE TABLE `tasktemplates` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `comment` varchar(255) DEFAULT NULL,
  `completed` timestamp NULL DEFAULT NULL,
  `duedate` smallint(6) DEFAULT NULL,
  `iuser_id` smallint(5) UNSIGNED DEFAULT NULL,
  `iusergroup_id` smallint(5) UNSIGNED DEFAULT NULL,
  `projecttemplate_id` int(10) UNSIGNED DEFAULT NULL,
  `parent_id` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `task_bookings`
--

CREATE TABLE `task_bookings` (
  `task_id` int(10) UNSIGNED NOT NULL,
  `booking_id` int(10) UNSIGNED NOT NULL,
  `booking_type` char(4) NOT NULL,
  `booking_no` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `task_contacts`
--

CREATE TABLE `task_contacts` (
  `task_id` int(10) UNSIGNED NOT NULL,
  `contact_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `templates`
--

CREATE TABLE `templates` (
  `id` int(11) NOT NULL,
  `name` varchar(45) NOT NULL,
  `is_default` tinyint(1) UNSIGNED DEFAULT NULL,
  `cover_title_font_size` tinyint(1) UNSIGNED DEFAULT NULL,
  `cover_desc_font_size` tinyint(1) UNSIGNED DEFAULT NULL,
  `day_title_font_size` tinyint(1) UNSIGNED DEFAULT NULL,
  `srv_title_font_size` tinyint(1) UNSIGNED DEFAULT NULL,
  `srv_desc_font_size` tinyint(1) UNSIGNED DEFAULT NULL,
  `cover_title_font_color` varchar(6) DEFAULT '000000',
  `day_title_font_color` varchar(6) DEFAULT '000000',
  `srv_title_font_color` varchar(6) DEFAULT '000000',
  `desc_font_color` varchar(6) DEFAULT '000000',
  `cover_header_img_id` int(11) UNSIGNED DEFAULT NULL,
  `header_img_id` int(11) UNSIGNED DEFAULT NULL,
  `footer_img_id` int(11) UNSIGNED DEFAULT NULL,
  `header_img_pos` varchar(1) DEFAULT 'L'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `termdetails`
--

CREATE TABLE `termdetails` (
  `term_id` smallint(5) UNSIGNED NOT NULL,
  `language_id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(100) NOT NULL,
  `description` mediumtext NOT NULL,
  `comment` mediumtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `terms`
--

CREATE TABLE `terms` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `termtype_id` tinyint(3) UNSIGNED NOT NULL,
  `validfrom` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `termtypes`
--

CREATE TABLE `termtypes` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(40) NOT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL,
  `istransporter` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tpbkdetailchanges`
--

CREATE TABLE `tpbkdetailchanges` (
  `bookingdetail_id` int(10) UNSIGNED NOT NULL,
  `changed` timestamp NOT NULL DEFAULT current_timestamp(),
  `reviewed` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `notified` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `data` mediumtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tpnotecategories`
--

CREATE TABLE `tpnotecategories` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `code` char(3) NOT NULL,
  `description` varchar(30) NOT NULL,
  `category_type` char(2) NOT NULL,
  `language_id` tinyint(4) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tpnotecategories_appcategories`
--

CREATE TABLE `tpnotecategories_appcategories` (
  `notecategory_id` smallint(5) UNSIGNED NOT NULL,
  `appcategory_id` smallint(5) UNSIGNED NOT NULL,
  `main` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tpproductservice_appcategories`
--

CREATE TABLE `tpproductservice_appcategories` (
  `service_id` tinyint(3) UNSIGNED NOT NULL,
  `appcategory_id` smallint(5) UNSIGNED NOT NULL,
  `main` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tpsupplierservice_appcategories`
--

CREATE TABLE `tpsupplierservice_appcategories` (
  `service_id` tinyint(3) UNSIGNED NOT NULL,
  `appcategory_id` smallint(5) UNSIGNED NOT NULL,
  `main` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tpsyncdetails`
--

CREATE TABLE `tpsyncdetails` (
  `tpsynch_id` tinyint(3) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `name` varchar(45) NOT NULL,
  `description` varchar(250) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tpsynclogs`
--

CREATE TABLE `tpsynclogs` (
  `tpsync_id` tinyint(3) UNSIGNED NOT NULL,
  `synched` datetime DEFAULT NULL,
  `attempted` datetime NOT NULL,
  `message` longtext DEFAULT NULL,
  `failed` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tpsyncs`
--

CREATE TABLE `tpsyncs` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tp__allocations`
--

CREATE TABLE `tp__allocations` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `code` char(15) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tp__allocations_products`
--

CREATE TABLE `tp__allocations_products` (
  `product_id` int(10) UNSIGNED NOT NULL,
  `allocation_id` smallint(5) UNSIGNED NOT NULL,
  `adate` date NOT NULL,
  `maximum` smallint(6) NOT NULL,
  `booked` smallint(6) NOT NULL,
  `release` smallint(6) NOT NULL,
  `syncheck` tinyint(4) NOT NULL,
  `paxno` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `changed` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tp__allocation_customers`
--

CREATE TABLE `tp__allocation_customers` (
  `allocation_id` smallint(5) UNSIGNED NOT NULL,
  `customer_id` smallint(5) UNSIGNED NOT NULL,
  `position` tinyint(4) NOT NULL,
  `syncheck` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tp__cancelationpolicies`
--

CREATE TABLE `tp__cancelationpolicies` (
  `id` int(10) UNSIGNED NOT NULL,
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED DEFAULT NULL,
  `datefrom` date NOT NULL,
  `dateto` date NOT NULL,
  `service_code` char(2) DEFAULT NULL,
  `messageformatcode` char(2) DEFAULT NULL,
  `serviceanalysis1` char(2) DEFAULT NULL,
  `serviceanalysis2` char(2) DEFAULT NULL,
  `serviceanalysis3` char(2) DEFAULT NULL,
  `serviceanalysis4` char(2) DEFAULT NULL,
  `serviceanalysis5` char(2) DEFAULT NULL,
  `serviceanalysis6` char(2) DEFAULT NULL,
  `applymarkup` char(1) NOT NULL COMMENT 'S=Service, N=None, P=Percentage, M=MatrixLookup',
  `markuppc` decimal(12,4) NOT NULL,
  `applycommission` char(1) NOT NULL COMMENT 'S=Service, N=None, P=Percentage, M=MatrixLookup',
  `commissionpc` decimal(12,4) NOT NULL,
  `invoice_text1` varchar(60) DEFAULT NULL,
  `invoice_text2` varchar(60) DEFAULT NULL,
  `invoice_text3` varchar(60) DEFAULT NULL,
  `invoice_text4` varchar(60) DEFAULT NULL,
  `applies_ext` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `booking_type` char(1) NOT NULL DEFAULT 'A' COMMENT 'A=All, F=FITonly, G=Group',
  `external_fees` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='POL';

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

--
-- Table structure for table `tp__cancelationpolicydetails`
--

CREATE TABLE `tp__cancelationpolicydetails` (
  `id` int(10) UNSIGNED NOT NULL,
  `period` int(10) UNSIGNED NOT NULL,
  `feetype` char(1) NOT NULL COMMENT 'P=Percentage, F=First Nights, X=FixedAmount, L=LastNight, A=PerNightAverage',
  `feeamount` decimal(16,4) NOT NULL,
  `displayindays` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `pol_id` int(10) UNSIGNED NOT NULL,
  `applies_from` date DEFAULT NULL,
  `min_scu` smallint(5) UNSIGNED NOT NULL DEFAULT 1,
  `max_scu` smallint(5) UNSIGNED DEFAULT NULL,
  `min_rooms` smallint(5) UNSIGNED NOT NULL DEFAULT 1,
  `max_rooms` smallint(5) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='RUL';

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

--
-- Table structure for table `tp__customeranalysis`
--

CREATE TABLE `tp__customeranalysis` (
  `code` char(2) NOT NULL,
  `description` varchar(60) NOT NULL,
  `type` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='DA1-6';

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

--
-- Table structure for table `tp__messagetypes`
--

CREATE TABLE `tp__messagetypes` (
  `code` char(2) NOT NULL,
  `description` varchar(60) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='MTY';

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

--
-- Table structure for table `tp__pcmanalysis`
--

CREATE TABLE `tp__pcmanalysis` (
  `code` char(2) NOT NULL,
  `description` varchar(60) NOT NULL,
  `type` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='PC1-6';

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

--
-- Table structure for table `tp__productanalysis`
--

CREATE TABLE `tp__productanalysis` (
  `code` char(2) NOT NULL,
  `description` varchar(60) NOT NULL,
  `type` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='DB1-6';

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

--
-- Table structure for table `tp__salesanalysis`
--

CREATE TABLE `tp__salesanalysis` (
  `code` char(2) NOT NULL,
  `description` varchar(60) NOT NULL,
  `type` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='SA1-6';

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

--
-- Table structure for table `tp__services`
--

CREATE TABLE `tp__services` (
  `code` char(2) NOT NULL,
  `name` varchar(60) NOT NULL,
  `message_code` char(2) DEFAULT NULL,
  `button` int(10) UNSIGNED NOT NULL,
  `analysis1` char(2) DEFAULT NULL,
  `analysis2` char(2) DEFAULT NULL,
  `analysis3` char(2) DEFAULT NULL,
  `analysis4` char(2) DEFAULT NULL,
  `analysis5` char(2) DEFAULT NULL,
  `analysis6` char(2) DEFAULT NULL,
  `hasendlocation` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `service_id` tinyint(3) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='SRV';

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

--
-- Table structure for table `tp__sst`
--

CREATE TABLE `tp__sst` (
  `code` char(2) NOT NULL,
  `description` varchar(20) NOT NULL,
  `tripdesc` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `baku` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `voucher` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `cost` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `fortotal` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `bookable` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tp__supplieranalysis`
--

CREATE TABLE `tp__supplieranalysis` (
  `code` char(2) NOT NULL,
  `description` varchar(60) NOT NULL,
  `type` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='CA1-6';

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

--
-- Table structure for table `tp__tst`
--

CREATE TABLE `tp__tst` (
  `code` char(2) NOT NULL,
  `description` varchar(20) NOT NULL,
  `voucher` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `transportbookings`
--

CREATE TABLE `transportbookings` (
  `id` int(10) UNSIGNED NOT NULL,
  `transporter_id` smallint(5) UNSIGNED DEFAULT NULL,
  `vehicle_id` smallint(5) UNSIGNED DEFAULT NULL,
  `driver_id` smallint(5) UNSIGNED DEFAULT NULL,
  `pickupdate` date NOT NULL,
  `pickuptime` time NOT NULL DEFAULT '00:00:00',
  `dropoffdate` date NOT NULL,
  `dropofftime` time NOT NULL DEFAULT '00:00:00',
  `bookingtype_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `bookingstatus_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `pickuplocationnote` varchar(240) DEFAULT NULL,
  `dropofflocationnote` varchar(240) DEFAULT NULL,
  `transportstatus_id` tinyint(3) UNSIGNED NOT NULL DEFAULT 1,
  `mailerqueue_id` int(10) UNSIGNED DEFAULT NULL,
  `uuid` binary(16) DEFAULT NULL,
  `number` tinyint(3) UNSIGNED DEFAULT NULL,
  `comment` mediumtext DEFAULT NULL,
  `airportguide_id` smallint(5) UNSIGNED DEFAULT NULL,
  `guide_id` smallint(5) UNSIGNED DEFAULT NULL,
  `vehiclemodel_id` smallint(5) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `transportbooking_bookingdetails`
--

CREATE TABLE `transportbooking_bookingdetails` (
  `transportbooking_id` int(10) UNSIGNED NOT NULL,
  `bookingdetail_id` int(11) UNSIGNED NOT NULL,
  `canceled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Canceled in TP'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `transporters`
--

CREATE TABLE `transporters` (
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `hasvehicles` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `isregional` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `hasextranet` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `accessname` varchar(60) DEFAULT NULL,
  `position` smallint(5) UNSIGNED NOT NULL DEFAULT 254
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `transporter_consuppliers`
--

CREATE TABLE `transporter_consuppliers` (
  `transporter_id` smallint(5) UNSIGNED NOT NULL,
  `supplier_id` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `transporthandlers`
--

CREATE TABLE `transporthandlers` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `supplier_id` smallint(5) UNSIGNED NOT NULL,
  `name` varchar(3) NOT NULL,
  `description` varchar(45) NOT NULL,
  `position` tinyint(4) NOT NULL DEFAULT 0,
  `default` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `transportreservations`
--

CREATE TABLE `transportreservations` (
  `id` int(10) UNSIGNED NOT NULL,
  `transportbooking_id` int(10) UNSIGNED NOT NULL,
  `transporter_id` smallint(5) UNSIGNED NOT NULL,
  `transportstatus_id` tinyint(3) UNSIGNED DEFAULT 5,
  `uuid` binary(16) DEFAULT NULL,
  `confirmation` varchar(25) DEFAULT NULL,
  `changed` timestamp NOT NULL DEFAULT current_timestamp(),
  `mailerqueue_id` int(10) UNSIGNED DEFAULT NULL,
  `reason` mediumtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `transportstatusdetails`
--

CREATE TABLE `transportstatusdetails` (
  `transportstatus_id` tinyint(3) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `description` varchar(55) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `transportstatuses`
--

CREATE TABLE `transportstatuses` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL,
  `color` varchar(6) NOT NULL DEFAULT 'ffffff',
  `complist` tinyint(1) UNSIGNED NOT NULL,
  `compalert` tinyint(1) UNSIGNED NOT NULL,
  `condalert` tinyint(1) UNSIGNED NOT NULL,
  `notify` tinyint(1) UNSIGNED NOT NULL,
  `complete` tinyint(1) UNSIGNED NOT NULL,
  `purledit` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `next_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `position` tinyint(3) UNSIGNED NOT NULL DEFAULT 255
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tst_bookingstatuses`
--

CREATE TABLE `tst_bookingstatuses` (
  `bookingstatus_id` tinyint(3) UNSIGNED NOT NULL,
  `tp__tst_code` char(2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `urlparameters`
--

CREATE TABLE `urlparameters` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `parameter` varchar(10) NOT NULL,
  `url` varchar(255) NOT NULL,
  `ispublic` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `vehicleblocks`
--

CREATE TABLE `vehicleblocks` (
  `id` int(10) UNSIGNED NOT NULL,
  `vehicle_id` smallint(5) UNSIGNED NOT NULL,
  `start` date DEFAULT NULL,
  `end` date DEFAULT NULL,
  `comment` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `vehiclebrands`
--

CREATE TABLE `vehiclebrands` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `name` varchar(45) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `vehicledocuments`
--

CREATE TABLE `vehicledocuments` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(50) NOT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp(),
  `vehicledocumenttype_id` tinyint(3) UNSIGNED DEFAULT NULL,
  `uuid` char(36) NOT NULL,
  `extension` varchar(6) NOT NULL,
  `expiration` date DEFAULT NULL,
  `vehicle_id` smallint(5) UNSIGNED NOT NULL,
  `description` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `vehicledocumenttypes`
--

CREATE TABLE `vehicledocumenttypes` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `required` tinyint(1) UNSIGNED NOT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL,
  `label_name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `vehiclemodels`
--

CREATE TABLE `vehiclemodels` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `vehiclebrand_id` smallint(5) UNSIGNED NOT NULL,
  `vehicletype_id` smallint(5) UNSIGNED DEFAULT NULL,
  `name` varchar(45) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `vehiclenotemessages`
--

CREATE TABLE `vehiclenotemessages` (
  `vehiclenote_id` int(10) UNSIGNED NOT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp(),
  `message` mediumtext NOT NULL,
  `isread` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `iuser_id` smallint(5) UNSIGNED DEFAULT NULL,
  `exuser_id` smallint(5) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `vehiclenotes`
--

CREATE TABLE `vehiclenotes` (
  `id` int(10) UNSIGNED NOT NULL,
  `vehicle_id` smallint(5) UNSIGNED NOT NULL,
  `subject` varchar(255) NOT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp(),
  `vehiclenotestatus_id` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `vehiclenotestatuses`
--

CREATE TABLE `vehiclenotestatuses` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `ilabel_name` varchar(50) NOT NULL,
  `exlabel_name` varchar(50) NOT NULL,
  `ipriority` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `expriority` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `vehicleoptiondetails`
--

CREATE TABLE `vehicleoptiondetails` (
  `vehicleoption_id` tinyint(3) UNSIGNED NOT NULL,
  `language_id` tinyint(4) UNSIGNED NOT NULL,
  `description` varchar(55) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `vehicleoptions`
--

CREATE TABLE `vehicleoptions` (
  `id` tinyint(3) UNSIGNED NOT NULL,
  `label_name` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `vehicles`
--

CREATE TABLE `vehicles` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `transporter_id` smallint(5) UNSIGNED NOT NULL,
  `vehiclemodel_id` smallint(5) UNSIGNED NOT NULL,
  `luggagesolution_id` tinyint(3) UNSIGNED NOT NULL,
  `plate` varchar(15) NOT NULL,
  `permit` date DEFAULT NULL,
  `insurance` date DEFAULT NULL,
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  `year` smallint(4) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `vehicletypes`
--

CREATE TABLE `vehicletypes` (
  `id` smallint(5) UNSIGNED NOT NULL,
  `paxmin` tinyint(3) UNSIGNED NOT NULL,
  `paxmax` tinyint(3) UNSIGNED NOT NULL,
  `name` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `vehicle_media`
--

CREATE TABLE `vehicle_media` (
  `vehicle_id` smallint(5) UNSIGNED NOT NULL,
  `media_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `vehicle_options`
--

CREATE TABLE `vehicle_options` (
  `vehicle_id` smallint(5) UNSIGNED NOT NULL,
  `vehicleoptions_id` tinyint(3) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Structure for view `dmcs`
--
DROP TABLE IF EXISTS `dmcs`;

CREATE ALGORITHM=UNDEFINED DEFINER=`latincon`@`localhost` SQL SECURITY DEFINER VIEW `dmcs`  AS SELECT `latincon_api_d`.`dmcs`.`id` AS `id`, `latincon_api_d`.`dmcs`.`name` AS `name`, `latincon_api_d`.`dmcs`.`dmsdbhost` AS `dmsdbhost`, `latincon_api_d`.`dmcs`.`dmsdbname` AS `dmsdbname`, `latincon_api_d`.`dmcs`.`dmsdbuser` AS `dmsdbuser`, `latincon_api_d`.`dmcs`.`dmsdbpass` AS `dmsdbpass`, `latincon_api_d`.`dmcs`.`memdbhost` AS `memdbhost`, `latincon_api_d`.`dmcs`.`memdbname` AS `memdbname`, `latincon_api_d`.`dmcs`.`memdbuser` AS `memdbuser`, `latincon_api_d`.`dmcs`.`memdbpass` AS `memdbpass`, `latincon_api_d`.`dmcs`.`enabled` AS `enabled` FROM `latincon_api_d`.`dmcs` ;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `agepolicies`
--
ALTER TABLE `agepolicies`
  ADD PRIMARY KEY (`product_id`,`age_id`),
  ADD KEY `age_id` (`age_id`);

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

--
-- Indexes for table `airportguides`
--
ALTER TABLE `airportguides`
  ADD PRIMARY KEY (`id`),
  ADD KEY `contact_id` (`contact_id`);

--
-- Indexes for table `alldates`
--
ALTER TABLE `alldates`
  ADD PRIMARY KEY (`date`);

--
-- Indexes for table `all__allotmentdetails`
--
ALTER TABLE `all__allotmentdetails`
  ADD PRIMARY KEY (`id`),
  ADD KEY `allotment_id` (`allotment_id`) USING BTREE,
  ADD KEY `allotmentdetails_ibfk_2` (`product_id`);

--
-- Indexes for table `all__allotmentdocuments`
--
ALTER TABLE `all__allotmentdocuments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `allotment_id` (`allotment_id`);

--
-- Indexes for table `all__allotmentmails`
--
ALTER TABLE `all__allotmentmails`
  ADD PRIMARY KEY (`allotment_id`,`mailerqueue_id`),
  ADD KEY `mailerqueue_id` (`mailerqueue_id`);

--
-- Indexes for table `all__allotments`
--
ALTER TABLE `all__allotments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `supplier_id` (`supplier_id`);

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

--
-- Indexes for table `all__allotmentstatusoptions`
--
ALTER TABLE `all__allotmentstatusoptions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `short` (`short`);

--
-- Indexes for table `all__allotmentstatus_options`
--
ALTER TABLE `all__allotmentstatus_options`
  ADD PRIMARY KEY (`allotmentstatus_id`,`allotmentstatusoption_id`),
  ADD KEY `allotmentstatusoption_id` (`allotmentstatusoption_id`);

--
-- Indexes for table `all__allotmentupdates`
--
ALTER TABLE `all__allotmentupdates`
  ADD KEY `allotmentdetail_id` (`allotmentdetail_id`),
  ADD KEY `status` (`status`);

--
-- Indexes for table `all__mailtemplates`
--
ALTER TABLE `all__mailtemplates`
  ADD PRIMARY KEY (`mailertemplate_id`);

--
-- Indexes for table `amenities`
--
ALTER TABLE `amenities`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `code_UNIQUE` (`code`),
  ADD KEY `amenitycategory_id` (`amenitycategory_id`);

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

--
-- Indexes for table `amenitycategorydetails`
--
ALTER TABLE `amenitycategorydetails`
  ADD PRIMARY KEY (`amenitycategory_id`,`language_id`),
  ADD KEY `fk_amecategory_idx` (`language_id`);

--
-- Indexes for table `amenitydetails`
--
ALTER TABLE `amenitydetails`
  ADD PRIMARY KEY (`amenity_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `appcategories`
--
ALTER TABLE `appcategories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `application_id` (`app_id`),
  ADD KEY `appcat_typeFK_idx` (`appcategorytype_id`),
  ADD KEY `appcategorysection_id` (`appcategorysection_id`);

--
-- Indexes for table `appcategories_tpnotecategories`
--
ALTER TABLE `appcategories_tpnotecategories`
  ADD PRIMARY KEY (`appcategory_id`,`tpnotecategory_id`,`language_id`),
  ADD KEY `tpnotecategory_id` (`tpnotecategory_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `appcategorydetails`
--
ALTER TABLE `appcategorydetails`
  ADD PRIMARY KEY (`appcat_id`,`language_id`),
  ADD KEY `appcat_langs` (`language_id`);

--
-- Indexes for table `appcategoryframeworks`
--
ALTER TABLE `appcategoryframeworks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_appid_idx` (`app_id`),
  ADD KEY `fk_appcategorytype_idx` (`appcategorytype_id`);

--
-- Indexes for table `appcategoryframework_appcategories`
--
ALTER TABLE `appcategoryframework_appcategories`
  ADD PRIMARY KEY (`appcategoryframework_id`,`appcategory_id`),
  ADD KEY `fk_appcategoryid_idx` (`appcategory_id`);

--
-- Indexes for table `appcategorysections`
--
ALTER TABLE `appcategorysections`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_app_idx` (`app_id`);

--
-- Indexes for table `appcategorytypedetails`
--
ALTER TABLE `appcategorytypedetails`
  ADD PRIMARY KEY (`appcategorytype_id`,`language_id`),
  ADD KEY `languageFK` (`language_id`);

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

--
-- Indexes for table `appcategory_content`
--
ALTER TABLE `appcategory_content`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `appcategory_id_2` (`appcategory_id`,`content_id`),
  ADD KEY `content_id` (`content_id`),
  ADD KEY `appcategory_id` (`appcategory_id`) USING BTREE;

--
-- Indexes for table `appcategory_services`
--
ALTER TABLE `appcategory_services`
  ADD PRIMARY KEY (`appcategory_id`,`service_id`),
  ADD KEY `service_id` (`service_id`);

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

--
-- Indexes for table `app_media`
--
ALTER TABLE `app_media`
  ADD PRIMARY KEY (`app_id`,`media_id`);

--
-- Indexes for table `app_mediatemplates`
--
ALTER TABLE `app_mediatemplates`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `app_id` (`app_id`,`mediatemplate_id`);

--
-- Indexes for table `bakuarticlecollectiondetails`
--
ALTER TABLE `bakuarticlecollectiondetails`
  ADD PRIMARY KEY (`id`),
  ADD KEY `Fk_BakuArticleCollectionId_idx` (`bakuarticlecollection_id`),
  ADD KEY `Fk_BakuSectionId_idx` (`bakusection_id`),
  ADD KEY `Fk_ContentId_idx` (`content_id`);

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

--
-- Indexes for table `bakucontentdetails`
--
ALTER TABLE `bakucontentdetails`
  ADD PRIMARY KEY (`bakucontent_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `bakucontents`
--
ALTER TABLE `bakucontents`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `bakudate_id` (`bakudate_id`,`supplier_id`,`product_id`,`location_id`,`bakuversion_id`,`position`) USING BTREE,
  ADD KEY `bakuversion_id` (`bakuversion_id`);

--
-- Indexes for table `bakucontent_media`
--
ALTER TABLE `bakucontent_media`
  ADD PRIMARY KEY (`bakucontent_id`,`media_id`,`template_id`) USING BTREE,
  ADD KEY `bakucontent_media_ibfk_2` (`appmediatemplate_id`);

--
-- Indexes for table `bakudategps`
--
ALTER TABLE `bakudategps`
  ADD PRIMARY KEY (`id`),
  ADD KEY `bakudate_id` (`bakudate_id`),
  ADD KEY `gps_id` (`gps_id`);

--
-- Indexes for table `bakudategpsdetails`
--
ALTER TABLE `bakudategpsdetails`
  ADD PRIMARY KEY (`bakudategps_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `bakudates`
--
ALTER TABLE `bakudates`
  ADD PRIMARY KEY (`id`),
  ADD KEY `bakuversion_id` (`bakuversion_id`);

--
-- Indexes for table `bakudetails`
--
ALTER TABLE `bakudetails`
  ADD PRIMARY KEY (`id`),
  ADD KEY `bakuversion_id` (`bakuversion_id`),
  ADD KEY `pcmdetails_pcmdetpslFK` (`psl_id`),
  ADD KEY `bakudetails_locFK` (`location_id`),
  ADD KEY `bakudetails_prdFK` (`product_id`),
  ADD KEY `pcmdetails_pcmdetIdFK` (`pcmdetail_id`),
  ADD KEY `bakudetails_bookdetbslFK` (`bsl_id`),
  ADD KEY `bakudetails_suppFK` (`supplier_id`),
  ADD KEY `bakudetails_bookdetIdFk` (`bookingdetail_id`);

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

--
-- Indexes for table `bakus`
--
ALTER TABLE `bakus`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uuid` (`uuid`) USING BTREE,
  ADD KEY `bakus_customersFK` (`customer_id`),
  ADD KEY `bakus_iusersFK_idx` (`iuser_id`),
  ADD KEY `bakustatus_id` (`bakustatus_id`);

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

--
-- Indexes for table `bakusectioncategorydetails`
--
ALTER TABLE `bakusectioncategorydetails`
  ADD PRIMARY KEY (`bakusectioncategory_id`,`language_id`),
  ADD KEY `FkLanguageId_idx` (`language_id`);

--
-- Indexes for table `bakusectiondetails`
--
ALTER TABLE `bakusectiondetails`
  ADD PRIMARY KEY (`bakusection_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `bakusections`
--
ALTER TABLE `bakusections`
  ADD PRIMARY KEY (`id`),
  ADD KEY `FK_sectionCategoryId_idx` (`sectioncategory_id`);

--
-- Indexes for table `bakusection_appcategories`
--
ALTER TABLE `bakusection_appcategories`
  ADD PRIMARY KEY (`bakusection_id`,`appcategory_id`),
  ADD KEY `appcategory_id` (`appcategory_id`);

--
-- Indexes for table `bakusection_services`
--
ALTER TABLE `bakusection_services`
  ADD PRIMARY KEY (`bakusection_id`,`service_id`),
  ADD KEY `bakusectsrv_srvFK` (`service_id`);

--
-- Indexes for table `bakusection_statuses`
--
ALTER TABLE `bakusection_statuses`
  ADD PRIMARY KEY (`bakusection_id`,`bakustatus_id`),
  ADD KEY `bakustatus_id` (`bakustatus_id`);

--
-- Indexes for table `bakustatusdetails`
--
ALTER TABLE `bakustatusdetails`
  ADD PRIMARY KEY (`bakustatus_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `bakustatuses`
--
ALTER TABLE `bakustatuses`
  ADD PRIMARY KEY (`id`),
  ADD KEY `bakusection_id` (`bakusection_id`);

--
-- Indexes for table `bakuversionmediaquotedetails`
--
ALTER TABLE `bakuversionmediaquotedetails`
  ADD PRIMARY KEY (`bakuversionmediaquote_id`,`language_id`);

--
-- Indexes for table `bakuversions`
--
ALTER TABLE `bakuversions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `baku_id` (`baku_id`);

--
-- Indexes for table `bakuversions_media`
--
ALTER TABLE `bakuversions_media`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `bakuversion_id` (`bakuversion_id`,`media_id`);

--
-- Indexes for table `bakuversions_mediaquotes`
--
ALTER TABLE `bakuversions_mediaquotes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `bakuversions_media_id` (`bakuversions_media_id`),
  ADD KEY `bakuversions_contIdFK` (`content_id`);

--
-- Indexes for table `bakuversion_bookings`
--
ALTER TABLE `bakuversion_bookings`
  ADD UNIQUE KEY `bakuversion_id` (`bakuversion_id`,`booking_id`,`pcm_id`),
  ADD KEY `bakuversionbookings_pcmFK` (`pcm_id`),
  ADD KEY `bakuversionbookings_bookingFK` (`booking_id`);

--
-- Indexes for table `bakuversion_sections`
--
ALTER TABLE `bakuversion_sections`
  ADD PRIMARY KEY (`bakuversion_id`,`bakusection_id`,`optional`),
  ADD KEY `fk_bkusection_idx` (`bakusection_id`);

--
-- Indexes for table `baku_articles`
--
ALTER TABLE `baku_articles`
  ADD PRIMARY KEY (`baku_id`,`bakusection_id`),
  ADD KEY `FkBakuSectionId_idx` (`bakusection_id`);

--
-- Indexes for table `bankaccounts`
--
ALTER TABLE `bankaccounts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_bankaccount_bank1_idx` (`bank_id`),
  ADD KEY `fk_bankaccount_paymenttype1_idx` (`paymenttype_id`),
  ADD KEY `fk_bankaccount_idnumbertype1_idx` (`identificationtype_id`),
  ADD KEY `fk_bankaccount_currencies1_idx` (`currency_id`);

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

--
-- Indexes for table `be__booking`
--
ALTER TABLE `be__booking`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `full_reference_UNIQUE` (`full_reference`),
  ADD KEY `booking_id` (`booking_id`),
  ADD KEY `itineraries_ibfk_1_idx` (`createdby`),
  ADD KEY `be_booking_ibfk_3_idx` (`customer_id`),
  ADD KEY `be_booking_ibfk_4_idx` (`updatedby`);

--
-- Indexes for table `be__bookingdetails`
--
ALTER TABLE `be__bookingdetails`
  ADD PRIMARY KEY (`id`),
  ADD KEY `booking_id` (`booking_id`),
  ADD KEY `bookingdetail_id` (`bookingdetail_id`),
  ADD KEY `product_id` (`product_id`),
  ADD KEY `itinerarydetails_ibfk_4_idx` (`updatedby`),
  ADD KEY `itinerarydetails_ibfk_5_idx` (`createdby`),
  ADD KEY `foreignKey_bkdetstatus_idx` (`statusid`);

--
-- Indexes for table `be__externalreservation`
--
ALTER TABLE `be__externalreservation`
  ADD PRIMARY KEY (`id`),
  ADD KEY `foreignKey_channel_idx` (`channel_id`),
  ADD KEY `foreignKey_user_idx` (`createdby`),
  ADD KEY `foreignKey_bkdets_idx` (`bookingdetail_id`),
  ADD KEY `bslid_dx` (`bsl_id`),
  ADD KEY `roomconfig_idx` (`roomconfiguration_id`),
  ADD KEY `foreignKey_bkdetstatus_idx` (`statusid`);

--
-- Indexes for table `bookingdetailsconfig`
--
ALTER TABLE `bookingdetailsconfig`
  ADD PRIMARY KEY (`bsl_id`);

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

--
-- Indexes for table `bookingdetailstatusoptions`
--
ALTER TABLE `bookingdetailstatusoptions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `short` (`short`);

--
-- Indexes for table `bookingdetailstatus_options`
--
ALTER TABLE `bookingdetailstatus_options`
  ADD PRIMARY KEY (`bookingdetailstatus_id`,`bookingdetailstatusoption_id`),
  ADD KEY `bookingdetailstatusoption_id` (`bookingdetailstatusoption_id`);

--
-- Indexes for table `bookingdetail_pax`
--
ALTER TABLE `bookingdetail_pax`
  ADD KEY `pax_bkd_idx` (`bookingdetail_bsl`),
  ADD KEY `pax_pax_idx` (`pax_id`);

--
-- Indexes for table `bookings`
--
ALTER TABLE `bookings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `full_reference_UNIQUE` (`full_reference`);

--
-- Indexes for table `bookingstatusdetails`
--
ALTER TABLE `bookingstatusdetails`
  ADD PRIMARY KEY (`bookingstatus_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

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

--
-- Indexes for table `bookingstatusoptions`
--
ALTER TABLE `bookingstatusoptions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `short` (`short`);

--
-- Indexes for table `bookingstatus_options`
--
ALTER TABLE `bookingstatus_options`
  ADD PRIMARY KEY (`bookingstatus_id`,`bookingstatusoption_id`),
  ADD KEY `bookingstatusoption_id` (`bookingstatusoption_id`);

--
-- Indexes for table `bookingtypedetails`
--
ALTER TABLE `bookingtypedetails`
  ADD PRIMARY KEY (`bookingtype_id`,`language_id`),
  ADD KEY `bookingtype_id` (`bookingtype_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `bookingtypes`
--
ALTER TABLE `bookingtypes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `service_id` (`service_id`);

--
-- Indexes for table `booking_details`
--
ALTER TABLE `booking_details`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `bsl_id_UNIQUE` (`bsl_id`),
  ADD KEY `bkdet_prd_idx` (`product_id`),
  ADD KEY `bkdet_bk_idx` (`booking_id`),
  ADD KEY `date` (`date`),
  ADD KEY `end_date` (`end_date`);

--
-- Indexes for table `changelogdetails`
--
ALTER TABLE `changelogdetails`
  ADD KEY `changelog_id` (`changelog_id`);

--
-- Indexes for table `changelogs`
--
ALTER TABLE `changelogs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `iuser_id` (`iuser_id`) USING BTREE,
  ADD KEY `changelogs_ibfk_2` (`exuser_id`);

--
-- Indexes for table `chn__api_request_params`
--
ALTER TABLE `chn__api_request_params`
  ADD PRIMARY KEY (`id`),
  ADD KEY `datatype_id` (`datatype_id`),
  ADD KEY `operation_id` (`operation_id`);

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

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

--
-- Indexes for table `chn__conditional_output_values`
--
ALTER TABLE `chn__conditional_output_values`
  ADD PRIMARY KEY (`id`) USING BTREE,
  ADD KEY `comparisonoperator_id` (`comparisonoperator_id`),
  ADD KEY `customoutput_id` (`customoutput_id`);

--
-- Indexes for table `chn__conditional_stdoutput_values`
--
ALTER TABLE `chn__conditional_stdoutput_values`
  ADD PRIMARY KEY (`id`),
  ADD KEY `comparisonoperator_id` (`comparisonoperator_id`),
  ADD KEY `request_id` (`request_id`),
  ADD KEY `stdoutput_id` (`stdoutput_id`);

--
-- Indexes for table `chn__custom_header`
--
ALTER TABLE `chn__custom_header`
  ADD PRIMARY KEY (`id`),
  ADD KEY `child_header` (`parent_header`),
  ADD KEY `header_param` (`header_param`);

--
-- Indexes for table `chn__custom_output`
--
ALTER TABLE `chn__custom_output`
  ADD PRIMARY KEY (`id`),
  ADD KEY `output_id` (`output_id`),
  ADD KEY `reference_id` (`reference_id`),
  ADD KEY `response_id` (`response_id`),
  ADD KEY `request_id` (`request_id`),
  ADD KEY `filter_node_id` (`filter_node_id`),
  ADD KEY `array_property_to_filter` (`array_property_to_filter`),
  ADD KEY `property_to_match` (`property_to_match`);

--
-- Indexes for table `chn__custom_standardoutput`
--
ALTER TABLE `chn__custom_standardoutput`
  ADD PRIMARY KEY (`id`),
  ADD KEY `standardoutput_id` (`standardoutput_id`),
  ADD KEY `reference_id` (`reference_id`),
  ADD KEY `response_id` (`response_id`),
  ADD KEY `request_id` (`request_id`),
  ADD KEY `filter_node_id` (`filter_node_id`),
  ADD KEY `array_property_to_filter` (`array_property_to_filter`),
  ADD KEY `property_to_match` (`property_to_match`);

--
-- Indexes for table `chn__filterresponse`
--
ALTER TABLE `chn__filterresponse`
  ADD PRIMARY KEY (`id`),
  ADD KEY `comparisonoperator_id` (`comparisonoperator_id`),
  ADD KEY `response_id` (`response_id`);

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

--
-- Indexes for table `chn__inputformat`
--
ALTER TABLE `chn__inputformat`
  ADD PRIMARY KEY (`id`),
  ADD KEY `operation_id` (`operation_id`),
  ADD KEY `datatype_id` (`datatype_id`);

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

--
-- Indexes for table `chn__operations`
--
ALTER TABLE `chn__operations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `label_id` (`name`);

--
-- Indexes for table `chn__operation_requests`
--
ALTER TABLE `chn__operation_requests`
  ADD PRIMARY KEY (`operation_id`,`request_id`),
  ADD KEY `operation_id` (`operation_id`),
  ADD KEY `request_id` (`request_id`),
  ADD KEY `operation_id_loopedcount` (`operation_id_loopedcount`);

--
-- Indexes for table `chn__output`
--
ALTER TABLE `chn__output`
  ADD PRIMARY KEY (`id`),
  ADD KEY `operation_id` (`operation_id`),
  ADD KEY `datatype_id` (`datatype_id`);

--
-- Indexes for table `chn__output_fn`
--
ALTER TABLE `chn__output_fn`
  ADD PRIMARY KEY (`id`),
  ADD KEY `output_id` (`output_id`),
  ADD KEY `operation_id` (`operation_id`,`request_id`);

--
-- Indexes for table `chn__output_fn_params`
--
ALTER TABLE `chn__output_fn_params`
  ADD PRIMARY KEY (`id`),
  ADD KEY `outputfn_id` (`outputfn_id`),
  ADD KEY `chn__output_fn_params_ibfk_2` (`responseparam_id`);

--
-- Indexes for table `chn__parameters`
--
ALTER TABLE `chn__parameters`
  ADD PRIMARY KEY (`id`),
  ADD KEY `chn__parameters_ibfk_1` (`request_id`),
  ADD KEY `datatypeout_id` (`datatypeout_id`),
  ADD KEY `inputformat_id` (`inputformat_id`);

--
-- Indexes for table `chn__productmap`
--
ALTER TABLE `chn__productmap`
  ADD UNIQUE KEY `channel_id` (`channel_id`,`product_id`,`id`,`code`,`rateid`),
  ADD KEY `product_id` (`product_id`);

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

--
-- Indexes for table `chn__requests`
--
ALTER TABLE `chn__requests`
  ADD PRIMARY KEY (`id`),
  ADD KEY `url_id` (`url_id`),
  ADD KEY `chn__requests_ibfk_2` (`httpmethod_id`);

--
-- Indexes for table `chn__responses`
--
ALTER TABLE `chn__responses`
  ADD PRIMARY KEY (`id`),
  ADD KEY `request_id` (`request_id`),
  ADD KEY `datatypein_id` (`datatype_id`);

--
-- Indexes for table `chn__standardoutput`
--
ALTER TABLE `chn__standardoutput`
  ADD PRIMARY KEY (`id`),
  ADD KEY `operation_id` (`operation_id`),
  ADD KEY `datatype_id` (`datatype_id`);

--
-- Indexes for table `chn__stdoutput_fn`
--
ALTER TABLE `chn__stdoutput_fn`
  ADD PRIMARY KEY (`id`),
  ADD KEY `stdoutput_id` (`stdoutput_id`),
  ADD KEY `request_id` (`request_id`);

--
-- Indexes for table `chn__stdoutput_fn_params`
--
ALTER TABLE `chn__stdoutput_fn_params`
  ADD PRIMARY KEY (`id`),
  ADD KEY `responseparam_id` (`responseparam_id`),
  ADD KEY `stdoutputfn_id` (`stdoutputfn_id`);

--
-- Indexes for table `chn__successcriteria`
--
ALTER TABLE `chn__successcriteria`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `response_id` (`response_id`,`comparisonoperator_id`),
  ADD KEY `comparisonoperator_id` (`comparisonoperator_id`);

--
-- Indexes for table `chn__suppliermap`
--
ALTER TABLE `chn__suppliermap`
  ADD PRIMARY KEY (`channel_id`,`supplier_id`),
  ADD UNIQUE KEY `channel_id` (`channel_id`,`id`,`code`,`supplier_id`) USING BTREE,
  ADD KEY `supplier_id` (`supplier_id`);

--
-- Indexes for table `chn__urls`
--
ALTER TABLE `chn__urls`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_chn__home_urls_chn__apis1_idx` (`channel_id`);

--
-- Indexes for table `contactaddresses`
--
ALTER TABLE `contactaddresses`
  ADD PRIMARY KEY (`id`),
  ADD KEY `contact_id` (`contact_id`),
  ADD KEY `contacttype_id` (`contacttype_id`),
  ADD KEY `contactcountries_id` (`contactcountries_id`);

--
-- Indexes for table `contactcompanies`
--
ALTER TABLE `contactcompanies`
  ADD PRIMARY KEY (`contacts_id`);

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

--
-- Indexes for table `contactcountrydetails`
--
ALTER TABLE `contactcountrydetails`
  ADD PRIMARY KEY (`contactcountry_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `contactemails`
--
ALTER TABLE `contactemails`
  ADD PRIMARY KEY (`id`),
  ADD KEY `contact_id` (`contact_id`),
  ADD KEY `contacttype_id` (`contacttype_id`),
  ADD KEY `emailaddress` (`emailaddress`) USING BTREE,
  ADD KEY `defaultemail` (`defaultemail`);

--
-- Indexes for table `contactpersons`
--
ALTER TABLE `contactpersons`
  ADD PRIMARY KEY (`contacts_id`);

--
-- Indexes for table `contactphones`
--
ALTER TABLE `contactphones`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `contact_id_2` (`contact_id`,`number`,`extension`),
  ADD KEY `contact_id` (`contact_id`),
  ADD KEY `contacttype_id` (`contacttype_id`);

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

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

--
-- Indexes for table `contacttypes`
--
ALTER TABLE `contacttypes`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `label_name` (`label_name`),
  ADD KEY `label_name_2` (`label_name`);

--
-- Indexes for table `contentcond`
--
ALTER TABLE `contentcond`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `content_id_UNIQUE` (`content_id`),
  ADD KEY `content_id` (`content_id`);

--
-- Indexes for table `contentconddaterange`
--
ALTER TABLE `contentconddaterange`
  ADD KEY `contentcond_id` (`contentcond_id`);

--
-- Indexes for table `contentcond_customers`
--
ALTER TABLE `contentcond_customers`
  ADD PRIMARY KEY (`contentcond_id`,`customer_id`);

--
-- Indexes for table `contentcond_markets`
--
ALTER TABLE `contentcond_markets`
  ADD PRIMARY KEY (`contentcond_id`,`referencecountry_id`),
  ADD KEY `contentcond_markets_ibfk_2_idx` (`referencecountry_id`);

--
-- Indexes for table `contentcond_priceperiods`
--
ALTER TABLE `contentcond_priceperiods`
  ADD PRIMARY KEY (`contentcond_id`,`priceperiod_id`);

--
-- Indexes for table `contentdetailhistory`
--
ALTER TABLE `contentdetailhistory`
  ADD PRIMARY KEY (`id`),
  ADD KEY `iuser_id` (`iuser_id`),
  ADD KEY `contentdetailhistory_ibfk_1` (`content_id`),
  ADD KEY `contentdetailhistory_AppFK` (`app_id`);

--
-- Indexes for table `contentdetails`
--
ALTER TABLE `contentdetails`
  ADD PRIMARY KEY (`content_id`,`language_id`),
  ADD KEY `contentdet_user_idx` (`reviewedby`);
ALTER TABLE `contentdetails` ADD FULLTEXT KEY `content_name` (`name`);
ALTER TABLE `contentdetails` ADD FULLTEXT KEY `content_desc` (`description`);
ALTER TABLE `contentdetails` ADD FULLTEXT KEY `description` (`description`);

--
-- Indexes for table `contents`
--
ALTER TABLE `contents`
  ADD PRIMARY KEY (`id`),
  ADD KEY `contentParentFk_idx` (`parent_id`),
  ADD KEY `contentUser_idx` (`createdby`);

--
-- Indexes for table `contenttypes`
--
ALTER TABLE `contenttypes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `lblNameidx` (`label_name`);

--
-- Indexes for table `content_countries`
--
ALTER TABLE `content_countries`
  ADD PRIMARY KEY (`content_id`,`country_id`),
  ADD KEY `ctrcontsCountryFk` (`country_id`),
  ADD KEY `ctrcontsContentFk` (`content_id`);

--
-- Indexes for table `content_customers`
--
ALTER TABLE `content_customers`
  ADD PRIMARY KEY (`content_id`,`customer_id`),
  ADD KEY `cus_contstFk2_idx` (`customer_id`);

--
-- Indexes for table `content_localities`
--
ALTER TABLE `content_localities`
  ADD PRIMARY KEY (`content_id`,`locality_id`),
  ADD KEY `lolcontslocalityFk` (`locality_id`),
  ADD KEY `lolcontsContentFk` (`content_id`);

--
-- Indexes for table `content_locations`
--
ALTER TABLE `content_locations`
  ADD PRIMARY KEY (`content_id`,`location_id`),
  ADD KEY `loccontsLocationFk` (`location_id`),
  ADD KEY `loccontsContentFk` (`content_id`);

--
-- Indexes for table `content_media`
--
ALTER TABLE `content_media`
  ADD PRIMARY KEY (`content_id`,`media_id`);

--
-- Indexes for table `content_products`
--
ALTER TABLE `content_products`
  ADD PRIMARY KEY (`content_id`,`product_id`),
  ADD KEY `prdcontsProductFk` (`product_id`),
  ADD KEY `prdcontsContentFk` (`content_id`);

--
-- Indexes for table `content_regions`
--
ALTER TABLE `content_regions`
  ADD PRIMARY KEY (`content_id`,`region_id`),
  ADD KEY `regcontsRegionFk` (`region_id`),
  ADD KEY `regcontsContentFk` (`content_id`);

--
-- Indexes for table `content_suppliers`
--
ALTER TABLE `content_suppliers`
  ADD PRIMARY KEY (`content_id`,`supplier_id`),
  ADD KEY `suppcontsSupplierFk` (`supplier_id`),
  ADD KEY `suppcontsContentFk` (`content_id`);

--
-- Indexes for table `content_tags`
--
ALTER TABLE `content_tags`
  ADD PRIMARY KEY (`content_id`,`tag_id`);

--
-- Indexes for table `contracts`
--
ALTER TABLE `contracts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `supplier_id` (`supplier_id`),
  ADD KEY `contractstatus_id` (`contractstatus_id`),
  ADD KEY `contracttype_id` (`contracttype_id`),
  ADD KEY `contact_id` (`contact_id`),
  ADD KEY `pricecode_id` (`pricecode_id`);

--
-- Indexes for table `contractstatuses`
--
ALTER TABLE `contractstatuses`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_contractstatuses_labels1_idx` (`label_name`);

--
-- Indexes for table `contracttypes`
--
ALTER TABLE `contracttypes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_contracttypes_labels1_idx` (`labels_name`);

--
-- Indexes for table `countries`
--
ALTER TABLE `countries`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `code` (`code`);

--
-- Indexes for table `countryappcontentreviewed`
--
ALTER TABLE `countryappcontentreviewed`
  ADD PRIMARY KEY (`country_id`,`app_id`,`contenttype_id`),
  ADD KEY `fk_app_ctrappcontreview_idx` (`app_id`),
  ADD KEY `fk_user_ctrappcontreview_idx` (`user_id`),
  ADD KEY `fk_type_ctrappcontreview_idx` (`contenttype_id`);

--
-- Indexes for table `countryappenabled`
--
ALTER TABLE `countryappenabled`
  ADD PRIMARY KEY (`country_id`,`app_id`),
  ADD KEY `fk_app_ctrappena_idx` (`app_id`),
  ADD KEY `fk_user_ctrappena_idx` (`user_id`);

--
-- Indexes for table `countrycontentposition`
--
ALTER TABLE `countrycontentposition`
  ADD PRIMARY KEY (`content_id`,`country_id`,`appcategory_id`),
  ADD KEY `appcategory_id` (`appcategory_id`),
  ADD KEY `country_id` (`country_id`);

--
-- Indexes for table `countrydetails`
--
ALTER TABLE `countrydetails`
  ADD PRIMARY KEY (`country_id`,`language_id`),
  ADD KEY `FK_country_id_idx` (`country_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `country_media`
--
ALTER TABLE `country_media`
  ADD PRIMARY KEY (`country_id`,`media_id`,`template_id`),
  ADD KEY `media_id` (`media_id`),
  ADD KEY `appmediatemplate_id` (`appmediatemplate_id`);

--
-- Indexes for table `country_tags`
--
ALTER TABLE `country_tags`
  ADD PRIMARY KEY (`country_id`,`tag_id`),
  ADD KEY `tag_id` (`tag_id`);

--
-- Indexes for table `country_videos`
--
ALTER TABLE `country_videos`
  ADD PRIMARY KEY (`country_id`,`media_id`,`app_id`) USING BTREE,
  ADD KEY `language_id` (`language_id`),
  ADD KEY `media_id` (`media_id`),
  ADD KEY `country_videos_ibfk_4` (`app_id`);

--
-- Indexes for table `currencies`
--
ALTER TABLE `currencies`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `number` (`number`);

--
-- Indexes for table `currencyrates`
--
ALTER TABLE `currencyrates`
  ADD KEY `fromcurrencyid_currencies` (`fromcurrency_id`),
  ADD KEY `tocurrencyid_currencies` (`tocurrency_id`);

--
-- Indexes for table `customeranalysis`
--
ALTER TABLE `customeranalysis`
  ADD PRIMARY KEY (`customer_id`),
  ADD KEY `customeranalysis1` (`analysis1`),
  ADD KEY `customeranalysis2` (`analysis2`),
  ADD KEY `customeranalysis3` (`analysis3`),
  ADD KEY `customeranalysis4` (`analysis4`),
  ADD KEY `customeranalysis5` (`analysis5`),
  ADD KEY `customeranalysis6` (`analysis6`);

--
-- Indexes for table `customeroptions`
--
ALTER TABLE `customeroptions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `short` (`short`);

--
-- Indexes for table `customers`
--
ALTER TABLE `customers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `code_UNIQUE` (`code`),
  ADD KEY `lcustomer_id` (`lccustomer_id`),
  ADD KEY `drm_id` (`drm_id`),
  ADD KEY `fk_country_idx` (`ref__country_id`);

--
-- Indexes for table `customer_exclusiveproducts`
--
ALTER TABLE `customer_exclusiveproducts`
  ADD PRIMARY KEY (`customer_id`,`product_id`),
  ADD KEY `product_id` (`product_id`);

--
-- Indexes for table `customer_options`
--
ALTER TABLE `customer_options`
  ADD PRIMARY KEY (`customer_id`,`customeroption_id`),
  ADD KEY `customeroption_id` (`customeroption_id`);

--
-- Indexes for table `driverdocuments`
--
ALTER TABLE `driverdocuments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `driverdocumenttype_id` (`driverdocumenttype_id`),
  ADD KEY `driver_id` (`driver_id`);

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

--
-- Indexes for table `drivers`
--
ALTER TABLE `drivers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `contact_id` (`contact_id`),
  ADD KEY `transporter_id` (`transporter_id`);

--
-- Indexes for table `driver_contactemails`
--
ALTER TABLE `driver_contactemails`
  ADD PRIMARY KEY (`driver_id`,`contactemail_id`),
  ADD KEY `contactemail_id` (`contactemail_id`);

--
-- Indexes for table `driver_contactphones`
--
ALTER TABLE `driver_contactphones`
  ADD PRIMARY KEY (`driver_id`,`contactphone_id`),
  ADD KEY `contactphone_id` (`contactphone_id`);

--
-- Indexes for table `driver_languages`
--
ALTER TABLE `driver_languages`
  ADD PRIMARY KEY (`driver_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `endcustomers`
--
ALTER TABLE `endcustomers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `contact_id` (`contact_id`);

--
-- Indexes for table `endcustomer_bookings`
--
ALTER TABLE `endcustomer_bookings`
  ADD PRIMARY KEY (`endcustomer_id`);

--
-- Indexes for table `exaccesses`
--
ALTER TABLE `exaccesses`
  ADD PRIMARY KEY (`bit`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `exmenucategories`
--
ALTER TABLE `exmenucategories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `lpos` (`lpos`),
  ADD KEY `rpos` (`rpos`);

--
-- Indexes for table `exmenus`
--
ALTER TABLE `exmenus`
  ADD PRIMARY KEY (`id`),
  ADD KEY `label_name` (`label_name`);

--
-- Indexes for table `exmenu_exaccesses`
--
ALTER TABLE `exmenu_exaccesses`
  ADD UNIQUE KEY `exmenu_id` (`exmenu_id`,`exaccess_bit`),
  ADD KEY `exaccess_bit` (`exaccess_bit`);

--
-- Indexes for table `expasswordresets`
--
ALTER TABLE `expasswordresets`
  ADD PRIMARY KEY (`exuser_id`),
  ADD UNIQUE KEY `uuid` (`uuid`);

--
-- Indexes for table `exurlparameters`
--
ALTER TABLE `exurlparameters`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `parameter` (`parameter`);

--
-- Indexes for table `exusers`
--
ALTER TABLE `exusers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email_UNIQUE` (`email`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `exuser_supplieraccesses`
--
ALTER TABLE `exuser_supplieraccesses`
  ADD PRIMARY KEY (`exuser_id`,`supplier_id`),
  ADD KEY `supplier_id` (`supplier_id`);

--
-- Indexes for table `exuser_terms`
--
ALTER TABLE `exuser_terms`
  ADD PRIMARY KEY (`exuser_id`,`termtype_id`),
  ADD KEY `termtype_id` (`termtype_id`);

--
-- Indexes for table `gps`
--
ALTER TABLE `gps`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `gps_id` (`supplier_id`,`product_id`,`country_id`,`region_id`,`location_id`,`locality_id`,`position`),
  ADD KEY `supplier_id` (`supplier_id`),
  ADD KEY `product_id` (`product_id`),
  ADD KEY `country_id` (`country_id`),
  ADD KEY `region_id` (`region_id`),
  ADD KEY `location_id` (`location_id`),
  ADD KEY `locality_id` (`locality_id`),
  ADD KEY `gps_ibfk_7` (`app_id`),
  ADD KEY `tmp_id` (`tmp_id`);

--
-- Indexes for table `gpsdetails`
--
ALTER TABLE `gpsdetails`
  ADD PRIMARY KEY (`gps_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `groups_mails`
--
ALTER TABLE `groups_mails`
  ADD PRIMARY KEY (`iusergroup_id`,`mail_id`),
  ADD KEY `fk_mails_idx` (`mail_id`);

--
-- Indexes for table `guidebookings`
--
ALTER TABLE `guidebookings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `guide_id` (`guide_id`);

--
-- Indexes for table `guides`
--
ALTER TABLE `guides`
  ADD PRIMARY KEY (`id`),
  ADD KEY `contact_id` (`contact_id`),
  ADD KEY `supplier_id` (`supplier_id`);

--
-- Indexes for table `history`
--
ALTER TABLE `history`
  ADD PRIMARY KEY (`id`),
  ADD KEY `refvalue` (`referencevalue`),
  ADD KEY `iuser_id` (`iuser_id`),
  ADD KEY `exuser_id` (`exuser_id`);

--
-- Indexes for table `historytopics`
--
ALTER TABLE `historytopics`
  ADD PRIMARY KEY (`id`),
  ADD KEY `indexTableName` (`tablename`),
  ADD KEY `indexLabelName` (`label`),
  ADD KEY `indexLabelSearch` (`searchlabel`);

--
-- Indexes for table `iaccesses`
--
ALTER TABLE `iaccesses`
  ADD PRIMARY KEY (`bit`,`language_id`),
  ADD KEY `language_id` (`language_id`);

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

--
-- Indexes for table `imenucategories`
--
ALTER TABLE `imenucategories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `lpos` (`lpos`),
  ADD KEY `rpos` (`rpos`);

--
-- Indexes for table `imenus`
--
ALTER TABLE `imenus`
  ADD PRIMARY KEY (`id`),
  ADD KEY `label_name` (`label_name`),
  ADD KEY `imenus_ibfk_1` (`imenucategory_id`);

--
-- Indexes for table `imenu_iaccesses`
--
ALTER TABLE `imenu_iaccesses`
  ADD PRIMARY KEY (`imenu_id`,`iaccess_bit`),
  ADD KEY `iaccess_bit` (`iaccess_bit`);

--
-- Indexes for table `ipasswordresets`
--
ALTER TABLE `ipasswordresets`
  ADD PRIMARY KEY (`iuser_id`),
  ADD UNIQUE KEY `uuid` (`uuid`);

--
-- Indexes for table `isession_data`
--
ALTER TABLE `isession_data`
  ADD PRIMARY KEY (`session_id`);

--
-- Indexes for table `itinerarymapdategps`
--
ALTER TABLE `itinerarymapdategps`
  ADD PRIMARY KEY (`id`),
  ADD KEY `gps_id` (`gps_id`),
  ADD KEY `itinerarymapdate_id` (`itinerarymapdate_id`);

--
-- Indexes for table `itinerarymapdategpsdetails`
--
ALTER TABLE `itinerarymapdategpsdetails`
  ADD PRIMARY KEY (`itinerarymapdategps_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `itinerarymapdates`
--
ALTER TABLE `itinerarymapdates`
  ADD PRIMARY KEY (`id`),
  ADD KEY `itinerarymap_id` (`itinerarymap_id`);

--
-- Indexes for table `itinerarymaps`
--
ALTER TABLE `itinerarymaps`
  ADD PRIMARY KEY (`id`),
  ADD KEY `booking_id` (`booking_id`),
  ADD KEY `language_id` (`language_id`),
  ADD KEY `customer_id` (`customer_id`),
  ADD KEY `iuser_id` (`iuser_id`);

--
-- Indexes for table `iurlparameters`
--
ALTER TABLE `iurlparameters`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `parameter` (`parameter`);

--
-- Indexes for table `iusergroups`
--
ALTER TABLE `iusergroups`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `short` (`short`);

--
-- Indexes for table `iusers`
--
ALTER TABLE `iusers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email_UNIQUE` (`email`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `iuser_apps`
--
ALTER TABLE `iuser_apps`
  ADD PRIMARY KEY (`iuser_id`,`app_id`),
  ADD KEY `iuserApp_appFK` (`app_id`);

--
-- Indexes for table `iuser_groups`
--
ALTER TABLE `iuser_groups`
  ADD PRIMARY KEY (`iuser_id`,`iusergroup_id`),
  ADD KEY `iusergroup_id` (`iusergroup_id`);

--
-- Indexes for table `iuser_roles`
--
ALTER TABLE `iuser_roles`
  ADD PRIMARY KEY (`iuser_id`,`role_id`),
  ADD KEY `role_id` (`role_id`);

--
-- Indexes for table `iuser_taskorder`
--
ALTER TABLE `iuser_taskorder`
  ADD PRIMARY KEY (`iuser_id`,`task_id`),
  ADD KEY `task_id` (`task_id`);

--
-- Indexes for table `labeldetails`
--
ALTER TABLE `labeldetails`
  ADD PRIMARY KEY (`label_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `labels`
--
ALTER TABLE `labels`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `name` (`name`);

--
-- Indexes for table `languages`
--
ALTER TABLE `languages`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `short` (`short`);

--
-- Indexes for table `lcproducttext_appcategories`
--
ALTER TABLE `lcproducttext_appcategories`
  ADD PRIMARY KEY (`producttextcategory_id`,`appcategory_id`),
  ADD KEY `appcategory_id` (`appcategory_id`);

--
-- Indexes for table `lcsuppliertext_appcategories`
--
ALTER TABLE `lcsuppliertext_appcategories`
  ADD PRIMARY KEY (`suppliertextcategory_id`,`appcategory_id`),
  ADD KEY `appcategory_id` (`appcategory_id`);

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

--
-- Indexes for table `lczonedescription_appcategories`
--
ALTER TABLE `lczonedescription_appcategories`
  ADD PRIMARY KEY (`zone`,`appcategory_id`),
  ADD KEY `appcategory_id` (`appcategory_id`);

--
-- Indexes for table `localities`
--
ALTER TABLE `localities`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `partner_code` (`code`),
  ADD KEY `location_id` (`location_id`),
  ADD KEY `port_id` (`port_id`);

--
-- Indexes for table `localityappcontentreviewed`
--
ALTER TABLE `localityappcontentreviewed`
  ADD PRIMARY KEY (`locality_id`,`app_id`,`contenttype_id`),
  ADD KEY `fk_app_lolappcontreview_idx` (`app_id`),
  ADD KEY `fk_user_lolappcontreview_idx` (`user_id`),
  ADD KEY `fk_type_lolappcontreview_idx` (`contenttype_id`);

--
-- Indexes for table `localityappenabled`
--
ALTER TABLE `localityappenabled`
  ADD PRIMARY KEY (`locality_id`,`app_id`),
  ADD KEY `fk_app_lolappena_idx` (`app_id`),
  ADD KEY `fk_user_lolappena_idx` (`user_id`);

--
-- Indexes for table `localitycontentposition`
--
ALTER TABLE `localitycontentposition`
  ADD PRIMARY KEY (`content_id`,`locality_id`,`appcategory_id`),
  ADD KEY `appcategory_id` (`appcategory_id`),
  ADD KEY `locality_id` (`locality_id`);

--
-- Indexes for table `localitydetails`
--
ALTER TABLE `localitydetails`
  ADD PRIMARY KEY (`locality_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `locality_media`
--
ALTER TABLE `locality_media`
  ADD PRIMARY KEY (`locality_id`,`media_id`,`template_id`),
  ADD KEY `media_id` (`media_id`),
  ADD KEY `appmediatemplate_id` (`appmediatemplate_id`);

--
-- Indexes for table `locality_tags`
--
ALTER TABLE `locality_tags`
  ADD PRIMARY KEY (`locality_id`,`tag_id`);

--
-- Indexes for table `locality_videos`
--
ALTER TABLE `locality_videos`
  ADD PRIMARY KEY (`locality_id`,`media_id`,`app_id`) USING BTREE,
  ADD KEY `language_id` (`language_id`),
  ADD KEY `media_id` (`media_id`),
  ADD KEY `app_id` (`app_id`);

--
-- Indexes for table `locationappcontentreviewed`
--
ALTER TABLE `locationappcontentreviewed`
  ADD PRIMARY KEY (`location_id`,`app_id`,`contenttype_id`),
  ADD KEY `fk_app_locappcontreview_idx` (`app_id`),
  ADD KEY `fk_user_locappcontreview_idx` (`user_id`),
  ADD KEY `fk_type_locappcontreview_idx` (`contenttype_id`);

--
-- Indexes for table `locationappenabled`
--
ALTER TABLE `locationappenabled`
  ADD PRIMARY KEY (`location_id`,`app_id`),
  ADD KEY `fk_app_locappena_idx` (`app_id`),
  ADD KEY `fk_user_locappena_idx` (`user_id`);

--
-- Indexes for table `locationcontentposition`
--
ALTER TABLE `locationcontentposition`
  ADD PRIMARY KEY (`content_id`,`location_id`,`appcategory_id`),
  ADD KEY `appcategory_id` (`appcategory_id`),
  ADD KEY `location_id` (`location_id`);

--
-- Indexes for table `locationdetails`
--
ALTER TABLE `locationdetails`
  ADD PRIMARY KEY (`location_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `locations`
--
ALTER TABLE `locations`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `partner_code` (`code`),
  ADD KEY `region_id` (`region_id`);

--
-- Indexes for table `location_media`
--
ALTER TABLE `location_media`
  ADD PRIMARY KEY (`location_id`,`media_id`,`template_id`),
  ADD KEY `media_id` (`media_id`),
  ADD KEY `appmediatemplate_id` (`appmediatemplate_id`);

--
-- Indexes for table `location_tags`
--
ALTER TABLE `location_tags`
  ADD PRIMARY KEY (`location_id`,`tag_id`);

--
-- Indexes for table `location_videos`
--
ALTER TABLE `location_videos`
  ADD PRIMARY KEY (`location_id`,`media_id`,`app_id`) USING BTREE,
  ADD KEY `language_id` (`language_id`),
  ADD KEY `media_id` (`media_id`),
  ADD KEY `app_id` (`app_id`);

--
-- Indexes for table `luggagesolutiondetails`
--
ALTER TABLE `luggagesolutiondetails`
  ADD PRIMARY KEY (`luggagesolution_id`,`language_id`),
  ADD KEY `luggagesolution_id` (`luggagesolution_id`),
  ADD KEY `language_id` (`language_id`);

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

--
-- Indexes for table `maileraccounts`
--
ALTER TABLE `maileraccounts`
  ADD UNIQUE KEY `id` (`id`);

--
-- Indexes for table `maileraddresses`
--
ALTER TABLE `maileraddresses`
  ADD PRIMARY KEY (`id`),
  ADD KEY `mailer_id` (`mailerqueue_id`),
  ADD KEY `mailertype_id` (`maileraddresstype_id`);

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

--
-- Indexes for table `mailerqueue`
--
ALTER TABLE `mailerqueue`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `id` (`id`),
  ADD KEY `maileraccount_id` (`maileraccount_id`);

--
-- Indexes for table `mailertemplates`
--
ALTER TABLE `mailertemplates`
  ADD PRIMARY KEY (`id`),
  ADD KEY `maileraccount_id` (`maileraccount_id`);

--
-- Indexes for table `mailertemplatevariables`
--
ALTER TABLE `mailertemplatevariables`
  ADD PRIMARY KEY (`mailertemplate_id`,`variable`),
  ADD KEY `mailertemplate_id` (`mailertemplate_id`),
  ADD KEY `variableName` (`variable`);

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

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

--
-- Indexes for table `mapiconconversions`
--
ALTER TABLE `mapiconconversions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `png` (`png`);

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

--
-- Indexes for table `notedetails`
--
ALTER TABLE `notedetails`
  ADD PRIMARY KEY (`note_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `notes`
--
ALTER TABLE `notes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `notecategory_id` (`notecategory_id`);

--
-- Indexes for table `note_iusergroups`
--
ALTER TABLE `note_iusergroups`
  ADD PRIMARY KEY (`note_id`,`iusergroup_id`),
  ADD KEY `note_iusergroups_ibfk_1` (`iusergroup_id`);

--
-- Indexes for table `note_iusers`
--
ALTER TABLE `note_iusers`
  ADD PRIMARY KEY (`note_id`,`iuser_id`),
  ADD KEY `note_iusers_ibfk_1` (`iuser_id`);

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

--
-- Indexes for table `notifications`
--
ALTER TABLE `notifications`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `token_2` (`token`),
  ADD KEY `token` (`token`),
  ADD KEY `iuser_id` (`iuser_id`),
  ADD KEY `created_by` (`created_by`),
  ADD KEY `iusergroup_id` (`iusergroup_id`),
  ADD KEY `app_id` (`app_id`),
  ADD KEY `message_lbl` (`message_lbl`),
  ADD KEY `exuser_id` (`exuser_id`),
  ADD KEY `notificationcategory_id` (`notificationcategory_id`);

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

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

--
-- Indexes for table `not__templatevariables`
--
ALTER TABLE `not__templatevariables`
  ADD PRIMARY KEY (`template_id`,`variable`);

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

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

--
-- Indexes for table `othertextcontent_history`
--
ALTER TABLE `othertextcontent_history`
  ADD KEY `othertxtconth_othertxt_idx` (`othertext_id`);

--
-- Indexes for table `othertext_contents`
--
ALTER TABLE `othertext_contents`
  ADD KEY `othertxtcont_othertxt_idx` (`othertext_id`);

--
-- Indexes for table `othertext_images`
--
ALTER TABLE `othertext_images`
  ADD PRIMARY KEY (`othertext_id`,`image_id`);

--
-- Indexes for table `othertext_tags`
--
ALTER TABLE `othertext_tags`
  ADD PRIMARY KEY (`othertext_id`,`tag`);

--
-- Indexes for table `packages`
--
ALTER TABLE `packages`
  ADD KEY `pcm_id` (`pcm_id`),
  ADD KEY `product_id` (`product_id`);

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

--
-- Indexes for table `paxtypes`
--
ALTER TABLE `paxtypes`
  ADD PRIMARY KEY (`type`);

--
-- Indexes for table `paymentconditions`
--
ALTER TABLE `paymentconditions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `supplier_id` (`supplier_id`),
  ADD KEY `paymentconditiontype_id` (`paymentconditiontype_id`);

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

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

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

--
-- Indexes for table `pcm_details`
--
ALTER TABLE `pcm_details`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `psl_id_UNIQUE` (`psl_id`),
  ADD KEY `pcmdet_prd_idx` (`product_id`),
  ADD KEY `pcmdet_pcm_idx` (`pcm_id`);

--
-- Indexes for table `ports`
--
ALTER TABLE `ports`
  ADD PRIMARY KEY (`id`),
  ADD KEY `label_name` (`label_name`);

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

--
-- Indexes for table `pri__pricecode_customers`
--
ALTER TABLE `pri__pricecode_customers`
  ADD PRIMARY KEY (`customer_id`,`pricecode_id`),
  ADD KEY `pricecode_id` (`pricecode_id`);

--
-- Indexes for table `pri__priceperiods`
--
ALTER TABLE `pri__priceperiods`
  ADD PRIMARY KEY (`id`),
  ADD KEY `product_id` (`product_id`),
  ADD KEY `pricecode_id` (`pricecode_id`),
  ADD KEY `currency_id` (`currency_id`),
  ADD KEY `season` (`season`),
  ADD KEY `prov` (`provision_id`);

--
-- Indexes for table `pri__priceperiodsalesdates`
--
ALTER TABLE `pri__priceperiodsalesdates`
  ADD PRIMARY KEY (`priceperiod_id`);

--
-- Indexes for table `pri__priceperiodservices`
--
ALTER TABLE `pri__priceperiodservices`
  ADD PRIMARY KEY (`priceperiod_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `pri__priceperiodshistory`
--
ALTER TABLE `pri__priceperiodshistory`
  ADD KEY `iuser_id` (`iuser_id`),
  ADD KEY `priceperiod_id` (`priceperiod_id`);

--
-- Indexes for table `pri__priceperiodstayoffers`
--
ALTER TABLE `pri__priceperiodstayoffers`
  ADD PRIMARY KEY (`priceperiod_id`,`stay`);

--
-- Indexes for table `pri__priceperiodtimeoffers`
--
ALTER TABLE `pri__priceperiodtimeoffers`
  ADD PRIMARY KEY (`priceperiod_id`);

--
-- Indexes for table `pri__prices`
--
ALTER TABLE `pri__prices`
  ADD PRIMARY KEY (`priceperiod_id`,`position`,`age_id`,`type_id`,`isadditional`,`isextra`),
  ADD KEY `priceperiod_id` (`priceperiod_id`);

--
-- Indexes for table `pri__pricingruledetails`
--
ALTER TABLE `pri__pricingruledetails`
  ADD PRIMARY KEY (`id`),
  ADD KEY `pricingrule_id` (`pricingrule_id`);

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

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

--
-- Indexes for table `productanalysis`
--
ALTER TABLE `productanalysis`
  ADD PRIMARY KEY (`product_id`),
  ADD KEY `productanalysis6` (`analysis6`),
  ADD KEY `productanalysis3` (`analysis3`),
  ADD KEY `productanalysis5` (`analysis5`),
  ADD KEY `productanalysis4` (`analysis4`),
  ADD KEY `productanalysis2` (`analysis2`),
  ADD KEY `productanalysis1` (`analysis1`);

--
-- Indexes for table `productappcontentreviewed`
--
ALTER TABLE `productappcontentreviewed`
  ADD PRIMARY KEY (`product_id`,`app_id`,`contenttype_id`),
  ADD KEY `fk_app_prdappcontreview_idx` (`app_id`),
  ADD KEY `fk_user_prdappcontreview_idx` (`user_id`),
  ADD KEY `fk_type_prdappcontreview_idx` (`contenttype_id`);

--
-- Indexes for table `productappenabled`
--
ALTER TABLE `productappenabled`
  ADD PRIMARY KEY (`product_id`,`app_id`),
  ADD KEY `fk_app_prdappena_idx` (`app_id`),
  ADD KEY `fk_user_prdappena_idx` (`user_id`);

--
-- Indexes for table `productcontentposition`
--
ALTER TABLE `productcontentposition`
  ADD PRIMARY KEY (`content_id`,`product_id`,`appcategory_id`),
  ADD KEY `appcategory_id` (`appcategory_id`),
  ADD KEY `product_id` (`product_id`);

--
-- Indexes for table `productdestinations`
--
ALTER TABLE `productdestinations`
  ADD PRIMARY KEY (`product_id`),
  ADD KEY `country_id` (`country_id`),
  ADD KEY `region_id` (`region_id`),
  ADD KEY `location_id` (`location_id`),
  ADD KEY `locality_id` (`locality_id`);

--
-- Indexes for table `productdetails`
--
ALTER TABLE `productdetails`
  ADD PRIMARY KEY (`product_id`,`language_id`),
  ADD KEY `prddet_lang_idx` (`language_id`);
ALTER TABLE `productdetails` ADD FULLTEXT KEY `name` (`name`);
ALTER TABLE `productdetails` ADD FULLTEXT KEY `comment` (`comment`);

--
-- Indexes for table `productextradetails`
--
ALTER TABLE `productextradetails`
  ADD PRIMARY KEY (`product_id`,`language_id`),
  ADD KEY `FK_products_id_idx` (`product_id`),
  ADD KEY `FK_language_id_idx` (`language_id`);

--
-- Indexes for table `productextras`
--
ALTER TABLE `productextras`
  ADD PRIMARY KEY (`product_id`,`position`),
  ADD KEY `FK_products_id_idx` (`product_id`);

--
-- Indexes for table `productoptions`
--
ALTER TABLE `productoptions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `short` (`short`);

--
-- Indexes for table `productpax`
--
ALTER TABLE `productpax`
  ADD PRIMARY KEY (`product_id`,`position`);

--
-- Indexes for table `products`
--
ALTER TABLE `products`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `partner_optid` (`opt_id`),
  ADD KEY `FK_supplier_id_idx` (`supplier_id`),
  ADD KEY `country_id` (`country_id`),
  ADD KEY `producttype_id` (`service_id`),
  ADD KEY `region_id` (`region_id`),
  ADD KEY `location_id` (`location_id`),
  ADD KEY `locality_id` (`locality_id`),
  ADD KEY `parent` (`parent_id`);

--
-- Indexes for table `producttextcontent_history`
--
ALTER TABLE `producttextcontent_history`
  ADD KEY `prdtxtconth_prdtxt_idx` (`producttext_id`);

--
-- Indexes for table `producttext_contents`
--
ALTER TABLE `producttext_contents`
  ADD PRIMARY KEY (`producttext_id`,`language_id`),
  ADD KEY `prdtxtcont_prdtxt_idx` (`producttext_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `product_additionalproducts`
--
ALTER TABLE `product_additionalproducts`
  ADD PRIMARY KEY (`product_id`,`addproduct_id`),
  ADD KEY `product_addproducts_ibfk_2` (`addproduct_id`);

--
-- Indexes for table `product_amenities`
--
ALTER TABLE `product_amenities`
  ADD PRIMARY KEY (`product_id`,`amenity_id`),
  ADD KEY `amenity_id` (`amenity_id`);

--
-- Indexes for table `product_documents`
--
ALTER TABLE `product_documents`
  ADD PRIMARY KEY (`product_id`,`media_id`,`app_id`),
  ADD KEY `language_id` (`language_id`),
  ADD KEY `app_id` (`app_id`);

--
-- Indexes for table `product_images`
--
ALTER TABLE `product_images`
  ADD PRIMARY KEY (`product_id`,`image_id`);

--
-- Indexes for table `product_includedproducts`
--
ALTER TABLE `product_includedproducts`
  ADD PRIMARY KEY (`product_id`,`incproduct_id`),
  ADD KEY `product_incproducts_ibfk_2` (`incproduct_id`);

--
-- Indexes for table `product_media`
--
ALTER TABLE `product_media`
  ADD PRIMARY KEY (`product_id`,`media_id`,`template_id`),
  ADD KEY `media_id` (`media_id`),
  ADD KEY `appmediatemplate_id` (`appmediatemplate_id`);

--
-- Indexes for table `product_options`
--
ALTER TABLE `product_options`
  ADD PRIMARY KEY (`product_id`,`productoption_id`),
  ADD KEY `productoption_id` (`productoption_id`);

--
-- Indexes for table `product_tags`
--
ALTER TABLE `product_tags`
  ADD PRIMARY KEY (`product_id`,`tag_id`);

--
-- Indexes for table `product_texts`
--
ALTER TABLE `product_texts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `product_texts_ibfk_1` (`product_id`);

--
-- Indexes for table `product_videos`
--
ALTER TABLE `product_videos`
  ADD PRIMARY KEY (`product_id`,`media_id`,`app_id`) USING BTREE,
  ADD KEY `language_id` (`language_id`),
  ADD KEY `media_id` (`media_id`),
  ADD KEY `app_id` (`app_id`);

--
-- Indexes for table `projects`
--
ALTER TABLE `projects`
  ADD PRIMARY KEY (`id`),
  ADD KEY `parent_id` (`parent_id`),
  ADD KEY `iuser_id` (`iuser_id`);

--
-- Indexes for table `projecttemplates`
--
ALTER TABLE `projecttemplates`
  ADD PRIMARY KEY (`id`),
  ADD KEY `parent_id` (`parent_id`),
  ADD KEY `iuser_id` (`iuser_id`);

--
-- Indexes for table `projecttemplate_iusergroups`
--
ALTER TABLE `projecttemplate_iusergroups`
  ADD PRIMARY KEY (`projecttemplate_id`,`iusergroup_id`),
  ADD KEY `project_iusergroups_ibfk_1` (`iusergroup_id`);

--
-- Indexes for table `projecttemplate_iusers`
--
ALTER TABLE `projecttemplate_iusers`
  ADD PRIMARY KEY (`projecttemplate_id`,`iuser_id`),
  ADD KEY `project_iusers_ibfk_1` (`iuser_id`);

--
-- Indexes for table `project_bookings`
--
ALTER TABLE `project_bookings`
  ADD PRIMARY KEY (`project_id`,`booking_id`);

--
-- Indexes for table `project_contacts`
--
ALTER TABLE `project_contacts`
  ADD PRIMARY KEY (`project_id`,`contact_id`),
  ADD KEY `project_contacts_ibfk_1` (`contact_id`);

--
-- Indexes for table `project_iusergroups`
--
ALTER TABLE `project_iusergroups`
  ADD PRIMARY KEY (`project_id`,`iusergroup_id`),
  ADD KEY `project_iusergroups_ibfk_1` (`iusergroup_id`);

--
-- Indexes for table `project_iusers`
--
ALTER TABLE `project_iusers`
  ADD PRIMARY KEY (`project_id`,`iuser_id`),
  ADD KEY `project_iusers_ibfk_1` (`iuser_id`);

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

--
-- Indexes for table `ref__continentdetails`
--
ALTER TABLE `ref__continentdetails`
  ADD PRIMARY KEY (`ref__region_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

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

--
-- Indexes for table `ref__countries`
--
ALTER TABLE `ref__countries`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `alpha_2` (`alpha_2`),
  ADD UNIQUE KEY `alpha_3` (`alpha_3`);

--
-- Indexes for table `ref__countrydetails`
--
ALTER TABLE `ref__countrydetails`
  ADD PRIMARY KEY (`ref__country_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `ref__country_currencies`
--
ALTER TABLE `ref__country_currencies`
  ADD PRIMARY KEY (`ref__country_id`,`ref__currency_id`),
  ADD KEY `ref__currency_id` (`ref__currency_id`);

--
-- Indexes for table `ref__currencies`
--
ALTER TABLE `ref__currencies`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `code` (`code`);

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

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

--
-- Indexes for table `ref__subcontinentdetails`
--
ALTER TABLE `ref__subcontinentdetails`
  ADD PRIMARY KEY (`ref__subregion_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `ref__subcontinents`
--
ALTER TABLE `ref__subcontinents`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ref__region_id` (`ref__region_id`);

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

--
-- Indexes for table `regionappcontentreviewed`
--
ALTER TABLE `regionappcontentreviewed`
  ADD PRIMARY KEY (`region_id`,`app_id`,`contenttype_id`),
  ADD KEY `fk_app_regappcontreview_idx` (`app_id`),
  ADD KEY `fk_user_regappcontreview_idx` (`user_id`),
  ADD KEY `fk_type_regappcontreview_idx` (`contenttype_id`);

--
-- Indexes for table `regionappenabled`
--
ALTER TABLE `regionappenabled`
  ADD PRIMARY KEY (`region_id`,`app_id`),
  ADD KEY `fk_app_regappena_idx` (`app_id`),
  ADD KEY `fk_user_regappena_idx` (`user_id`);

--
-- Indexes for table `regioncontentposition`
--
ALTER TABLE `regioncontentposition`
  ADD PRIMARY KEY (`region_id`,`content_id`,`appcategory_id`),
  ADD KEY `appcategory_id` (`appcategory_id`),
  ADD KEY `content_id` (`content_id`);

--
-- Indexes for table `regiondetails`
--
ALTER TABLE `regiondetails`
  ADD PRIMARY KEY (`region_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `regions`
--
ALTER TABLE `regions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `partner_code` (`code`),
  ADD KEY `country_id` (`country_id`);

--
-- Indexes for table `region_media`
--
ALTER TABLE `region_media`
  ADD PRIMARY KEY (`region_id`,`media_id`,`template_id`),
  ADD KEY `media_id` (`media_id`),
  ADD KEY `appmediatemplate_id` (`appmediatemplate_id`);

--
-- Indexes for table `region_tags`
--
ALTER TABLE `region_tags`
  ADD PRIMARY KEY (`region_id`,`tag_id`);

--
-- Indexes for table `region_videos`
--
ALTER TABLE `region_videos`
  ADD PRIMARY KEY (`region_id`,`media_id`,`app_id`) USING BTREE,
  ADD KEY `language_id` (`language_id`),
  ADD KEY `media_id` (`media_id`),
  ADD KEY `app_id` (`app_id`);

--
-- Indexes for table `replacement_products`
--
ALTER TABLE `replacement_products`
  ADD PRIMARY KEY (`product_id`,`rproduct_id`),
  ADD KEY `rproduct_id` (`rproduct_id`);

--
-- Indexes for table `roles`
--
ALTER TABLE `roles`
  ADD PRIMARY KEY (`id`),
  ADD KEY `label_name` (`label_name`),
  ADD KEY `label_description` (`label_description`);

--
-- Indexes for table `roles_iaccesses`
--
ALTER TABLE `roles_iaccesses`
  ADD PRIMARY KEY (`role_id`,`iaccess_id`),
  ADD KEY `iaccess_id` (`iaccess_id`);

--
-- Indexes for table `roomconfigurationpaxs`
--
ALTER TABLE `roomconfigurationpaxs`
  ADD KEY `roomconfiguration_id` (`roomconfiguration_id`),
  ADD KEY `paxs_idx` (`pax_id`);

--
-- Indexes for table `roomconfigurations`
--
ALTER TABLE `roomconfigurations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk3_bookingdetail_idx` (`bookingdetail_id`),
  ADD KEY `roomconfigurations_ibfk_1` (`bsl_id`) USING BTREE;

--
-- Indexes for table `roompolicies`
--
ALTER TABLE `roompolicies`
  ADD PRIMARY KEY (`product_id`,`occupation_id`);

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

--
-- Indexes for table `sea__public`
--
ALTER TABLE `sea__public`
  ADD PRIMARY KEY (`id`),
  ADD KEY `product_id` (`product_id`),
  ADD KEY `fromlocation_id` (`fromlocation_id`),
  ADD KEY `fromlocality_id` (`fromlocality_id`),
  ADD KEY `tolocation_id` (`tolocation_id`),
  ADD KEY `tolocality_id` (`tolocality_id`);

--
-- Indexes for table `sea__public_apps`
--
ALTER TABLE `sea__public_apps`
  ADD PRIMARY KEY (`public_id`,`app_id`),
  ADD KEY `app_id` (`app_id`);

--
-- Indexes for table `sea__public_languages`
--
ALTER TABLE `sea__public_languages`
  ADD PRIMARY KEY (`public_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `sea__related`
--
ALTER TABLE `sea__related`
  ADD PRIMARY KEY (`product_id`,`relproduct_id`,`dmc_id`),
  ADD KEY `dmc_id` (`dmc_id`);

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

--
-- Indexes for table `sea__statusrules`
--
ALTER TABLE `sea__statusrules`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sea__statusrules_ibfk_1` (`status_id`);

--
-- Indexes for table `sections`
--
ALTER TABLE `sections`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sect_pkgsect_idx` (`pkg_section_id`),
  ADD KEY `sect_booking_idx` (`booking_id`),
  ADD KEY `sect_pcm_idx` (`pcm_id`),
  ADD KEY `sect_bookingdet_idx` (`bookingdetail_id`),
  ADD KEY `sect_pcmdet_idx` (`pcmdetail_id`);

--
-- Indexes for table `section_imagedetail`
--
ALTER TABLE `section_imagedetail`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sectimgdet_sect_idx` (`section_id`);

--
-- Indexes for table `section_otherdetail`
--
ALTER TABLE `section_otherdetail`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sectothdet_sect_idx` (`section_id`);

--
-- Indexes for table `section_productdetail`
--
ALTER TABLE `section_productdetail`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sectprddet_sect_idx` (`section_id`);

--
-- Indexes for table `section_services`
--
ALTER TABLE `section_services`
  ADD PRIMARY KEY (`id`),
  ADD KEY `section_services_idx` (`section_id`);

--
-- Indexes for table `section_servicesdetail`
--
ALTER TABLE `section_servicesdetail`
  ADD KEY `sectservdet_sectserv_idx` (`section_services_id`);

--
-- Indexes for table `serviceanalysis`
--
ALTER TABLE `serviceanalysis`
  ADD PRIMARY KEY (`service_id`),
  ADD KEY `productanalysis1` (`productanalysis1`),
  ADD KEY `productanalysis2` (`productanalysis2`),
  ADD KEY `productanalysis3` (`productanalysis3`),
  ADD KEY `productanalysis4` (`productanalysis4`),
  ADD KEY `productanalysis5` (`productanalysis5`),
  ADD KEY `productanalysis6` (`productanalysis6`);

--
-- Indexes for table `servicecodes`
--
ALTER TABLE `servicecodes`
  ADD PRIMARY KEY (`code`),
  ADD KEY `service_id` (`service_id`);

--
-- Indexes for table `servicedetails`
--
ALTER TABLE `servicedetails`
  ADD PRIMARY KEY (`service_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `serviceoptions`
--
ALTER TABLE `serviceoptions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `short` (`short`);

--
-- Indexes for table `services`
--
ALTER TABLE `services`
  ADD PRIMARY KEY (`id`),
  ADD KEY `parentid` (`parentid`);

--
-- Indexes for table `service_bakusections`
--
ALTER TABLE `service_bakusections`
  ADD PRIMARY KEY (`service_id`,`bakusection_id`),
  ADD UNIQUE KEY `service_id` (`service_id`),
  ADD KEY `bakusection_id` (`bakusection_id`);

--
-- Indexes for table `service_options`
--
ALTER TABLE `service_options`
  ADD PRIMARY KEY (`service_id`,`serviceoption_id`),
  ADD KEY `service_options_ibfk_2_idx` (`serviceoption_id`);

--
-- Indexes for table `ser__series`
--
ALTER TABLE `ser__series`
  ADD PRIMARY KEY (`id`),
  ADD KEY `pcm_id` (`pcm_id`),
  ADD KEY `iuser_id` (`iuser_id`),
  ADD KEY `series_ibfk_3` (`iusergroup_id`),
  ADD KEY `series_ibfk_4` (`customer_id`);

--
-- Indexes for table `ser__seriesdetail_allotments`
--
ALTER TABLE `ser__seriesdetail_allotments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `seriesdetail_id` (`seriesdetail_id`,`allotment_id`),
  ADD KEY `seriesdetail_allotments_ibfk_1` (`allotment_id`);

--
-- Indexes for table `ser__seriesgroupdetails`
--
ALTER TABLE `ser__seriesgroupdetails`
  ADD PRIMARY KEY (`id`),
  ADD KEY `seriesgroup_id` (`seriesgroup_id`),
  ADD KEY `supplier_id` (`supplier_id`),
  ADD KEY `product_id` (`product_id`),
  ADD KEY `pcmdetail_id` (`pcmdetail_id`),
  ADD KEY `bookingdetail_id` (`bookingdetail_id`);

--
-- Indexes for table `ser__seriesgroupdetailsales`
--
ALTER TABLE `ser__seriesgroupdetailsales`
  ADD KEY `seriesgroupdetail_id` (`seriesgroupdetail_id`),
  ADD KEY `occupations_id` (`occupations_id`);

--
-- Indexes for table `ser__seriesgroups`
--
ALTER TABLE `ser__seriesgroups`
  ADD PRIMARY KEY (`id`),
  ADD KEY `seriesgroups_ibfk_1` (`serial_id`),
  ADD KEY `seriesgroups_ibfk_2` (`booking_id`),
  ADD KEY `pcm_id` (`pcm_id`);

--
-- Indexes for table `ser__seriesgroup_bookingfilters`
--
ALTER TABLE `ser__seriesgroup_bookingfilters`
  ADD PRIMARY KEY (`seriesgroup_id`,`booking_id`),
  ADD KEY `booking_id` (`booking_id`);

--
-- Indexes for table `ser__seriesgroup_bookings`
--
ALTER TABLE `ser__seriesgroup_bookings`
  ADD PRIMARY KEY (`seriesgroup_id`,`booking_id`),
  ADD KEY `booking_id` (`booking_id`);

--
-- Indexes for table `ser__seriessupplieralts`
--
ALTER TABLE `ser__seriessupplieralts`
  ADD PRIMARY KEY (`supplier_id`,`altsupplier_id`),
  ADD KEY `altsupplier_id` (`altsupplier_id`),
  ADD KEY `product_id` (`product_id`);

--
-- Indexes for table `session_data`
--
ALTER TABLE `session_data`
  ADD PRIMARY KEY (`session_id`);

--
-- Indexes for table `settings`
--
ALTER TABLE `settings`
  ADD PRIMARY KEY (`key`),
  ADD KEY `settingstype_id` (`settingstype_id`);

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

--
-- Indexes for table `socialmedia`
--
ALTER TABLE `socialmedia`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_socialmedia_contacts1_idx` (`contact_id`),
  ADD KEY `fk_socialmedia_socialmediatypes1_idx` (`socialmediatype_id`);

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

--
-- Indexes for table `sst_bookingdetailstatuses`
--
ALTER TABLE `sst_bookingdetailstatuses`
  ADD PRIMARY KEY (`bookingdetailstatus_id`,`tp__sst_code`),
  ADD KEY `fk_bookingdetailstatus` (`bookingdetailstatus_id`);

--
-- Indexes for table `supplieranalysis`
--
ALTER TABLE `supplieranalysis`
  ADD PRIMARY KEY (`supplier_id`),
  ADD KEY `supplieranalysis2` (`analysis2`),
  ADD KEY `supplieranalysis1` (`analysis1`),
  ADD KEY `supplieranalysis5` (`analysis5`),
  ADD KEY `supplieranalysis6` (`analysis6`),
  ADD KEY `supplieranalysis4` (`analysis4`),
  ADD KEY `supplieranalysis3` (`analysis3`);

--
-- Indexes for table `supplierappcontentreviewed`
--
ALTER TABLE `supplierappcontentreviewed`
  ADD PRIMARY KEY (`supplier_id`,`app_id`,`contenttype_id`),
  ADD KEY `fk_app_suppappcontreview_idx` (`app_id`),
  ADD KEY `fk_user_suppappcontreview_idx` (`user_id`),
  ADD KEY `fk_type_suppappcontreview_idx` (`contenttype_id`);

--
-- Indexes for table `supplierappenabled`
--
ALTER TABLE `supplierappenabled`
  ADD PRIMARY KEY (`supplier_id`,`app_id`),
  ADD KEY `fk_app_appena_idx` (`app_id`),
  ADD KEY `fk_user_appena_idx` (`user_id`);

--
-- Indexes for table `supplierbanks`
--
ALTER TABLE `supplierbanks`
  ADD PRIMARY KEY (`id`) USING BTREE,
  ADD KEY `currency_id` (`currency_id`),
  ADD KEY `bank_id` (`bank_id`),
  ADD KEY `identificationtype_id` (`identificationtype_id`),
  ADD KEY `supplierbanks_ibfk_1` (`supplier_id`);

--
-- Indexes for table `supplierchanges`
--
ALTER TABLE `supplierchanges`
  ADD PRIMARY KEY (`supplier_id`);

--
-- Indexes for table `suppliercontactroles`
--
ALTER TABLE `suppliercontactroles`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `contact_id_2` (`contact_id`,`supplier_id`,`contactrole_id`),
  ADD KEY `supplier_id` (`supplier_id`),
  ADD KEY `pbk_id_` (`pbk_id`),
  ADD KEY `contactrole_id` (`contactrole_id`) USING BTREE,
  ADD KEY `contact_id` (`contact_id`) USING BTREE;

--
-- Indexes for table `suppliercontactrole_contactemails`
--
ALTER TABLE `suppliercontactrole_contactemails`
  ADD PRIMARY KEY (`suppliercontactrole_id`,`contactemail_id`),
  ADD KEY `contactemail_id` (`contactemail_id`);

--
-- Indexes for table `suppliercontactrole_contactphones`
--
ALTER TABLE `suppliercontactrole_contactphones`
  ADD PRIMARY KEY (`suppliercontactrole_id`,`contactphone_id`),
  ADD KEY `contactphone_id` (`contactphone_id`);

--
-- Indexes for table `suppliercontentposition`
--
ALTER TABLE `suppliercontentposition`
  ADD PRIMARY KEY (`content_id`,`supplier_id`,`appcategory_id`),
  ADD KEY `supplier_id` (`supplier_id`),
  ADD KEY `appcategory_id` (`appcategory_id`);

--
-- Indexes for table `supplieroptions`
--
ALTER TABLE `supplieroptions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `short` (`short`);

--
-- Indexes for table `supplierpricefiles`
--
ALTER TABLE `supplierpricefiles`
  ADD PRIMARY KEY (`id`),
  ADD KEY `supplierFk_idx` (`supplier_id`);

--
-- Indexes for table `suppliers`
--
ALTER TABLE `suppliers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `partner_id_2` (`code`),
  ADD UNIQUE KEY `partner_id_3` (`crm_id`),
  ADD KEY `producttype_id` (`service_id`),
  ADD KEY `country_id` (`country_id`),
  ADD KEY `region_id` (`region_id`),
  ADD KEY `location_id` (`location_id`),
  ADD KEY `locality_id` (`locality_id`),
  ADD KEY `enabled` (`enabled`),
  ADD KEY `lc_enabled` (`lc_enabled`),
  ADD KEY `deleted` (`deleted`);
ALTER TABLE `suppliers` ADD FULLTEXT KEY `name` (`name`);

--
-- Indexes for table `suppliers_restrictedmarkets`
--
ALTER TABLE `suppliers_restrictedmarkets`
  ADD PRIMARY KEY (`supplier_id`,`ref__country_id`),
  ADD KEY `referencecountry_id` (`ref__country_id`);

--
-- Indexes for table `suppliertextcontent_history`
--
ALTER TABLE `suppliertextcontent_history`
  ADD KEY `supptxtconth_supptxt_idx` (`suppliertext_id`);

--
-- Indexes for table `suppliertext_contents`
--
ALTER TABLE `suppliertext_contents`
  ADD PRIMARY KEY (`suppliertext_id`,`language_id`),
  ADD KEY `supptxtcont_supptxt_idx` (`suppliertext_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `supplier_access`
--
ALTER TABLE `supplier_access`
  ADD PRIMARY KEY (`supplier_id`),
  ADD UNIQUE KEY `ara_Transportista` (`ara_Transportista`);

--
-- Indexes for table `supplier_amenities`
--
ALTER TABLE `supplier_amenities`
  ADD PRIMARY KEY (`supplier_id`,`amenity_id`),
  ADD KEY `amenity_id` (`amenity_id`);

--
-- Indexes for table `supplier_amenitychanges`
--
ALTER TABLE `supplier_amenitychanges`
  ADD PRIMARY KEY (`supplier_id`,`amenity_id`),
  ADD KEY `amenity_id` (`amenity_id`);

--
-- Indexes for table `supplier_documents`
--
ALTER TABLE `supplier_documents`
  ADD PRIMARY KEY (`supplier_id`,`media_id`,`app_id`),
  ADD KEY `language_id` (`language_id`) USING BTREE,
  ADD KEY `app_id` (`app_id`);

--
-- Indexes for table `supplier_images`
--
ALTER TABLE `supplier_images`
  ADD PRIMARY KEY (`supplier_id`,`image_id`);

--
-- Indexes for table `supplier_media`
--
ALTER TABLE `supplier_media`
  ADD PRIMARY KEY (`supplier_id`,`media_id`,`template_id`),
  ADD KEY `media_id` (`media_id`),
  ADD KEY `appmediatemplate_id` (`appmediatemplate_id`);

--
-- Indexes for table `supplier_mediareview`
--
ALTER TABLE `supplier_mediareview`
  ADD PRIMARY KEY (`supplier_id`,`media_id`),
  ADD KEY `media_id` (`media_id`);

--
-- Indexes for table `supplier_options`
--
ALTER TABLE `supplier_options`
  ADD PRIMARY KEY (`supplier_id`,`supplieroption_id`),
  ADD KEY `supplieroption_id` (`supplieroption_id`);

--
-- Indexes for table `supplier_tags`
--
ALTER TABLE `supplier_tags`
  ADD PRIMARY KEY (`supplier_id`,`tag_id`);

--
-- Indexes for table `supplier_texts`
--
ALTER TABLE `supplier_texts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `supptxt_supp_idx` (`supplier_id`);

--
-- Indexes for table `supplier_videos`
--
ALTER TABLE `supplier_videos`
  ADD PRIMARY KEY (`supplier_id`,`media_id`,`app_id`) USING BTREE,
  ADD KEY `language_id` (`language_id`),
  ADD KEY `media_id` (`media_id`),
  ADD KEY `app_id` (`app_id`);

--
-- Indexes for table `taskcomments`
--
ALTER TABLE `taskcomments`
  ADD PRIMARY KEY (`task_id`,`posted`),
  ADD KEY `iuser_id` (`iuser_id`);

--
-- Indexes for table `tasks`
--
ALTER TABLE `tasks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `iuser_id` (`iuser_id`),
  ADD KEY `project_id` (`project_id`),
  ADD KEY `parent_id` (`parent_id`),
  ADD KEY `iusergroup_id` (`iusergroup_id`);

--
-- Indexes for table `tasktemplates`
--
ALTER TABLE `tasktemplates`
  ADD PRIMARY KEY (`id`),
  ADD KEY `iuser_id` (`iuser_id`),
  ADD KEY `project_id` (`projecttemplate_id`),
  ADD KEY `parent_id` (`parent_id`),
  ADD KEY `iusergroup_id` (`iusergroup_id`);

--
-- Indexes for table `task_bookings`
--
ALTER TABLE `task_bookings`
  ADD PRIMARY KEY (`task_id`,`booking_id`),
  ADD KEY `task_bookings_ibfk_1` (`booking_id`);

--
-- Indexes for table `task_contacts`
--
ALTER TABLE `task_contacts`
  ADD PRIMARY KEY (`task_id`,`contact_id`),
  ADD KEY `task_contacts_ibfk_1` (`contact_id`);

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

--
-- Indexes for table `termdetails`
--
ALTER TABLE `termdetails`
  ADD PRIMARY KEY (`term_id`,`language_id`),
  ADD KEY `termdetails_ibfk_2` (`language_id`);

--
-- Indexes for table `terms`
--
ALTER TABLE `terms`
  ADD PRIMARY KEY (`id`),
  ADD KEY `termtype_id` (`termtype_id`);

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

--
-- Indexes for table `tpbkdetailchanges`
--
ALTER TABLE `tpbkdetailchanges`
  ADD PRIMARY KEY (`bookingdetail_id`,`changed`);

--
-- Indexes for table `tpnotecategories`
--
ALTER TABLE `tpnotecategories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `code` (`code`),
  ADD KEY `fk_lang_notecat_idx` (`language_id`);

--
-- Indexes for table `tpnotecategories_appcategories`
--
ALTER TABLE `tpnotecategories_appcategories`
  ADD PRIMARY KEY (`notecategory_id`,`appcategory_id`),
  ADD KEY `Fk_appCategoryId_idx` (`appcategory_id`);

--
-- Indexes for table `tpproductservice_appcategories`
--
ALTER TABLE `tpproductservice_appcategories`
  ADD PRIMARY KEY (`service_id`,`appcategory_id`),
  ADD KEY `Fk_appCategoryId_idx` (`appcategory_id`);

--
-- Indexes for table `tpsupplierservice_appcategories`
--
ALTER TABLE `tpsupplierservice_appcategories`
  ADD PRIMARY KEY (`service_id`,`appcategory_id`),
  ADD KEY `fk_appCategoryId_idx` (`appcategory_id`);

--
-- Indexes for table `tpsyncdetails`
--
ALTER TABLE `tpsyncdetails`
  ADD PRIMARY KEY (`tpsynch_id`,`language_id`),
  ADD KEY `tpsynclang_FK_idx` (`language_id`);

--
-- Indexes for table `tpsynclogs`
--
ALTER TABLE `tpsynclogs`
  ADD UNIQUE KEY `tpsync_id_UNIQUE` (`tpsync_id`);

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

--
-- Indexes for table `tp__allocations`
--
ALTER TABLE `tp__allocations`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `code` (`code`);

--
-- Indexes for table `tp__allocations_products`
--
ALTER TABLE `tp__allocations_products`
  ADD PRIMARY KEY (`product_id`,`allocation_id`,`adate`),
  ADD KEY `allocation_id` (`allocation_id`);

--
-- Indexes for table `tp__allocation_customers`
--
ALTER TABLE `tp__allocation_customers`
  ADD PRIMARY KEY (`allocation_id`,`customer_id`),
  ADD KEY `customer_id` (`customer_id`);

--
-- Indexes for table `tp__cancelationpolicies`
--
ALTER TABLE `tp__cancelationpolicies`
  ADD PRIMARY KEY (`id`),
  ADD KEY `messageformatcode` (`messageformatcode`),
  ADD KEY `supplier_id` (`supplier_id`),
  ADD KEY `product_id` (`product_id`),
  ADD KEY `tp__cancelationpolicies_ibfk_8` (`service_code`),
  ADD KEY `productanalysis1` (`serviceanalysis1`),
  ADD KEY `productanalysis2` (`serviceanalysis2`),
  ADD KEY `productanalysis3` (`serviceanalysis3`),
  ADD KEY `productanalysis4` (`serviceanalysis4`),
  ADD KEY `productanalysis5` (`serviceanalysis5`),
  ADD KEY `productanalysis6` (`serviceanalysis6`);

--
-- Indexes for table `tp__cancelationpolicydetails`
--
ALTER TABLE `tp__cancelationpolicydetails`
  ADD PRIMARY KEY (`id`),
  ADD KEY `pol_id` (`pol_id`);

--
-- Indexes for table `tp__customeranalysis`
--
ALTER TABLE `tp__customeranalysis`
  ADD PRIMARY KEY (`code`,`type`);

--
-- Indexes for table `tp__messagetypes`
--
ALTER TABLE `tp__messagetypes`
  ADD PRIMARY KEY (`code`);

--
-- Indexes for table `tp__pcmanalysis`
--
ALTER TABLE `tp__pcmanalysis`
  ADD PRIMARY KEY (`code`,`type`);

--
-- Indexes for table `tp__productanalysis`
--
ALTER TABLE `tp__productanalysis`
  ADD PRIMARY KEY (`code`,`type`);

--
-- Indexes for table `tp__salesanalysis`
--
ALTER TABLE `tp__salesanalysis`
  ADD PRIMARY KEY (`code`,`type`);

--
-- Indexes for table `tp__services`
--
ALTER TABLE `tp__services`
  ADD PRIMARY KEY (`code`),
  ADD KEY `service_id` (`service_id`),
  ADD KEY `tp__services_ibfk_1` (`analysis1`),
  ADD KEY `tp__services_ibfk_2` (`analysis2`),
  ADD KEY `tp__services_ibfk_3` (`analysis3`),
  ADD KEY `tp__services_ibfk_4` (`analysis4`),
  ADD KEY `tp__services_ibfk_5` (`analysis5`),
  ADD KEY `tp__services_ibfk_6` (`analysis6`),
  ADD KEY `message_code` (`message_code`);

--
-- Indexes for table `tp__sst`
--
ALTER TABLE `tp__sst`
  ADD PRIMARY KEY (`code`);

--
-- Indexes for table `tp__supplieranalysis`
--
ALTER TABLE `tp__supplieranalysis`
  ADD PRIMARY KEY (`code`,`type`);

--
-- Indexes for table `tp__tst`
--
ALTER TABLE `tp__tst`
  ADD PRIMARY KEY (`code`);

--
-- Indexes for table `transportbookings`
--
ALTER TABLE `transportbookings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `vehicle_id` (`vehicle_id`),
  ADD KEY `driver_id` (`driver_id`),
  ADD KEY `transporter_id` (`transporter_id`),
  ADD KEY `bookingtype_id` (`bookingtype_id`),
  ADD KEY `bookingstatus_id` (`bookingstatus_id`),
  ADD KEY `mailerqueue_id` (`mailerqueue_id`),
  ADD KEY `transportstatus_id` (`transportstatus_id`),
  ADD KEY `airportguide_id` (`airportguide_id`),
  ADD KEY `guide_id` (`guide_id`),
  ADD KEY `vehiclemodel_id` (`vehiclemodel_id`);

--
-- Indexes for table `transportbooking_bookingdetails`
--
ALTER TABLE `transportbooking_bookingdetails`
  ADD PRIMARY KEY (`transportbooking_id`,`bookingdetail_id`),
  ADD KEY `transdetbook_bookdet_idx` (`bookingdetail_id`);

--
-- Indexes for table `transporters`
--
ALTER TABLE `transporters`
  ADD PRIMARY KEY (`supplier_id`);

--
-- Indexes for table `transporter_consuppliers`
--
ALTER TABLE `transporter_consuppliers`
  ADD PRIMARY KEY (`transporter_id`,`supplier_id`),
  ADD KEY `supplier_id` (`supplier_id`);

--
-- Indexes for table `transporthandlers`
--
ALTER TABLE `transporthandlers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `supplier_id` (`supplier_id`);

--
-- Indexes for table `transportreservations`
--
ALTER TABLE `transportreservations`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `transportbooking_id` (`transportbooking_id`,`transporter_id`,`changed`) USING BTREE,
  ADD KEY `transporter_id` (`transporter_id`),
  ADD KEY `transportstatus_id` (`transportstatus_id`);

--
-- Indexes for table `transportstatusdetails`
--
ALTER TABLE `transportstatusdetails`
  ADD PRIMARY KEY (`transportstatus_id`,`language_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Indexes for table `transportstatuses`
--
ALTER TABLE `transportstatuses`
  ADD PRIMARY KEY (`id`),
  ADD KEY `next_id` (`next_id`);

--
-- Indexes for table `tst_bookingstatuses`
--
ALTER TABLE `tst_bookingstatuses`
  ADD PRIMARY KEY (`bookingstatus_id`,`tp__tst_code`),
  ADD KEY `fk_bookingstatus` (`bookingstatus_id`),
  ADD KEY `tp_code` (`tp__tst_code`);

--
-- Indexes for table `urlparameters`
--
ALTER TABLE `urlparameters`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `parameter` (`parameter`);

--
-- Indexes for table `vehicleblocks`
--
ALTER TABLE `vehicleblocks`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `vehicle_id` (`vehicle_id`,`start`,`end`);

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

--
-- Indexes for table `vehicledocuments`
--
ALTER TABLE `vehicledocuments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `vehicle_id` (`vehicle_id`),
  ADD KEY `vehicledocumenttype_id` (`vehicledocumenttype_id`);

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

--
-- Indexes for table `vehiclemodels`
--
ALTER TABLE `vehiclemodels`
  ADD PRIMARY KEY (`id`),
  ADD KEY `vehiclebrand_id` (`vehiclebrand_id`),
  ADD KEY `vehicletype_id` (`vehicletype_id`);

--
-- Indexes for table `vehiclenotemessages`
--
ALTER TABLE `vehiclenotemessages`
  ADD PRIMARY KEY (`vehiclenote_id`,`created`),
  ADD KEY `iuser_id` (`iuser_id`),
  ADD KEY `exuser_id` (`exuser_id`);

--
-- Indexes for table `vehiclenotes`
--
ALTER TABLE `vehiclenotes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `vehiclenotes_ibfk_1` (`vehicle_id`),
  ADD KEY `vehiclenotes_ibfk_2` (`vehiclenotestatus_id`);

--
-- Indexes for table `vehiclenotestatuses`
--
ALTER TABLE `vehiclenotestatuses`
  ADD PRIMARY KEY (`id`),
  ADD KEY `exlabel_name` (`exlabel_name`),
  ADD KEY `ilabel_name` (`ilabel_name`);

--
-- Indexes for table `vehicleoptiondetails`
--
ALTER TABLE `vehicleoptiondetails`
  ADD PRIMARY KEY (`vehicleoption_id`,`language_id`),
  ADD KEY `vehicleoption_id` (`vehicleoption_id`),
  ADD KEY `language_id` (`language_id`);

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

--
-- Indexes for table `vehicles`
--
ALTER TABLE `vehicles`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `plate` (`plate`),
  ADD KEY `transporter_id` (`transporter_id`,`vehiclemodel_id`,`luggagesolution_id`),
  ADD KEY `transporter_id_2` (`transporter_id`),
  ADD KEY `vehiclemodel_id` (`vehiclemodel_id`),
  ADD KEY `luggagesolution_id` (`luggagesolution_id`);

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

--
-- Indexes for table `vehicle_media`
--
ALTER TABLE `vehicle_media`
  ADD PRIMARY KEY (`vehicle_id`,`media_id`);

--
-- Indexes for table `vehicle_options`
--
ALTER TABLE `vehicle_options`
  ADD PRIMARY KEY (`vehicle_id`,`vehicleoptions_id`),
  ADD KEY `transporteroptions_id` (`vehicleoptions_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `airportguides`
--
ALTER TABLE `airportguides`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `all__allotmentdetails`
--
ALTER TABLE `all__allotmentdetails`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `all__allotmentdocuments`
--
ALTER TABLE `all__allotmentdocuments`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `all__allotments`
--
ALTER TABLE `all__allotments`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `all__allotmentstatuses`
--
ALTER TABLE `all__allotmentstatuses`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `all__allotmentstatusoptions`
--
ALTER TABLE `all__allotmentstatusoptions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `amenities`
--
ALTER TABLE `amenities`
  MODIFY `id` smallint(4) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `appcategories`
--
ALTER TABLE `appcategories`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `appcategoryframeworks`
--
ALTER TABLE `appcategoryframeworks`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `appcategorysections`
--
ALTER TABLE `appcategorysections`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `appcategorytypes`
--
ALTER TABLE `appcategorytypes`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `appcategory_content`
--
ALTER TABLE `appcategory_content`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `apps`
--
ALTER TABLE `apps`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `app_mediatemplates`
--
ALTER TABLE `app_mediatemplates`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bakuarticlecollectiondetails`
--
ALTER TABLE `bakuarticlecollectiondetails`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bakuarticlecollections`
--
ALTER TABLE `bakuarticlecollections`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bakucontents`
--
ALTER TABLE `bakucontents`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bakudategps`
--
ALTER TABLE `bakudategps`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bakudates`
--
ALTER TABLE `bakudates`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bakudetails`
--
ALTER TABLE `bakudetails`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bakupcmconfiguration`
--
ALTER TABLE `bakupcmconfiguration`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bakus`
--
ALTER TABLE `bakus`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bakusectioncategories`
--
ALTER TABLE `bakusectioncategories`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bakusections`
--
ALTER TABLE `bakusections`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bakustatuses`
--
ALTER TABLE `bakustatuses`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bakuversions`
--
ALTER TABLE `bakuversions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bakuversions_media`
--
ALTER TABLE `bakuversions_media`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bakuversions_mediaquotes`
--
ALTER TABLE `bakuversions_mediaquotes`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bankaccounts`
--
ALTER TABLE `bankaccounts`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `banks`
--
ALTER TABLE `banks`
  MODIFY `id` tinyint(4) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `be__booking`
--
ALTER TABLE `be__booking`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `be__bookingdetails`
--
ALTER TABLE `be__bookingdetails`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `be__externalreservation`
--
ALTER TABLE `be__externalreservation`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bookingdetailstatuses`
--
ALTER TABLE `bookingdetailstatuses`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bookingdetailstatusoptions`
--
ALTER TABLE `bookingdetailstatusoptions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bookingstatuses`
--
ALTER TABLE `bookingstatuses`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bookingstatusoptions`
--
ALTER TABLE `bookingstatusoptions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bookingtypes`
--
ALTER TABLE `bookingtypes`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `booking_details`
--
ALTER TABLE `booking_details`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `changelogs`
--
ALTER TABLE `changelogs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__api_request_params`
--
ALTER TABLE `chn__api_request_params`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__channels`
--
ALTER TABLE `chn__channels`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__comparisonoperator`
--
ALTER TABLE `chn__comparisonoperator`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__conditional_output_values`
--
ALTER TABLE `chn__conditional_output_values`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__conditional_stdoutput_values`
--
ALTER TABLE `chn__conditional_stdoutput_values`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__custom_header`
--
ALTER TABLE `chn__custom_header`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__custom_output`
--
ALTER TABLE `chn__custom_output`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__custom_standardoutput`
--
ALTER TABLE `chn__custom_standardoutput`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__filterresponse`
--
ALTER TABLE `chn__filterresponse`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__filter_std_response`
--
ALTER TABLE `chn__filter_std_response`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__inputformat`
--
ALTER TABLE `chn__inputformat`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__logs`
--
ALTER TABLE `chn__logs`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__operations`
--
ALTER TABLE `chn__operations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__output`
--
ALTER TABLE `chn__output`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__output_fn`
--
ALTER TABLE `chn__output_fn`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__output_fn_params`
--
ALTER TABLE `chn__output_fn_params`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__parameters`
--
ALTER TABLE `chn__parameters`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__requestheaders`
--
ALTER TABLE `chn__requestheaders`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__requests`
--
ALTER TABLE `chn__requests`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__responses`
--
ALTER TABLE `chn__responses`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__standardoutput`
--
ALTER TABLE `chn__standardoutput`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__stdoutput_fn`
--
ALTER TABLE `chn__stdoutput_fn`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__stdoutput_fn_params`
--
ALTER TABLE `chn__stdoutput_fn_params`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__successcriteria`
--
ALTER TABLE `chn__successcriteria`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chn__urls`
--
ALTER TABLE `chn__urls`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `contactaddresses`
--
ALTER TABLE `contactaddresses`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `contactemails`
--
ALTER TABLE `contactemails`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `contactphones`
--
ALTER TABLE `contactphones`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `contactroles`
--
ALTER TABLE `contactroles`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `contacts`
--
ALTER TABLE `contacts`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `contacttypes`
--
ALTER TABLE `contacttypes`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `contentcond`
--
ALTER TABLE `contentcond`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `contentdetailhistory`
--
ALTER TABLE `contentdetailhistory`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `contents`
--
ALTER TABLE `contents`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `contenttypes`
--
ALTER TABLE `contenttypes`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `contracts`
--
ALTER TABLE `contracts`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `contractstatuses`
--
ALTER TABLE `contractstatuses`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `countries`
--
ALTER TABLE `countries`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customeroptions`
--
ALTER TABLE `customeroptions`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customers`
--
ALTER TABLE `customers`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `driverdocuments`
--
ALTER TABLE `driverdocuments`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `driverdocumenttypes`
--
ALTER TABLE `driverdocumenttypes`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `drivers`
--
ALTER TABLE `drivers`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `endcustomers`
--
ALTER TABLE `endcustomers`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `exmenucategories`
--
ALTER TABLE `exmenucategories`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `exmenus`
--
ALTER TABLE `exmenus`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `exurlparameters`
--
ALTER TABLE `exurlparameters`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `exusers`
--
ALTER TABLE `exusers`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `gps`
--
ALTER TABLE `gps`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `guidebookings`
--
ALTER TABLE `guidebookings`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `guides`
--
ALTER TABLE `guides`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `history`
--
ALTER TABLE `history`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `historytopics`
--
ALTER TABLE `historytopics`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `identificationtypes`
--
ALTER TABLE `identificationtypes`
  MODIFY `id` tinyint(4) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `imenucategories`
--
ALTER TABLE `imenucategories`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `imenus`
--
ALTER TABLE `imenus`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `itinerarymapdategps`
--
ALTER TABLE `itinerarymapdategps`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `itinerarymapdates`
--
ALTER TABLE `itinerarymapdates`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `itinerarymaps`
--
ALTER TABLE `itinerarymaps`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `iurlparameters`
--
ALTER TABLE `iurlparameters`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `iusergroups`
--
ALTER TABLE `iusergroups`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `iusers`
--
ALTER TABLE `iusers`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `languages`
--
ALTER TABLE `languages`
  MODIFY `id` tinyint(4) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `localities`
--
ALTER TABLE `localities`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `locations`
--
ALTER TABLE `locations`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `luggagesolutions`
--
ALTER TABLE `luggagesolutions`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `maileraccounts`
--
ALTER TABLE `maileraccounts`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `maileraddresses`
--
ALTER TABLE `maileraddresses`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `maileradresstypes`
--
ALTER TABLE `maileradresstypes`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `mailerqueue`
--
ALTER TABLE `mailerqueue`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `mailertemplates`
--
ALTER TABLE `mailertemplates`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `mails`
--
ALTER TABLE `mails`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `mailstatuses`
--
ALTER TABLE `mailstatuses`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `mapiconconversions`
--
ALTER TABLE `mapiconconversions`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `notecategories`
--
ALTER TABLE `notecategories`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `notes`
--
ALTER TABLE `notes`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `notificationcategories`
--
ALTER TABLE `notificationcategories`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `notifications`
--
ALTER TABLE `notifications`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `not__notifications`
--
ALTER TABLE `not__notifications`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `not__templates`
--
ALTER TABLE `not__templates`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `others_texts`
--
ALTER TABLE `others_texts`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `paymentconditions`
--
ALTER TABLE `paymentconditions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `paymentconditiontypes`
--
ALTER TABLE `paymentconditiontypes`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `paymenttypes`
--
ALTER TABLE `paymenttypes`
  MODIFY `id` tinyint(4) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `pcm_details`
--
ALTER TABLE `pcm_details`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ports`
--
ALTER TABLE `ports`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `productdestinations`
--
ALTER TABLE `productdestinations`
  MODIFY `product_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `productoptions`
--
ALTER TABLE `productoptions`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `product_texts`
--
ALTER TABLE `product_texts`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `projects`
--
ALTER TABLE `projects`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `projecttemplates`
--
ALTER TABLE `projecttemplates`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `referencedates`
--
ALTER TABLE `referencedates`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ref__continents`
--
ALTER TABLE `ref__continents`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ref__datatypes`
--
ALTER TABLE `ref__datatypes`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ref__httpmethods`
--
ALTER TABLE `ref__httpmethods`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ref__subcontinents`
--
ALTER TABLE `ref__subcontinents`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `regions`
--
ALTER TABLE `regions`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `roles`
--
ALTER TABLE `roles`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `roomconfigurations`
--
ALTER TABLE `roomconfigurations`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `seasontypes`
--
ALTER TABLE `seasontypes`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sea__public`
--
ALTER TABLE `sea__public`
  MODIFY `id` smallint(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sea__statuses`
--
ALTER TABLE `sea__statuses`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sea__statusrules`
--
ALTER TABLE `sea__statusrules`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sections`
--
ALTER TABLE `sections`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `section_imagedetail`
--
ALTER TABLE `section_imagedetail`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `section_otherdetail`
--
ALTER TABLE `section_otherdetail`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `section_productdetail`
--
ALTER TABLE `section_productdetail`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `section_services`
--
ALTER TABLE `section_services`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `serviceoptions`
--
ALTER TABLE `serviceoptions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `services`
--
ALTER TABLE `services`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ser__series`
--
ALTER TABLE `ser__series`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ser__seriesdetail_allotments`
--
ALTER TABLE `ser__seriesdetail_allotments`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ser__seriesgroupdetails`
--
ALTER TABLE `ser__seriesgroupdetails`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ser__seriesgroups`
--
ALTER TABLE `ser__seriesgroups`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `settingtypes`
--
ALTER TABLE `settingtypes`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `socialmedia`
--
ALTER TABLE `socialmedia`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `socialmediatypes`
--
ALTER TABLE `socialmediatypes`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `supplierbanks`
--
ALTER TABLE `supplierbanks`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `suppliercontactroles`
--
ALTER TABLE `suppliercontactroles`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `supplieroptions`
--
ALTER TABLE `supplieroptions`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `supplierpricefiles`
--
ALTER TABLE `supplierpricefiles`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `suppliers`
--
ALTER TABLE `suppliers`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `supplier_texts`
--
ALTER TABLE `supplier_texts`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `tasks`
--
ALTER TABLE `tasks`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `tasktemplates`
--
ALTER TABLE `tasktemplates`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `templates`
--
ALTER TABLE `templates`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `terms`
--
ALTER TABLE `terms`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `termtypes`
--
ALTER TABLE `termtypes`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `tpnotecategories`
--
ALTER TABLE `tpnotecategories`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `tpsyncs`
--
ALTER TABLE `tpsyncs`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `tp__allocations`
--
ALTER TABLE `tp__allocations`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transportbookings`
--
ALTER TABLE `transportbookings`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transportreservations`
--
ALTER TABLE `transportreservations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transportstatuses`
--
ALTER TABLE `transportstatuses`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `urlparameters`
--
ALTER TABLE `urlparameters`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vehicleblocks`
--
ALTER TABLE `vehicleblocks`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vehiclebrands`
--
ALTER TABLE `vehiclebrands`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vehicledocuments`
--
ALTER TABLE `vehicledocuments`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vehicledocumenttypes`
--
ALTER TABLE `vehicledocumenttypes`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vehiclemodels`
--
ALTER TABLE `vehiclemodels`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vehiclenotes`
--
ALTER TABLE `vehiclenotes`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vehiclenotestatuses`
--
ALTER TABLE `vehiclenotestatuses`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vehicleoptions`
--
ALTER TABLE `vehicleoptions`
  MODIFY `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vehicles`
--
ALTER TABLE `vehicles`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vehicletypes`
--
ALTER TABLE `vehicletypes`
  MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `agepolicies`
--
ALTER TABLE `agepolicies`
  ADD CONSTRAINT `agepolicies_ibfk_3` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `agepolicies_ibfk_4` FOREIGN KEY (`age_id`) REFERENCES `ages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `airportguides`
--
ALTER TABLE `airportguides`
  ADD CONSTRAINT `airportguides_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `all__allotmentdetails`
--
ALTER TABLE `all__allotmentdetails`
  ADD CONSTRAINT `all__allotmentdetails_ibfk_1` FOREIGN KEY (`allotment_id`) REFERENCES `all__allotments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `all__allotmentdetails_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `all__allotmentdocuments`
--
ALTER TABLE `all__allotmentdocuments`
  ADD CONSTRAINT `all__allotmentdocuments_ibfk_1` FOREIGN KEY (`allotment_id`) REFERENCES `all__allotments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `all__allotmentmails`
--
ALTER TABLE `all__allotmentmails`
  ADD CONSTRAINT `all__allotmentmails_ibfk_1` FOREIGN KEY (`allotment_id`) REFERENCES `all__allotments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `all__allotmentmails_ibfk_2` FOREIGN KEY (`mailerqueue_id`) REFERENCES `mailerqueue` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `all__allotments`
--
ALTER TABLE `all__allotments`
  ADD CONSTRAINT `all__allotments_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `all__allotmentstatus_options`
--
ALTER TABLE `all__allotmentstatus_options`
  ADD CONSTRAINT `all__allotmentstatus_options_ibfk_1` FOREIGN KEY (`allotmentstatus_id`) REFERENCES `all__allotmentstatuses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `all__allotmentstatus_options_ibfk_2` FOREIGN KEY (`allotmentstatusoption_id`) REFERENCES `all__allotmentstatusoptions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `all__allotmentupdates`
--
ALTER TABLE `all__allotmentupdates`
  ADD CONSTRAINT `all__allotmentupdates_ibfk_1` FOREIGN KEY (`allotmentdetail_id`) REFERENCES `all__allotmentdetails` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `all__allotmentupdates_ibfk_2` FOREIGN KEY (`status`) REFERENCES `all__allotmentstatuses` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `all__mailtemplates`
--
ALTER TABLE `all__mailtemplates`
  ADD CONSTRAINT `all__mailtemplates_ibfk_1` FOREIGN KEY (`mailertemplate_id`) REFERENCES `mailertemplates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `amenities`
--
ALTER TABLE `amenities`
  ADD CONSTRAINT `amenities_ibfk_1` FOREIGN KEY (`amenitycategory_id`) REFERENCES `amenitycategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `amenitycategorydetails`
--
ALTER TABLE `amenitycategorydetails`
  ADD CONSTRAINT `fk_amecategory` FOREIGN KEY (`amenitycategory_id`) REFERENCES `amenitycategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_amecategorylang` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `amenitydetails`
--
ALTER TABLE `amenitydetails`
  ADD CONSTRAINT `amenitydetails_ibfk_4` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `amenitydetails_ibfk_5` FOREIGN KEY (`amenity_id`) REFERENCES `amenities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `appcategories`
--
ALTER TABLE `appcategories`
  ADD CONSTRAINT `appcat_appFK` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `appcat_typeFK` FOREIGN KEY (`appcategorytype_id`) REFERENCES `appcategorytypes` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `appcategories_ibfk_1` FOREIGN KEY (`appcategorysection_id`) REFERENCES `appcategorysections` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `appcategories_tpnotecategories`
--
ALTER TABLE `appcategories_tpnotecategories`
  ADD CONSTRAINT `appcategories_tpnotecategories_ibfk_1` FOREIGN KEY (`appcategory_id`) REFERENCES `appcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `appcategories_tpnotecategories_ibfk_2` FOREIGN KEY (`tpnotecategory_id`) REFERENCES `tpnotecategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `appcategories_tpnotecategories_ibfk_3` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `appcategorydetails`
--
ALTER TABLE `appcategorydetails`
  ADD CONSTRAINT `appcat_dets` FOREIGN KEY (`appcat_id`) REFERENCES `appcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `appcat_langs` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `appcategoryframeworks`
--
ALTER TABLE `appcategoryframeworks`
  ADD CONSTRAINT `fk_appcategorytype` FOREIGN KEY (`appcategorytype_id`) REFERENCES `appcategorytypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_appid` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `appcategoryframework_appcategories`
--
ALTER TABLE `appcategoryframework_appcategories`
  ADD CONSTRAINT `fk_appcategoryframework` FOREIGN KEY (`appcategoryframework_id`) REFERENCES `appcategoryframeworks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_to_appcategory` FOREIGN KEY (`appcategory_id`) REFERENCES `appcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `appcategorysections`
--
ALTER TABLE `appcategorysections`
  ADD CONSTRAINT `fk_app` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `appcategorytypedetails`
--
ALTER TABLE `appcategorytypedetails`
  ADD CONSTRAINT `appcategorytypeFK` FOREIGN KEY (`appcategorytype_id`) REFERENCES `appcategorytypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `languageFK` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `appcategory_content`
--
ALTER TABLE `appcategory_content`
  ADD CONSTRAINT `appcategory_content_ibfk_1` FOREIGN KEY (`appcategory_id`) REFERENCES `appcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `appcategory_content_ibfk_2` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `appcategory_services`
--
ALTER TABLE `appcategory_services`
  ADD CONSTRAINT `appcategory_services_ibfk_1` FOREIGN KEY (`appcategory_id`) REFERENCES `appcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `appcategory_services_ibfk_2` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `app_media`
--
ALTER TABLE `app_media`
  ADD CONSTRAINT `app_media_ibfk_1` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `app_mediatemplates`
--
ALTER TABLE `app_mediatemplates`
  ADD CONSTRAINT `app_mediatemplates_ibfk_1` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `bakuarticlecollectiondetails`
--
ALTER TABLE `bakuarticlecollectiondetails`
  ADD CONSTRAINT `Fk_BakuArticleCollectionId` FOREIGN KEY (`bakuarticlecollection_id`) REFERENCES `bakuarticlecollections` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `Fk_BakuSectionId` FOREIGN KEY (`bakusection_id`) REFERENCES `bakusections` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `Fk_ContentId` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bakucontentdetails`
--
ALTER TABLE `bakucontentdetails`
  ADD CONSTRAINT `bakucontentdetails_ibfk_1` FOREIGN KEY (`bakucontent_id`) REFERENCES `bakucontents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bakucontentdetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bakucontents`
--
ALTER TABLE `bakucontents`
  ADD CONSTRAINT `bakucontents_ibfk_1` FOREIGN KEY (`bakuversion_id`) REFERENCES `bakuversions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bakucontent_media`
--
ALTER TABLE `bakucontent_media`
  ADD CONSTRAINT `bakucontent_media_ibfk_1` FOREIGN KEY (`bakucontent_id`) REFERENCES `bakucontents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bakucontent_media_ibfk_2` FOREIGN KEY (`appmediatemplate_id`) REFERENCES `app_mediatemplates` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `bakudategps`
--
ALTER TABLE `bakudategps`
  ADD CONSTRAINT `bakudategps_ibfk_1` FOREIGN KEY (`bakudate_id`) REFERENCES `bakudates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bakudategps_ibfk_2` FOREIGN KEY (`gps_id`) REFERENCES `gps` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `bakudategpsdetails`
--
ALTER TABLE `bakudategpsdetails`
  ADD CONSTRAINT `bakudategpsdetails_ibfk_1` FOREIGN KEY (`bakudategps_id`) REFERENCES `bakudategps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bakudategpsdetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bakudates`
--
ALTER TABLE `bakudates`
  ADD CONSTRAINT `bakudates_ibfk_1` FOREIGN KEY (`bakuversion_id`) REFERENCES `bakuversions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bakudetails`
--
ALTER TABLE `bakudetails`
  ADD CONSTRAINT `bakudetails_bookdetIdFk` FOREIGN KEY (`bookingdetail_id`) REFERENCES `booking_details` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `bakudetails_bookdetbslFK` FOREIGN KEY (`bsl_id`) REFERENCES `booking_details` (`bsl_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `bakudetails_ibfk_1` FOREIGN KEY (`bakuversion_id`) REFERENCES `bakuversions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bakudetails_locFK` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bakudetails_prdFK` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bakudetails_suppFK` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `pcmdetails_pcmdetIdFK` FOREIGN KEY (`pcmdetail_id`) REFERENCES `pcm_details` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `pcmdetails_pcmdetpslFK` FOREIGN KEY (`psl_id`) REFERENCES `pcm_details` (`psl_id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `bakus`
--
ALTER TABLE `bakus`
  ADD CONSTRAINT `bakus_customersFK` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `bakus_ibfk_1` FOREIGN KEY (`bakustatus_id`) REFERENCES `bakustatuses` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `bakus_iusersFK` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `bakusectioncategorydetails`
--
ALTER TABLE `bakusectioncategorydetails`
  ADD CONSTRAINT `FkLanguageId` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `FkSectionCategoryId` FOREIGN KEY (`bakusectioncategory_id`) REFERENCES `bakusectioncategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bakusectiondetails`
--
ALTER TABLE `bakusectiondetails`
  ADD CONSTRAINT `bakusectiondetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bakusectiondetails_ibfk_3` FOREIGN KEY (`bakusection_id`) REFERENCES `bakusections` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bakusections`
--
ALTER TABLE `bakusections`
  ADD CONSTRAINT `FK_sectionCategoryId` FOREIGN KEY (`sectioncategory_id`) REFERENCES `bakusectioncategories` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `bakusection_appcategories`
--
ALTER TABLE `bakusection_appcategories`
  ADD CONSTRAINT `bakusection_appcategories_ibfk_1` FOREIGN KEY (`bakusection_id`) REFERENCES `bakusections` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bakusection_appcategories_ibfk_2` FOREIGN KEY (`appcategory_id`) REFERENCES `appcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bakusection_services`
--
ALTER TABLE `bakusection_services`
  ADD CONSTRAINT `bakusectsrv_bakusectFK` FOREIGN KEY (`bakusection_id`) REFERENCES `bakusections` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bakusectsrv_srvFK` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bakusection_statuses`
--
ALTER TABLE `bakusection_statuses`
  ADD CONSTRAINT `bakusection_statuses_ibfk_3` FOREIGN KEY (`bakusection_id`) REFERENCES `bakusections` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bakusection_statuses_ibfk_4` FOREIGN KEY (`bakustatus_id`) REFERENCES `bakustatuses` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `bakustatusdetails`
--
ALTER TABLE `bakustatusdetails`
  ADD CONSTRAINT `bakustatusdetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bakustatusdetails_ibfk_3` FOREIGN KEY (`bakustatus_id`) REFERENCES `bakustatuses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bakustatuses`
--
ALTER TABLE `bakustatuses`
  ADD CONSTRAINT `bakustatuses_ibfk_1` FOREIGN KEY (`bakusection_id`) REFERENCES `bakusections` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `bakuversionmediaquotedetails`
--
ALTER TABLE `bakuversionmediaquotedetails`
  ADD CONSTRAINT `mediaquotesdet_mediaquotesFK` FOREIGN KEY (`bakuversionmediaquote_id`) REFERENCES `bakuversions_mediaquotes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bakuversions`
--
ALTER TABLE `bakuversions`
  ADD CONSTRAINT `bakuversions_ibfk_1` FOREIGN KEY (`baku_id`) REFERENCES `bakus` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bakuversions_media`
--
ALTER TABLE `bakuversions_media`
  ADD CONSTRAINT `bakuversions_media_ibfk_1` FOREIGN KEY (`bakuversion_id`) REFERENCES `bakuversions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bakuversions_mediaquotes`
--
ALTER TABLE `bakuversions_mediaquotes`
  ADD CONSTRAINT `bakuversions_contIdFK` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `bakuversions_mediaquotes_ibfk_1` FOREIGN KEY (`bakuversions_media_id`) REFERENCES `bakuversions_media` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bakuversion_bookings`
--
ALTER TABLE `bakuversion_bookings`
  ADD CONSTRAINT `bakuversion_bookings_ibfk_1` FOREIGN KEY (`bakuversion_id`) REFERENCES `bakuversions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bakuversionbookings_bookingFK` FOREIGN KEY (`booking_id`) REFERENCES `bookings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bakuversionbookings_pcmFK` FOREIGN KEY (`pcm_id`) REFERENCES `pcms` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bakuversion_sections`
--
ALTER TABLE `bakuversion_sections`
  ADD CONSTRAINT `fk_bakuversion` FOREIGN KEY (`bakuversion_id`) REFERENCES `bakuversions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_bkusection` FOREIGN KEY (`bakusection_id`) REFERENCES `bakusections` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `baku_articles`
--
ALTER TABLE `baku_articles`
  ADD CONSTRAINT `FkBakuSectionId` FOREIGN KEY (`bakusection_id`) REFERENCES `bakusections` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fkBaku` FOREIGN KEY (`baku_id`) REFERENCES `bakus` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bankaccounts`
--
ALTER TABLE `bankaccounts`
  ADD CONSTRAINT `bankaccounts_ibfk_1` FOREIGN KEY (`identificationtype_id`) REFERENCES `identificationtypes` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `bankaccounts_ibfk_2` FOREIGN KEY (`currency_id`) REFERENCES `ref__currencies` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_bankaccount_bank1` FOREIGN KEY (`bank_id`) REFERENCES `banks` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_bankaccount_paymenttype1` FOREIGN KEY (`paymenttype_id`) REFERENCES `paymenttypes` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `be__booking`
--
ALTER TABLE `be__booking`
  ADD CONSTRAINT `be_booking_ibfk_1` FOREIGN KEY (`booking_id`) REFERENCES `bookings` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `be_booking_ibfk_2` FOREIGN KEY (`createdby`) REFERENCES `iusers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `be_booking_ibfk_3` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `be_booking_ibfk_4` FOREIGN KEY (`updatedby`) REFERENCES `iusers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `be__bookingdetails`
--
ALTER TABLE `be__bookingdetails`
  ADD CONSTRAINT `foreignKey_bkdetstatus2` FOREIGN KEY (`statusid`) REFERENCES `bookingdetailstatuses` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `itinerarydetails_ibfk_1` FOREIGN KEY (`booking_id`) REFERENCES `be__booking` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `itinerarydetails_ibfk_2` FOREIGN KEY (`bookingdetail_id`) REFERENCES `booking_details` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `itinerarydetails_ibfk_3` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `itinerarydetails_ibfk_4` FOREIGN KEY (`updatedby`) REFERENCES `iusers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `itinerarydetails_ibfk_5` FOREIGN KEY (`createdby`) REFERENCES `iusers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `be__externalreservation`
--
ALTER TABLE `be__externalreservation`
  ADD CONSTRAINT `foreignKey_bkdets` FOREIGN KEY (`bookingdetail_id`) REFERENCES `be__bookingdetails` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `foreignKey_bkdetstatus` FOREIGN KEY (`statusid`) REFERENCES `bookingdetailstatuses` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `foreignKey_channel` FOREIGN KEY (`channel_id`) REFERENCES `chn__channels` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `foreignKey_user` FOREIGN KEY (`createdby`) REFERENCES `iusers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `bookingdetailsconfig`
--
ALTER TABLE `bookingdetailsconfig`
  ADD CONSTRAINT `fk_bookingdetails` FOREIGN KEY (`bsl_id`) REFERENCES `booking_details` (`bsl_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bookingdetailstatus_options`
--
ALTER TABLE `bookingdetailstatus_options`
  ADD CONSTRAINT `bookingdetailstatus_options_ibfk_1` FOREIGN KEY (`bookingdetailstatus_id`) REFERENCES `bookingdetailstatuses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bookingdetailstatus_options_ibfk_2` FOREIGN KEY (`bookingdetailstatusoption_id`) REFERENCES `bookingdetailstatusoptions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bookingdetail_pax`
--
ALTER TABLE `bookingdetail_pax`
  ADD CONSTRAINT `pax_bkd` FOREIGN KEY (`bookingdetail_bsl`) REFERENCES `booking_details` (`bsl_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `pax_pax` FOREIGN KEY (`pax_id`) REFERENCES `paxs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bookingstatusdetails`
--
ALTER TABLE `bookingstatusdetails`
  ADD CONSTRAINT `bookingstatusdetails_ibfk_1` FOREIGN KEY (`bookingstatus_id`) REFERENCES `bookingstatuses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bookingstatusdetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`);

--
-- Constraints for table `bookingstatus_options`
--
ALTER TABLE `bookingstatus_options`
  ADD CONSTRAINT `bookingstatus_options_ibfk_1` FOREIGN KEY (`bookingstatus_id`) REFERENCES `bookingstatuses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bookingstatus_options_ibfk_2` FOREIGN KEY (`bookingstatusoption_id`) REFERENCES `bookingstatusoptions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bookingtypedetails`
--
ALTER TABLE `bookingtypedetails`
  ADD CONSTRAINT `bookingtypedetails_ibfk_1` FOREIGN KEY (`bookingtype_id`) REFERENCES `bookingtypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bookingtypedetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `booking_details`
--
ALTER TABLE `booking_details`
  ADD CONSTRAINT `bkdet_bk` FOREIGN KEY (`booking_id`) REFERENCES `bookings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `booking_details_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `changelogdetails`
--
ALTER TABLE `changelogdetails`
  ADD CONSTRAINT `changelogdetails_ibfk_1` FOREIGN KEY (`changelog_id`) REFERENCES `changelogs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `changelogs`
--
ALTER TABLE `changelogs`
  ADD CONSTRAINT `changelogs_ibfk_1` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `changelogs_ibfk_2` FOREIGN KEY (`exuser_id`) REFERENCES `exusers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `chn__api_request_params`
--
ALTER TABLE `chn__api_request_params`
  ADD CONSTRAINT `chn__api_request_params_ibfk_1` FOREIGN KEY (`datatype_id`) REFERENCES `ref__datatypes` (`id`),
  ADD CONSTRAINT `chn__api_request_params_ibfk_2` FOREIGN KEY (`operation_id`) REFERENCES `chn__operations` (`id`);

--
-- Constraints for table `chn__conditional_output_values`
--
ALTER TABLE `chn__conditional_output_values`
  ADD CONSTRAINT `chn__conditional_output_values_ibfk_1` FOREIGN KEY (`comparisonoperator_id`) REFERENCES `chn__comparisonoperator` (`id`),
  ADD CONSTRAINT `chn__conditional_output_values_ibfk_2` FOREIGN KEY (`customoutput_id`) REFERENCES `chn__custom_output` (`id`);

--
-- Constraints for table `chn__conditional_stdoutput_values`
--
ALTER TABLE `chn__conditional_stdoutput_values`
  ADD CONSTRAINT `chn__conditional_stdoutput_values_ibfk_1` FOREIGN KEY (`comparisonoperator_id`) REFERENCES `chn__comparisonoperator` (`id`),
  ADD CONSTRAINT `chn__conditional_stdoutput_values_ibfk_2` FOREIGN KEY (`request_id`) REFERENCES `chn__requests` (`id`),
  ADD CONSTRAINT `chn__conditional_stdoutput_values_ibfk_4` FOREIGN KEY (`stdoutput_id`) REFERENCES `chn__standardoutput` (`id`);

--
-- Constraints for table `chn__custom_header`
--
ALTER TABLE `chn__custom_header`
  ADD CONSTRAINT `chn__custom_header_ibfk_1` FOREIGN KEY (`parent_header`) REFERENCES `chn__requestheaders` (`id`),
  ADD CONSTRAINT `chn__custom_header_ibfk_2` FOREIGN KEY (`header_param`) REFERENCES `chn__requestheaders` (`id`);

--
-- Constraints for table `chn__custom_output`
--
ALTER TABLE `chn__custom_output`
  ADD CONSTRAINT `chn__custom_output_ibfk_1` FOREIGN KEY (`output_id`) REFERENCES `chn__output` (`id`),
  ADD CONSTRAINT `chn__custom_output_ibfk_2` FOREIGN KEY (`reference_id`) REFERENCES `chn__responses` (`id`),
  ADD CONSTRAINT `chn__custom_output_ibfk_3` FOREIGN KEY (`response_id`) REFERENCES `chn__responses` (`id`),
  ADD CONSTRAINT `chn__custom_output_ibfk_4` FOREIGN KEY (`request_id`) REFERENCES `chn__requests` (`id`),
  ADD CONSTRAINT `chn__custom_output_ibfk_5` FOREIGN KEY (`filter_node_id`) REFERENCES `chn__responses` (`id`),
  ADD CONSTRAINT `chn__custom_output_ibfk_7` FOREIGN KEY (`property_to_match`) REFERENCES `chn__responses` (`id`);

--
-- Constraints for table `chn__custom_standardoutput`
--
ALTER TABLE `chn__custom_standardoutput`
  ADD CONSTRAINT `chn__custom_standardoutput_ibfk_1` FOREIGN KEY (`standardoutput_id`) REFERENCES `chn__standardoutput` (`id`),
  ADD CONSTRAINT `chn__custom_standardoutput_ibfk_2` FOREIGN KEY (`reference_id`) REFERENCES `chn__responses` (`id`),
  ADD CONSTRAINT `chn__custom_standardoutput_ibfk_3` FOREIGN KEY (`response_id`) REFERENCES `chn__responses` (`id`),
  ADD CONSTRAINT `chn__custom_standardoutput_ibfk_4` FOREIGN KEY (`request_id`) REFERENCES `chn__requests` (`id`),
  ADD CONSTRAINT `chn__custom_standardoutput_ibfk_5` FOREIGN KEY (`filter_node_id`) REFERENCES `chn__responses` (`id`);

--
-- Constraints for table `chn__filterresponse`
--
ALTER TABLE `chn__filterresponse`
  ADD CONSTRAINT `chn__filterresponse_ibfk_1` FOREIGN KEY (`comparisonoperator_id`) REFERENCES `chn__comparisonoperator` (`id`),
  ADD CONSTRAINT `chn__filterresponse_ibfk_2` FOREIGN KEY (`response_id`) REFERENCES `chn__responses` (`id`);

--
-- Constraints for table `chn__inputformat`
--
ALTER TABLE `chn__inputformat`
  ADD CONSTRAINT `chn__inputformat_ibfk_1` FOREIGN KEY (`operation_id`) REFERENCES `chn__operations` (`id`),
  ADD CONSTRAINT `chn__inputformat_ibfk_2` FOREIGN KEY (`datatype_id`) REFERENCES `ref__datatypes` (`id`);

--
-- Constraints for table `chn__operation_requests`
--
ALTER TABLE `chn__operation_requests`
  ADD CONSTRAINT `chn__operation_requests_ibfk_1` FOREIGN KEY (`operation_id`) REFERENCES `chn__operations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `chn__operation_requests_ibfk_2` FOREIGN KEY (`request_id`) REFERENCES `chn__requests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `chn__operation_requests_ibfk_3` FOREIGN KEY (`operation_id_loopedcount`) REFERENCES `chn__inputformat` (`id`);

--
-- Constraints for table `chn__output`
--
ALTER TABLE `chn__output`
  ADD CONSTRAINT `chn__output_ibfk_4` FOREIGN KEY (`operation_id`) REFERENCES `chn__operations` (`id`),
  ADD CONSTRAINT `chn__output_ibfk_5` FOREIGN KEY (`datatype_id`) REFERENCES `ref__datatypes` (`id`);

--
-- Constraints for table `chn__output_fn`
--
ALTER TABLE `chn__output_fn`
  ADD CONSTRAINT `chn__output_fn_ibfk_1` FOREIGN KEY (`output_id`) REFERENCES `chn__output` (`id`),
  ADD CONSTRAINT `chn__output_fn_ibfk_2` FOREIGN KEY (`operation_id`,`request_id`) REFERENCES `chn__operation_requests` (`operation_id`, `request_id`);

--
-- Constraints for table `chn__output_fn_params`
--
ALTER TABLE `chn__output_fn_params`
  ADD CONSTRAINT `chn__output_fn_params_ibfk_1` FOREIGN KEY (`outputfn_id`) REFERENCES `chn__output_fn` (`id`),
  ADD CONSTRAINT `chn__output_fn_params_ibfk_2` FOREIGN KEY (`responseparam_id`) REFERENCES `chn__responses` (`id`);

--
-- Constraints for table `chn__parameters`
--
ALTER TABLE `chn__parameters`
  ADD CONSTRAINT `chn__parameters_ibfk_1` FOREIGN KEY (`request_id`) REFERENCES `chn__requests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `chn__parameters_ibfk_6` FOREIGN KEY (`datatypeout_id`) REFERENCES `ref__datatypes` (`id`),
  ADD CONSTRAINT `chn__parameters_ibfk_7` FOREIGN KEY (`inputformat_id`) REFERENCES `chn__inputformat` (`id`);

--
-- Constraints for table `chn__productmap`
--
ALTER TABLE `chn__productmap`
  ADD CONSTRAINT `chn__productmap_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `chn__productmap_ibfk_2` FOREIGN KEY (`channel_id`) REFERENCES `chn__channels` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `chn__requests`
--
ALTER TABLE `chn__requests`
  ADD CONSTRAINT `chn__requests_ibfk_1` FOREIGN KEY (`url_id`) REFERENCES `chn__urls` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `chn__requests_ibfk_2` FOREIGN KEY (`httpmethod_id`) REFERENCES `ref__httpmethods` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `chn__responses`
--
ALTER TABLE `chn__responses`
  ADD CONSTRAINT `chn__responses_ibfk_1` FOREIGN KEY (`request_id`) REFERENCES `chn__requests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `chn__responses_ibfk_5` FOREIGN KEY (`datatype_id`) REFERENCES `ref__datatypes` (`id`);

--
-- Constraints for table `chn__standardoutput`
--
ALTER TABLE `chn__standardoutput`
  ADD CONSTRAINT `chn__standardoutput_ibfk_1` FOREIGN KEY (`operation_id`) REFERENCES `chn__operations` (`id`),
  ADD CONSTRAINT `chn__standardoutput_ibfk_2` FOREIGN KEY (`datatype_id`) REFERENCES `ref__datatypes` (`id`);

--
-- Constraints for table `chn__stdoutput_fn`
--
ALTER TABLE `chn__stdoutput_fn`
  ADD CONSTRAINT `chn__stdoutput_fn_ibfk_1` FOREIGN KEY (`stdoutput_id`) REFERENCES `chn__standardoutput` (`id`),
  ADD CONSTRAINT `chn__stdoutput_fn_ibfk_2` FOREIGN KEY (`request_id`) REFERENCES `chn__requests` (`id`);

--
-- Constraints for table `chn__stdoutput_fn_params`
--
ALTER TABLE `chn__stdoutput_fn_params`
  ADD CONSTRAINT `chn__stdoutput_fn_params_ibfk_1` FOREIGN KEY (`responseparam_id`) REFERENCES `chn__responses` (`id`),
  ADD CONSTRAINT `chn__stdoutput_fn_params_ibfk_2` FOREIGN KEY (`stdoutputfn_id`) REFERENCES `chn__stdoutput_fn` (`id`);

--
-- Constraints for table `chn__successcriteria`
--
ALTER TABLE `chn__successcriteria`
  ADD CONSTRAINT `chn__successcriteria_ibfk_1` FOREIGN KEY (`comparisonoperator_id`) REFERENCES `chn__comparisonoperator` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `chn__successcriteria_ibfk_3` FOREIGN KEY (`comparisonoperator_id`) REFERENCES `chn__comparisonoperator` (`id`),
  ADD CONSTRAINT `chn__successcriteria_ibfk_4` FOREIGN KEY (`response_id`) REFERENCES `chn__responses` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `chn__suppliermap`
--
ALTER TABLE `chn__suppliermap`
  ADD CONSTRAINT `chn__suppliermap_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `chn__suppliermap_ibfk_2` FOREIGN KEY (`channel_id`) REFERENCES `chn__channels` (`id`);

--
-- Constraints for table `chn__urls`
--
ALTER TABLE `chn__urls`
  ADD CONSTRAINT `fk_chn__home_urls_chn__apis1` FOREIGN KEY (`channel_id`) REFERENCES `chn__channels` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `contactaddresses`
--
ALTER TABLE `contactaddresses`
  ADD CONSTRAINT `contactaddresses_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `contactaddresses_ibfk_2` FOREIGN KEY (`contacttype_id`) REFERENCES `contacttypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `contactaddresses_ibfk_3` FOREIGN KEY (`contactcountries_id`) REFERENCES `contactcountries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `contactcompanies`
--
ALTER TABLE `contactcompanies`
  ADD CONSTRAINT `fk_contactcompanies_contacts1` FOREIGN KEY (`contacts_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `contactcountrydetails`
--
ALTER TABLE `contactcountrydetails`
  ADD CONSTRAINT `contactcountrydetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `contactcountrydetails_ibfk_3` FOREIGN KEY (`contactcountry_id`) REFERENCES `contactcountries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `contactemails`
--
ALTER TABLE `contactemails`
  ADD CONSTRAINT `contactemails_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `contactemails_ibfk_2` FOREIGN KEY (`contacttype_id`) REFERENCES `contacttypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `contactpersons`
--
ALTER TABLE `contactpersons`
  ADD CONSTRAINT `fk_contactpersons_contacts1` FOREIGN KEY (`contacts_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `contactphones`
--
ALTER TABLE `contactphones`
  ADD CONSTRAINT `contactphones_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `contactphones_ibfk_2` FOREIGN KEY (`contacttype_id`) REFERENCES `contacttypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `contentcond`
--
ALTER TABLE `contentcond`
  ADD CONSTRAINT `contentcond_ibfk_1` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `contentconddaterange`
--
ALTER TABLE `contentconddaterange`
  ADD CONSTRAINT `contentconddaterange_ibfk_1` FOREIGN KEY (`contentcond_id`) REFERENCES `contentcond` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `contentcond_customers`
--
ALTER TABLE `contentcond_customers`
  ADD CONSTRAINT `contentcond_customers_ibfk_1` FOREIGN KEY (`contentcond_id`) REFERENCES `contentcond` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `contentcond_markets`
--
ALTER TABLE `contentcond_markets`
  ADD CONSTRAINT `contentcond_markets_ibfk_1` FOREIGN KEY (`contentcond_id`) REFERENCES `contentcond` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `contentcond_markets_ibfk_2` FOREIGN KEY (`referencecountry_id`) REFERENCES `ref__countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `contentcond_priceperiods`
--
ALTER TABLE `contentcond_priceperiods`
  ADD CONSTRAINT `fkptcpp_prdtxtcond` FOREIGN KEY (`contentcond_id`) REFERENCES `contentcond` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `contentdetailhistory`
--
ALTER TABLE `contentdetailhistory`
  ADD CONSTRAINT `contentdetailhistory_AppFK` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `contentdetailhistory_ibfk_1` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `contentdetails`
--
ALTER TABLE `contentdetails`
  ADD CONSTRAINT `contentdet_user` FOREIGN KEY (`reviewedby`) REFERENCES `iusers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `contentdetails_ibfk_1` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `contents`
--
ALTER TABLE `contents`
  ADD CONSTRAINT `contentParentFk` FOREIGN KEY (`parent_id`) REFERENCES `contents` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `contentUser` FOREIGN KEY (`createdby`) REFERENCES `iusers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `content_countries`
--
ALTER TABLE `content_countries`
  ADD CONSTRAINT `ctrcontsContentFk` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ctrcontsCountryFk` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `content_customers`
--
ALTER TABLE `content_customers`
  ADD CONSTRAINT `cus_contstFk` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `cus_contstFk2` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `content_localities`
--
ALTER TABLE `content_localities`
  ADD CONSTRAINT `lolcontsContentFk` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `lolcontslocalityFk` FOREIGN KEY (`locality_id`) REFERENCES `localities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `content_locations`
--
ALTER TABLE `content_locations`
  ADD CONSTRAINT `loccontsContentFk` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `loccontsLocationFk` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `content_media`
--
ALTER TABLE `content_media`
  ADD CONSTRAINT `content_media_ibfk_1` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `content_products`
--
ALTER TABLE `content_products`
  ADD CONSTRAINT `prdcontsContentFk` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `prdcontsProductFk` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `content_regions`
--
ALTER TABLE `content_regions`
  ADD CONSTRAINT `regcontsContentFk` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `regcontsRegionFk` FOREIGN KEY (`region_id`) REFERENCES `regions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `content_suppliers`
--
ALTER TABLE `content_suppliers`
  ADD CONSTRAINT `suppcontsContentFk` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `suppcontsSupplierFk` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `content_tags`
--
ALTER TABLE `content_tags`
  ADD CONSTRAINT `content_tags_ibfk_1` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `contracts`
--
ALTER TABLE `contracts`
  ADD CONSTRAINT `contracts_ibfk_2` FOREIGN KEY (`contracttype_id`) REFERENCES `contracttypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `contracts_ibfk_3` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `contracts_ibfk_4` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `countryappcontentreviewed`
--
ALTER TABLE `countryappcontentreviewed`
  ADD CONSTRAINT `fk_app_ctrappcontreview` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_country_ctrappcontreview` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_type_ctrappcontreview` FOREIGN KEY (`contenttype_id`) REFERENCES `contenttypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_user_ctrappcontreview` FOREIGN KEY (`user_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `countryappenabled`
--
ALTER TABLE `countryappenabled`
  ADD CONSTRAINT `fk_app_ctrappena` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_country_appena` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_user_ctrappena` FOREIGN KEY (`user_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `countrycontentposition`
--
ALTER TABLE `countrycontentposition`
  ADD CONSTRAINT `countrycontentposition_ibfk_1` FOREIGN KEY (`appcategory_id`) REFERENCES `appcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `countrycontentposition_ibfk_2` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `countrycontentposition_ibfk_3` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `countrydetails`
--
ALTER TABLE `countrydetails`
  ADD CONSTRAINT `countrydetails_ibfk_4` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `countrydetails_ibfk_5` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `country_media`
--
ALTER TABLE `country_media`
  ADD CONSTRAINT `country_media_ibfk_1` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `country_media_ibfk_2` FOREIGN KEY (`appmediatemplate_id`) REFERENCES `app_mediatemplates` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `country_tags`
--
ALTER TABLE `country_tags`
  ADD CONSTRAINT `country_tags_ibfk_1` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `country_videos`
--
ALTER TABLE `country_videos`
  ADD CONSTRAINT `country_videos_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `country_videos_ibfk_3` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `country_videos_ibfk_4` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `currencyrates`
--
ALTER TABLE `currencyrates`
  ADD CONSTRAINT `fk_currency_from` FOREIGN KEY (`fromcurrency_id`) REFERENCES `ref__currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_currency_to` FOREIGN KEY (`tocurrency_id`) REFERENCES `ref__currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `customeranalysis`
--
ALTER TABLE `customeranalysis`
  ADD CONSTRAINT `customeranalysis_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `customeranalysis_ibfk_2` FOREIGN KEY (`analysis1`) REFERENCES `tp__customeranalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `customeranalysis_ibfk_3` FOREIGN KEY (`analysis2`) REFERENCES `tp__customeranalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `customeranalysis_ibfk_4` FOREIGN KEY (`analysis3`) REFERENCES `tp__customeranalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `customeranalysis_ibfk_5` FOREIGN KEY (`analysis4`) REFERENCES `tp__customeranalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `customeranalysis_ibfk_6` FOREIGN KEY (`analysis5`) REFERENCES `tp__customeranalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `customeranalysis_ibfk_7` FOREIGN KEY (`analysis6`) REFERENCES `tp__customeranalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `customers`
--
ALTER TABLE `customers`
  ADD CONSTRAINT `fk_country` FOREIGN KEY (`ref__country_id`) REFERENCES `ref__countries` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `customer_exclusiveproducts`
--
ALTER TABLE `customer_exclusiveproducts`
  ADD CONSTRAINT `customer_exclusiveproducts_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `customer_exclusiveproducts_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `customer_options`
--
ALTER TABLE `customer_options`
  ADD CONSTRAINT `customer_options_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `customer_options_ibfk_2` FOREIGN KEY (`customeroption_id`) REFERENCES `customeroptions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `driverdocuments`
--
ALTER TABLE `driverdocuments`
  ADD CONSTRAINT `driverdocuments_ibfk_1` FOREIGN KEY (`driver_id`) REFERENCES `drivers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `driverdocuments_ibfk_2` FOREIGN KEY (`driverdocumenttype_id`) REFERENCES `driverdocumenttypes` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `drivers`
--
ALTER TABLE `drivers`
  ADD CONSTRAINT `drivers_ibfk_1` FOREIGN KEY (`transporter_id`) REFERENCES `transporters` (`supplier_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `drivers_ibfk_2` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `driver_contactemails`
--
ALTER TABLE `driver_contactemails`
  ADD CONSTRAINT `driver_contactemails_ibfk_1` FOREIGN KEY (`driver_id`) REFERENCES `drivers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `driver_contactemails_ibfk_2` FOREIGN KEY (`contactemail_id`) REFERENCES `contactemails` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `driver_contactphones`
--
ALTER TABLE `driver_contactphones`
  ADD CONSTRAINT `driver_contactphones_ibfk_1` FOREIGN KEY (`driver_id`) REFERENCES `drivers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `driver_contactphones_ibfk_2` FOREIGN KEY (`contactphone_id`) REFERENCES `contactphones` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `endcustomers`
--
ALTER TABLE `endcustomers`
  ADD CONSTRAINT `endcustomers_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `endcustomer_bookings`
--
ALTER TABLE `endcustomer_bookings`
  ADD CONSTRAINT `endcustomer_bookings_ibfk_1` FOREIGN KEY (`endcustomer_id`) REFERENCES `endcustomers` (`id`);

--
-- Constraints for table `exmenu_exaccesses`
--
ALTER TABLE `exmenu_exaccesses`
  ADD CONSTRAINT `exmenu_exaccesses_ibfk_1` FOREIGN KEY (`exaccess_bit`) REFERENCES `exaccesses` (`bit`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `exmenu_exaccesses_ibfk_2` FOREIGN KEY (`exmenu_id`) REFERENCES `exmenus` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `expasswordresets`
--
ALTER TABLE `expasswordresets`
  ADD CONSTRAINT `expasswordresets_ibfk_1` FOREIGN KEY (`exuser_id`) REFERENCES `exusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `exuser_supplieraccesses`
--
ALTER TABLE `exuser_supplieraccesses`
  ADD CONSTRAINT `exuser_supplieraccesses_ibfk_1` FOREIGN KEY (`exuser_id`) REFERENCES `exusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `exuser_supplieraccesses_ibfk_2` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `exuser_terms`
--
ALTER TABLE `exuser_terms`
  ADD CONSTRAINT `exuser_terms_ibfk_1` FOREIGN KEY (`exuser_id`) REFERENCES `exusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `exuser_terms_ibfk_2` FOREIGN KEY (`termtype_id`) REFERENCES `termtypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `gps`
--
ALTER TABLE `gps`
  ADD CONSTRAINT `gps_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `gps_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `gps_ibfk_3` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `gps_ibfk_4` FOREIGN KEY (`region_id`) REFERENCES `regions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `gps_ibfk_5` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `gps_ibfk_6` FOREIGN KEY (`locality_id`) REFERENCES `localities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `gps_ibfk_7` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `gpsdetails`
--
ALTER TABLE `gpsdetails`
  ADD CONSTRAINT `gpsdetails_ibfk_1` FOREIGN KEY (`gps_id`) REFERENCES `gps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `gpsdetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `groups_mails`
--
ALTER TABLE `groups_mails`
  ADD CONSTRAINT `fk_groups` FOREIGN KEY (`iusergroup_id`) REFERENCES `iusergroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_mails` FOREIGN KEY (`mail_id`) REFERENCES `mails` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `guidebookings`
--
ALTER TABLE `guidebookings`
  ADD CONSTRAINT `guidebookings_ibfk_1` FOREIGN KEY (`guide_id`) REFERENCES `guides` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `guides`
--
ALTER TABLE `guides`
  ADD CONSTRAINT `guides_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `guides_ibfk_2` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `imenus`
--
ALTER TABLE `imenus`
  ADD CONSTRAINT `imenus_ibfk_1` FOREIGN KEY (`imenucategory_id`) REFERENCES `imenucategories` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `imenu_iaccesses`
--
ALTER TABLE `imenu_iaccesses`
  ADD CONSTRAINT `imenu_iaccesses_ibfk_1` FOREIGN KEY (`imenu_id`) REFERENCES `imenus` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `imenu_iaccesses_ibfk_2` FOREIGN KEY (`iaccess_bit`) REFERENCES `iaccesses` (`bit`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `ipasswordresets`
--
ALTER TABLE `ipasswordresets`
  ADD CONSTRAINT `ipasswordresets_ibfk_1` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `itinerarymapdategps`
--
ALTER TABLE `itinerarymapdategps`
  ADD CONSTRAINT `itinerarymapdategps_ibfk_1` FOREIGN KEY (`gps_id`) REFERENCES `gps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `itinerarymapdategps_ibfk_2` FOREIGN KEY (`itinerarymapdate_id`) REFERENCES `itinerarymapdates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `itinerarymapdategpsdetails`
--
ALTER TABLE `itinerarymapdategpsdetails`
  ADD CONSTRAINT `itinerarymapdategpsdetails_ibfk_1` FOREIGN KEY (`itinerarymapdategps_id`) REFERENCES `itinerarymapdategps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `itinerarymapdategpsdetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `itinerarymapdates`
--
ALTER TABLE `itinerarymapdates`
  ADD CONSTRAINT `itinerarymapdates_ibfk_1` FOREIGN KEY (`itinerarymap_id`) REFERENCES `itinerarymaps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `itinerarymaps`
--
ALTER TABLE `itinerarymaps`
  ADD CONSTRAINT `itinerarymaps_ibfk_1` FOREIGN KEY (`booking_id`) REFERENCES `bookings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `itinerarymaps_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `itinerarymaps_ibfk_3` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `itinerarymaps_ibfk_4` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `iuser_apps`
--
ALTER TABLE `iuser_apps`
  ADD CONSTRAINT `iuserApp_IuserFK` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `iuserApp_appFK` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `iuser_groups`
--
ALTER TABLE `iuser_groups`
  ADD CONSTRAINT `iuser_groups_ibfk_1` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `iuser_groups_ibfk_2` FOREIGN KEY (`iusergroup_id`) REFERENCES `iusergroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `iuser_roles`
--
ALTER TABLE `iuser_roles`
  ADD CONSTRAINT `iuser_roles_ibfk_1` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `iuser_roles_ibfk_2` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `iuser_taskorder`
--
ALTER TABLE `iuser_taskorder`
  ADD CONSTRAINT `iuser_taskorder_ibfk_1` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `iuser_taskorder_ibfk_2` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `labeldetails`
--
ALTER TABLE `labeldetails`
  ADD CONSTRAINT `labeldetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `labeldetails_ibfk_3` FOREIGN KEY (`label_id`) REFERENCES `labels` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `lcproducttext_appcategories`
--
ALTER TABLE `lcproducttext_appcategories`
  ADD CONSTRAINT `lcproducttext_appcategories_ibfk_1` FOREIGN KEY (`appcategory_id`) REFERENCES `appcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `lcsuppliertext_appcategories`
--
ALTER TABLE `lcsuppliertext_appcategories`
  ADD CONSTRAINT `lcsuppliertext_appcategories_ibfk_1` FOREIGN KEY (`appcategory_id`) REFERENCES `appcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `lczonedescription_appcategories`
--
ALTER TABLE `lczonedescription_appcategories`
  ADD CONSTRAINT `lczonedescription_appcategories_ibfk_1` FOREIGN KEY (`appcategory_id`) REFERENCES `appcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `localities`
--
ALTER TABLE `localities`
  ADD CONSTRAINT `localities_ibfk_4` FOREIGN KEY (`port_id`) REFERENCES `ports` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `localities_ibfk_5` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `localityappcontentreviewed`
--
ALTER TABLE `localityappcontentreviewed`
  ADD CONSTRAINT `fk_app_lolappcontreview` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_locality_lolappcontreview` FOREIGN KEY (`locality_id`) REFERENCES `localities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_type_lolappcontreview` FOREIGN KEY (`contenttype_id`) REFERENCES `contenttypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_user_lolappcontreview` FOREIGN KEY (`user_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `localityappenabled`
--
ALTER TABLE `localityappenabled`
  ADD CONSTRAINT `fk_app_lolappena` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_locality_appena` FOREIGN KEY (`locality_id`) REFERENCES `localities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_user_lolappena` FOREIGN KEY (`user_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `localitycontentposition`
--
ALTER TABLE `localitycontentposition`
  ADD CONSTRAINT `localitycontentposition_ibfk_1` FOREIGN KEY (`appcategory_id`) REFERENCES `appcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `localitycontentposition_ibfk_2` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `localitycontentposition_ibfk_3` FOREIGN KEY (`locality_id`) REFERENCES `localities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `localitydetails`
--
ALTER TABLE `localitydetails`
  ADD CONSTRAINT `localitydetails_ibfk_5` FOREIGN KEY (`locality_id`) REFERENCES `localities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `localitydetails_ibfk_6` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `locality_media`
--
ALTER TABLE `locality_media`
  ADD CONSTRAINT `locality_media_ibfk_1` FOREIGN KEY (`locality_id`) REFERENCES `localities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `locality_media_ibfk_2` FOREIGN KEY (`appmediatemplate_id`) REFERENCES `app_mediatemplates` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `locality_tags`
--
ALTER TABLE `locality_tags`
  ADD CONSTRAINT `locality_tags_ibfk_1` FOREIGN KEY (`locality_id`) REFERENCES `localities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `locality_videos`
--
ALTER TABLE `locality_videos`
  ADD CONSTRAINT `locality_videos_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `locality_videos_ibfk_3` FOREIGN KEY (`locality_id`) REFERENCES `localities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `locality_videos_ibfk_4` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `locationappcontentreviewed`
--
ALTER TABLE `locationappcontentreviewed`
  ADD CONSTRAINT `fk_app_locappcontreview` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_location_locappcontreview` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_type_locappcontreview` FOREIGN KEY (`contenttype_id`) REFERENCES `contenttypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_user_locappcontreview` FOREIGN KEY (`user_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `locationappenabled`
--
ALTER TABLE `locationappenabled`
  ADD CONSTRAINT `fk_app_locappena` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_location_appena` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_user_locappena` FOREIGN KEY (`user_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `locationcontentposition`
--
ALTER TABLE `locationcontentposition`
  ADD CONSTRAINT `locationcontentposition_ibfk_1` FOREIGN KEY (`appcategory_id`) REFERENCES `appcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `locationcontentposition_ibfk_2` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `locationcontentposition_ibfk_3` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `locationdetails`
--
ALTER TABLE `locationdetails`
  ADD CONSTRAINT `locationdetails_ibfk_5` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `locationdetails_ibfk_6` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `locations`
--
ALTER TABLE `locations`
  ADD CONSTRAINT `locations_ibfk_4` FOREIGN KEY (`region_id`) REFERENCES `regions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `location_media`
--
ALTER TABLE `location_media`
  ADD CONSTRAINT `location_media_ibfk_1` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `location_media_ibfk_2` FOREIGN KEY (`appmediatemplate_id`) REFERENCES `app_mediatemplates` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `location_tags`
--
ALTER TABLE `location_tags`
  ADD CONSTRAINT `location_tags_ibfk_1` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `location_videos`
--
ALTER TABLE `location_videos`
  ADD CONSTRAINT `location_videos_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `location_videos_ibfk_3` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `location_videos_ibfk_4` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `luggagesolutiondetails`
--
ALTER TABLE `luggagesolutiondetails`
  ADD CONSTRAINT `luggagesolutiondetails_ibfk_1` FOREIGN KEY (`luggagesolution_id`) REFERENCES `luggagesolutions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `luggagesolutiondetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `maileraddresses`
--
ALTER TABLE `maileraddresses`
  ADD CONSTRAINT `maileraddresses_ibfk_2` FOREIGN KEY (`maileraddresstype_id`) REFERENCES `maileradresstypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `maileraddresses_ibfk_3` FOREIGN KEY (`mailerqueue_id`) REFERENCES `mailerqueue` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `mailerqueue`
--
ALTER TABLE `mailerqueue`
  ADD CONSTRAINT `mailerqueue_ibfk_1` FOREIGN KEY (`maileraccount_id`) REFERENCES `maileraccounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `mailertemplates`
--
ALTER TABLE `mailertemplates`
  ADD CONSTRAINT `mailertemplates_ibfk_1` FOREIGN KEY (`maileraccount_id`) REFERENCES `maileraccounts` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `mailertemplatevariables`
--
ALTER TABLE `mailertemplatevariables`
  ADD CONSTRAINT `mailertemplatevariables_ibfk_1` FOREIGN KEY (`mailertemplate_id`) REFERENCES `mailertemplates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `notedetails`
--
ALTER TABLE `notedetails`
  ADD CONSTRAINT `notedetails_ibfk_1` FOREIGN KEY (`note_id`) REFERENCES `notes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `notedetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `notes`
--
ALTER TABLE `notes`
  ADD CONSTRAINT `notes_ibfk_1` FOREIGN KEY (`notecategory_id`) REFERENCES `notecategories` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `note_iusergroups`
--
ALTER TABLE `note_iusergroups`
  ADD CONSTRAINT `note_iusergroups_ibfk_1` FOREIGN KEY (`iusergroup_id`) REFERENCES `iusergroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `note_iusergroups_ibfk_2` FOREIGN KEY (`note_id`) REFERENCES `notes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `note_iusers`
--
ALTER TABLE `note_iusers`
  ADD CONSTRAINT `note_iusers_ibfk_1` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `note_iusers_ibfk_2` FOREIGN KEY (`note_id`) REFERENCES `notes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `notifications`
--
ALTER TABLE `notifications`
  ADD CONSTRAINT `notifications_ibfk_1` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `notifications_ibfk_2` FOREIGN KEY (`iusergroup_id`) REFERENCES `iusergroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `notifications_ibfk_3` FOREIGN KEY (`created_by`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `notifications_ibfk_4` FOREIGN KEY (`notificationcategory_id`) REFERENCES `notificationcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `notifications_ibfk_5` FOREIGN KEY (`exuser_id`) REFERENCES `exusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `notifications_ibfk_7` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `not__templatevariables`
--
ALTER TABLE `not__templatevariables`
  ADD CONSTRAINT `not__templatevariables_ibfk_1` FOREIGN KEY (`template_id`) REFERENCES `not__templates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `othertextcontent_history`
--
ALTER TABLE `othertextcontent_history`
  ADD CONSTRAINT `othertxtconth_othertxt` FOREIGN KEY (`othertext_id`) REFERENCES `others_texts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `othertext_contents`
--
ALTER TABLE `othertext_contents`
  ADD CONSTRAINT `othertxtcont_othertxt` FOREIGN KEY (`othertext_id`) REFERENCES `others_texts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `othertext_images`
--
ALTER TABLE `othertext_images`
  ADD CONSTRAINT `othertxtimg_othertxt` FOREIGN KEY (`othertext_id`) REFERENCES `others_texts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `othertext_tags`
--
ALTER TABLE `othertext_tags`
  ADD CONSTRAINT `othertxttag_othertxt` FOREIGN KEY (`othertext_id`) REFERENCES `others_texts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `packages`
--
ALTER TABLE `packages`
  ADD CONSTRAINT `packages_ibfk_1` FOREIGN KEY (`pcm_id`) REFERENCES `pcms` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `packages_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `paymentconditions`
--
ALTER TABLE `paymentconditions`
  ADD CONSTRAINT `paymentconditions_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `paymentconditions_ibfk_2` FOREIGN KEY (`paymentconditiontype_id`) REFERENCES `paymentconditiontypes` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `pcm_details`
--
ALTER TABLE `pcm_details`
  ADD CONSTRAINT `pcm_details_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `pcmdet_pcm` FOREIGN KEY (`pcm_id`) REFERENCES `pcms` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `pri__pricecode_customers`
--
ALTER TABLE `pri__pricecode_customers`
  ADD CONSTRAINT `pri__pricecode_customers_ibfk_2` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `pri__pricecode_customers_ibfk_3` FOREIGN KEY (`pricecode_id`) REFERENCES `pri__pricecodes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `pri__pricecode_customers_ibfk_4` FOREIGN KEY (`pricecode_id`) REFERENCES `pri__pricecodes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `pri__priceperiods`
--
ALTER TABLE `pri__priceperiods`
  ADD CONSTRAINT `pri__priceperiods_ibfk_1` FOREIGN KEY (`pricecode_id`) REFERENCES `pri__pricecodes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `pri__priceperiods_ibfk_2` FOREIGN KEY (`provision_id`) REFERENCES `pri__provisions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `priceperiods_ibfk_5` FOREIGN KEY (`currency_id`) REFERENCES `ref__currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `priceperiods_ibfk_7` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `pri__priceperiodsalesdates`
--
ALTER TABLE `pri__priceperiodsalesdates`
  ADD CONSTRAINT `pri__priceperiodsalesdates_ibfk_1` FOREIGN KEY (`priceperiod_id`) REFERENCES `pri__priceperiods` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `pri__priceperiodservices`
--
ALTER TABLE `pri__priceperiodservices`
  ADD CONSTRAINT `pri__priceperiodservices_ibfk_1` FOREIGN KEY (`priceperiod_id`) REFERENCES `pri__priceperiods` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `pri__priceperiodservices_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `pri__priceperiodshistory`
--
ALTER TABLE `pri__priceperiodshistory`
  ADD CONSTRAINT `pri__priceperiodshistory_ibfk_2` FOREIGN KEY (`priceperiod_id`) REFERENCES `pri__priceperiods` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `pri__priceperiodshistory_ibfk_3` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `pri__priceperiodstayoffers`
--
ALTER TABLE `pri__priceperiodstayoffers`
  ADD CONSTRAINT `pri__priceperiodstayoffers_ibfk_1` FOREIGN KEY (`priceperiod_id`) REFERENCES `pri__priceperiods` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `pri__priceperiodtimeoffers`
--
ALTER TABLE `pri__priceperiodtimeoffers`
  ADD CONSTRAINT `pri__priceperiodtimeoffers_ibfk_1` FOREIGN KEY (`priceperiod_id`) REFERENCES `pri__priceperiods` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `pri__prices`
--
ALTER TABLE `pri__prices`
  ADD CONSTRAINT `pri__prices_ibfk_2` FOREIGN KEY (`priceperiod_id`) REFERENCES `pri__priceperiods` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `pri__pricingruledetails`
--
ALTER TABLE `pri__pricingruledetails`
  ADD CONSTRAINT `pri__pricingruledetails_ibfk_1` FOREIGN KEY (`pricingrule_id`) REFERENCES `pri__pricingrules` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `productanalysis`
--
ALTER TABLE `productanalysis`
  ADD CONSTRAINT `productanalysis_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `productanalysis_ibfk_2` FOREIGN KEY (`analysis1`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `productanalysis_ibfk_3` FOREIGN KEY (`analysis2`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `productanalysis_ibfk_4` FOREIGN KEY (`analysis3`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `productanalysis_ibfk_5` FOREIGN KEY (`analysis4`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `productanalysis_ibfk_6` FOREIGN KEY (`analysis5`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `productanalysis_ibfk_7` FOREIGN KEY (`analysis6`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `productappcontentreviewed`
--
ALTER TABLE `productappcontentreviewed`
  ADD CONSTRAINT `fk_app_prdappcontreview` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_product_prdappcontreview` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_type_prdappcontreview` FOREIGN KEY (`contenttype_id`) REFERENCES `contenttypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_user_prdappcontreview` FOREIGN KEY (`user_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `productappenabled`
--
ALTER TABLE `productappenabled`
  ADD CONSTRAINT `fk_app_prdappena` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_product_appena` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_user_prdappena` FOREIGN KEY (`user_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `productcontentposition`
--
ALTER TABLE `productcontentposition`
  ADD CONSTRAINT `productcontentposition_ibfk_1` FOREIGN KEY (`appcategory_id`) REFERENCES `appcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `productcontentposition_ibfk_2` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `productcontentposition_ibfk_3` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `productdestinations`
--
ALTER TABLE `productdestinations`
  ADD CONSTRAINT `productdestinations_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `productdestinations_ibfk_2` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `productdestinations_ibfk_3` FOREIGN KEY (`region_id`) REFERENCES `regions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `productdestinations_ibfk_4` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `productdestinations_ibfk_5` FOREIGN KEY (`locality_id`) REFERENCES `localities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `productdetails`
--
ALTER TABLE `productdetails`
  ADD CONSTRAINT `prddet_lang` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `productdetails_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `productextradetails`
--
ALTER TABLE `productextradetails`
  ADD CONSTRAINT `productextradetails_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `productextras` (`product_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `productextradetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `productextras`
--
ALTER TABLE `productextras`
  ADD CONSTRAINT `productextras_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `productpax`
--
ALTER TABLE `productpax`
  ADD CONSTRAINT `productpax_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `products`
--
ALTER TABLE `products`
  ADD CONSTRAINT `FK_supplier_id` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `products_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `products` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `producttextcontent_history`
--
ALTER TABLE `producttextcontent_history`
  ADD CONSTRAINT `prdtxtconth_prdtxt` FOREIGN KEY (`producttext_id`) REFERENCES `product_texts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `producttext_contents`
--
ALTER TABLE `producttext_contents`
  ADD CONSTRAINT `prdtxtcont_prdtxt` FOREIGN KEY (`producttext_id`) REFERENCES `product_texts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `producttext_contents_ibfk_1` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `product_additionalproducts`
--
ALTER TABLE `product_additionalproducts`
  ADD CONSTRAINT `product_additionalproducts_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `product_additionalproducts_ibfk_2` FOREIGN KEY (`addproduct_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `product_amenities`
--
ALTER TABLE `product_amenities`
  ADD CONSTRAINT `product_amenities_ibfk_3` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `product_amenities_ibfk_4` FOREIGN KEY (`amenity_id`) REFERENCES `amenities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `product_documents`
--
ALTER TABLE `product_documents`
  ADD CONSTRAINT `product_documents_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `product_documents_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `product_documents_ibfk_3` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `product_images`
--
ALTER TABLE `product_images`
  ADD CONSTRAINT `product_images_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `product_includedproducts`
--
ALTER TABLE `product_includedproducts`
  ADD CONSTRAINT `product_includedproducts_ibfk_3` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `product_includedproducts_ibfk_4` FOREIGN KEY (`incproduct_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `product_media`
--
ALTER TABLE `product_media`
  ADD CONSTRAINT `product_media_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `product_media_ibfk_2` FOREIGN KEY (`appmediatemplate_id`) REFERENCES `app_mediatemplates` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `product_options`
--
ALTER TABLE `product_options`
  ADD CONSTRAINT `product_options_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `product_options_ibfk_2` FOREIGN KEY (`productoption_id`) REFERENCES `productoptions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `product_tags`
--
ALTER TABLE `product_tags`
  ADD CONSTRAINT `product_tags_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `product_texts`
--
ALTER TABLE `product_texts`
  ADD CONSTRAINT `product_texts_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `product_videos`
--
ALTER TABLE `product_videos`
  ADD CONSTRAINT `product_videos_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `product_videos_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `product_videos_ibfk_3` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `projects`
--
ALTER TABLE `projects`
  ADD CONSTRAINT `projects_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `projects` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `projects_ibfk_2` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `projecttemplates`
--
ALTER TABLE `projecttemplates`
  ADD CONSTRAINT `projecttemplates_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `projecttemplates` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `projecttemplates_ibfk_2` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `projecttemplate_iusergroups`
--
ALTER TABLE `projecttemplate_iusergroups`
  ADD CONSTRAINT `projecttemplate_iusergroups_ibfk_1` FOREIGN KEY (`iusergroup_id`) REFERENCES `iusergroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `projecttemplate_iusergroups_ibfk_2` FOREIGN KEY (`projecttemplate_id`) REFERENCES `projecttemplates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `projecttemplate_iusers`
--
ALTER TABLE `projecttemplate_iusers`
  ADD CONSTRAINT `projecttemplate_iusers_ibfk_1` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `projecttemplate_iusers_ibfk_2` FOREIGN KEY (`projecttemplate_id`) REFERENCES `projecttemplates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `project_bookings`
--
ALTER TABLE `project_bookings`
  ADD CONSTRAINT `project_bookings_ibfk_2` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `project_contacts`
--
ALTER TABLE `project_contacts`
  ADD CONSTRAINT `project_contacts_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `project_contacts_ibfk_2` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `project_iusergroups`
--
ALTER TABLE `project_iusergroups`
  ADD CONSTRAINT `project_iusergroups_ibfk_1` FOREIGN KEY (`iusergroup_id`) REFERENCES `iusergroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `project_iusergroups_ibfk_2` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `project_iusers`
--
ALTER TABLE `project_iusers`
  ADD CONSTRAINT `project_iusers_ibfk_1` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `project_iusers_ibfk_2` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `ref__continentdetails`
--
ALTER TABLE `ref__continentdetails`
  ADD CONSTRAINT `ref__continentdetails_ibfk_1` FOREIGN KEY (`ref__region_id`) REFERENCES `ref__continents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ref__continentdetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `ref__countrydetails`
--
ALTER TABLE `ref__countrydetails`
  ADD CONSTRAINT `ref__countrydetails_ibfk_1` FOREIGN KEY (`ref__country_id`) REFERENCES `ref__countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ref__countrydetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `ref__country_currencies`
--
ALTER TABLE `ref__country_currencies`
  ADD CONSTRAINT `ref__country_currencies_ibfk_1` FOREIGN KEY (`ref__country_id`) REFERENCES `ref__countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ref__country_currencies_ibfk_2` FOREIGN KEY (`ref__currency_id`) REFERENCES `ref__currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `ref__subcontinentdetails`
--
ALTER TABLE `ref__subcontinentdetails`
  ADD CONSTRAINT `ref__subcontinentdetails_ibfk_1` FOREIGN KEY (`ref__subregion_id`) REFERENCES `ref__subcontinents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ref__subcontinentdetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `ref__subcontinents`
--
ALTER TABLE `ref__subcontinents`
  ADD CONSTRAINT `ref__subcontinents_ibfk_1` FOREIGN KEY (`ref__region_id`) REFERENCES `ref__continents` (`id`);

--
-- Constraints for table `regionappcontentreviewed`
--
ALTER TABLE `regionappcontentreviewed`
  ADD CONSTRAINT `fk_app_regappcontreview` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_region_regappcontreview` FOREIGN KEY (`region_id`) REFERENCES `regions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_type_regappcontreview` FOREIGN KEY (`contenttype_id`) REFERENCES `contenttypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_user_regappcontreview` FOREIGN KEY (`user_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `regionappenabled`
--
ALTER TABLE `regionappenabled`
  ADD CONSTRAINT `fk_app_regappena` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_region_appena` FOREIGN KEY (`region_id`) REFERENCES `regions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_user_regappena` FOREIGN KEY (`user_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `regioncontentposition`
--
ALTER TABLE `regioncontentposition`
  ADD CONSTRAINT `regioncontentposition_ibfk_1` FOREIGN KEY (`appcategory_id`) REFERENCES `appcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `regioncontentposition_ibfk_2` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `regioncontentposition_ibfk_3` FOREIGN KEY (`region_id`) REFERENCES `regions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `regiondetails`
--
ALTER TABLE `regiondetails`
  ADD CONSTRAINT `regiondetails_ibfk_5` FOREIGN KEY (`region_id`) REFERENCES `regions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `regiondetails_ibfk_6` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `regions`
--
ALTER TABLE `regions`
  ADD CONSTRAINT `regions_ibfk_4` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `region_media`
--
ALTER TABLE `region_media`
  ADD CONSTRAINT `region_media_ibfk_1` FOREIGN KEY (`region_id`) REFERENCES `regions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `region_media_ibfk_2` FOREIGN KEY (`appmediatemplate_id`) REFERENCES `app_mediatemplates` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `region_tags`
--
ALTER TABLE `region_tags`
  ADD CONSTRAINT `region_tags_ibfk_1` FOREIGN KEY (`region_id`) REFERENCES `regions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `region_videos`
--
ALTER TABLE `region_videos`
  ADD CONSTRAINT `region_videos_ibfk_1` FOREIGN KEY (`region_id`) REFERENCES `regions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `region_videos_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `region_videos_ibfk_3` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `replacement_products`
--
ALTER TABLE `replacement_products`
  ADD CONSTRAINT `replacement_products_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `replacement_products_ibfk_2` FOREIGN KEY (`rproduct_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `roles_iaccesses`
--
ALTER TABLE `roles_iaccesses`
  ADD CONSTRAINT `roles_iaccesses_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `roles_iaccesses_ibfk_2` FOREIGN KEY (`iaccess_id`) REFERENCES `iaccesses` (`bit`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `roomconfigurationpaxs`
--
ALTER TABLE `roomconfigurationpaxs`
  ADD CONSTRAINT `paxs` FOREIGN KEY (`pax_id`) REFERENCES `paxs` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `roomconfigurationpaxs_ibfk_1` FOREIGN KEY (`roomconfiguration_id`) REFERENCES `roomconfigurations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `roomconfigurations`
--
ALTER TABLE `roomconfigurations`
  ADD CONSTRAINT `fk3_bookingdetail` FOREIGN KEY (`bookingdetail_id`) REFERENCES `be__bookingdetails` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk3_bslid` FOREIGN KEY (`bsl_id`) REFERENCES `booking_details` (`bsl_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `roompolicies`
--
ALTER TABLE `roompolicies`
  ADD CONSTRAINT `roompolicies_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `sea__public`
--
ALTER TABLE `sea__public`
  ADD CONSTRAINT `sea__public_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `sea__public_ibfk_2` FOREIGN KEY (`fromlocation_id`) REFERENCES `locations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `sea__public_ibfk_3` FOREIGN KEY (`fromlocality_id`) REFERENCES `localities` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `sea__public_ibfk_4` FOREIGN KEY (`tolocation_id`) REFERENCES `locations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `sea__public_ibfk_5` FOREIGN KEY (`tolocality_id`) REFERENCES `localities` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `sea__public_apps`
--
ALTER TABLE `sea__public_apps`
  ADD CONSTRAINT `sea__public_apps_ibfk_1` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `sea__public_apps_ibfk_2` FOREIGN KEY (`public_id`) REFERENCES `sea__public` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `sea__public_languages`
--
ALTER TABLE `sea__public_languages`
  ADD CONSTRAINT `sea__public_languages_ibfk_1` FOREIGN KEY (`public_id`) REFERENCES `sea__public` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `sea__public_languages_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `sea__related`
--
ALTER TABLE `sea__related`
  ADD CONSTRAINT `sea__related_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `sea__related_ibfk_2` FOREIGN KEY (`dmc_id`) REFERENCES `latincon_api_d`.`dmcs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `sea__statusrules`
--
ALTER TABLE `sea__statusrules`
  ADD CONSTRAINT `sea__statusrules_ibfk_1` FOREIGN KEY (`status_id`) REFERENCES `sea__statuses` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `sections`
--
ALTER TABLE `sections`
  ADD CONSTRAINT `sect_booking` FOREIGN KEY (`booking_id`) REFERENCES `bookings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `sect_bookingdet` FOREIGN KEY (`bookingdetail_id`) REFERENCES `booking_details` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `sect_pcm` FOREIGN KEY (`pcm_id`) REFERENCES `pcms` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `sect_pcmdet` FOREIGN KEY (`pcmdetail_id`) REFERENCES `pcm_details` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `sect_pkgsect` FOREIGN KEY (`pkg_section_id`) REFERENCES `sections` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `section_imagedetail`
--
ALTER TABLE `section_imagedetail`
  ADD CONSTRAINT `sectimgdet_sect` FOREIGN KEY (`section_id`) REFERENCES `sections` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `section_otherdetail`
--
ALTER TABLE `section_otherdetail`
  ADD CONSTRAINT `sectothdet_sect` FOREIGN KEY (`section_id`) REFERENCES `sections` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `section_productdetail`
--
ALTER TABLE `section_productdetail`
  ADD CONSTRAINT `sectprddet_sect` FOREIGN KEY (`section_id`) REFERENCES `sections` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `section_services`
--
ALTER TABLE `section_services`
  ADD CONSTRAINT `sectserv_sect` FOREIGN KEY (`section_id`) REFERENCES `sections` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `section_servicesdetail`
--
ALTER TABLE `section_servicesdetail`
  ADD CONSTRAINT `sectservdet_sectserv` FOREIGN KEY (`section_services_id`) REFERENCES `section_services` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `serviceanalysis`
--
ALTER TABLE `serviceanalysis`
  ADD CONSTRAINT `serviceanalysis_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `serviceanalysis_ibfk_2` FOREIGN KEY (`productanalysis1`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `serviceanalysis_ibfk_3` FOREIGN KEY (`productanalysis2`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `serviceanalysis_ibfk_4` FOREIGN KEY (`productanalysis3`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `serviceanalysis_ibfk_5` FOREIGN KEY (`productanalysis4`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `serviceanalysis_ibfk_6` FOREIGN KEY (`productanalysis5`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `serviceanalysis_ibfk_7` FOREIGN KEY (`productanalysis6`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `servicecodes`
--
ALTER TABLE `servicecodes`
  ADD CONSTRAINT `servicecodes_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `servicedetails`
--
ALTER TABLE `servicedetails`
  ADD CONSTRAINT `servicedetails_ibfk_5` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `servicedetails_ibfk_6` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `service_bakusections`
--
ALTER TABLE `service_bakusections`
  ADD CONSTRAINT `service_bakusections_ibfk_1` FOREIGN KEY (`bakusection_id`) REFERENCES `bakusections` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `service_bakusections_ibfk_2` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `service_options`
--
ALTER TABLE `service_options`
  ADD CONSTRAINT `service_options_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `service_options_ibfk_2` FOREIGN KEY (`serviceoption_id`) REFERENCES `serviceoptions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `ser__series`
--
ALTER TABLE `ser__series`
  ADD CONSTRAINT `ser__series_ibfk_1` FOREIGN KEY (`pcm_id`) REFERENCES `pcms` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ser__series_ibfk_2` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ser__series_ibfk_3` FOREIGN KEY (`iusergroup_id`) REFERENCES `iusergroups` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `ser__series_ibfk_4` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `ser__seriesdetail_allotments`
--
ALTER TABLE `ser__seriesdetail_allotments`
  ADD CONSTRAINT `ser__seriesdetail_allotments_ibfk_1` FOREIGN KEY (`allotment_id`) REFERENCES `all__allotments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ser__seriesdetail_allotments_ibfk_2` FOREIGN KEY (`seriesdetail_id`) REFERENCES `ser__seriesgroupdetails` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `ser__seriesgroupdetails`
--
ALTER TABLE `ser__seriesgroupdetails`
  ADD CONSTRAINT `ser__seriesgroupdetails_ibfk_1` FOREIGN KEY (`seriesgroup_id`) REFERENCES `ser__seriesgroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ser__seriesgroupdetails_ibfk_2` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ser__seriesgroupdetails_ibfk_3` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ser__seriesgroupdetails_ibfk_4` FOREIGN KEY (`pcmdetail_id`) REFERENCES `pcm_details` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `ser__seriesgroupdetails_ibfk_5` FOREIGN KEY (`bookingdetail_id`) REFERENCES `booking_details` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `ser__seriesgroupdetailsales`
--
ALTER TABLE `ser__seriesgroupdetailsales`
  ADD CONSTRAINT `ser__seriesgroupdetailsales_ibfk_1` FOREIGN KEY (`seriesgroupdetail_id`) REFERENCES `ser__seriesgroupdetails` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ser__seriesgroupdetailsales_ibfk_2` FOREIGN KEY (`occupations_id`) REFERENCES `occupations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `ser__seriesgroups`
--
ALTER TABLE `ser__seriesgroups`
  ADD CONSTRAINT `ser__seriesgroups_ibfk_1` FOREIGN KEY (`serial_id`) REFERENCES `ser__series` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ser__seriesgroups_ibfk_2` FOREIGN KEY (`booking_id`) REFERENCES `bookings` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `ser__seriesgroups_ibfk_3` FOREIGN KEY (`pcm_id`) REFERENCES `pcms` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `ser__seriesgroup_bookingfilters`
--
ALTER TABLE `ser__seriesgroup_bookingfilters`
  ADD CONSTRAINT `ser__seriesgroup_bookingfilters_ibfk_1` FOREIGN KEY (`booking_id`) REFERENCES `bookings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ser__seriesgroup_bookingfilters_ibfk_2` FOREIGN KEY (`seriesgroup_id`) REFERENCES `ser__seriesgroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `ser__seriesgroup_bookings`
--
ALTER TABLE `ser__seriesgroup_bookings`
  ADD CONSTRAINT `ser__seriesgroup_bookings_ibfk_1` FOREIGN KEY (`booking_id`) REFERENCES `bookings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ser__seriesgroup_bookings_ibfk_2` FOREIGN KEY (`seriesgroup_id`) REFERENCES `ser__seriesgroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `ser__seriessupplieralts`
--
ALTER TABLE `ser__seriessupplieralts`
  ADD CONSTRAINT `ser__seriessupplieralts_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ser__seriessupplieralts_ibfk_3` FOREIGN KEY (`altsupplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ser__seriessupplieralts_ibfk_4` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `settings`
--
ALTER TABLE `settings`
  ADD CONSTRAINT `settings_ibfk_1` FOREIGN KEY (`settingstype_id`) REFERENCES `settingtypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `socialmedia`
--
ALTER TABLE `socialmedia`
  ADD CONSTRAINT `fk_socialmedia_contacts1` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_socialmedia_socialmediatypes1` FOREIGN KEY (`socialmediatype_id`) REFERENCES `socialmediatypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `sst_bookingdetailstatuses`
--
ALTER TABLE `sst_bookingdetailstatuses`
  ADD CONSTRAINT `fk_bookingdetailstatus` FOREIGN KEY (`bookingdetailstatus_id`) REFERENCES `bookingdetailstatuses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `supplieranalysis`
--
ALTER TABLE `supplieranalysis`
  ADD CONSTRAINT `supplieranalysis_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `supplieranalysis_ibfk_2` FOREIGN KEY (`analysis1`) REFERENCES `tp__supplieranalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `supplieranalysis_ibfk_3` FOREIGN KEY (`analysis2`) REFERENCES `tp__supplieranalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `supplieranalysis_ibfk_4` FOREIGN KEY (`analysis3`) REFERENCES `tp__supplieranalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `supplieranalysis_ibfk_5` FOREIGN KEY (`analysis4`) REFERENCES `tp__supplieranalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `supplieranalysis_ibfk_6` FOREIGN KEY (`analysis5`) REFERENCES `tp__supplieranalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `supplieranalysis_ibfk_7` FOREIGN KEY (`analysis6`) REFERENCES `tp__supplieranalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `supplierappcontentreviewed`
--
ALTER TABLE `supplierappcontentreviewed`
  ADD CONSTRAINT `fk_app_suppappcontreview` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_supplier_suppappcontreview` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_type_suppappcontreview` FOREIGN KEY (`contenttype_id`) REFERENCES `contenttypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_user_suppappcontreview` FOREIGN KEY (`user_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `supplierappenabled`
--
ALTER TABLE `supplierappenabled`
  ADD CONSTRAINT `fk_app_appena` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_supplier_appena` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_user_appena` FOREIGN KEY (`user_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `supplierbanks`
--
ALTER TABLE `supplierbanks`
  ADD CONSTRAINT `supplierbanks_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `supplierbanks_ibfk_3` FOREIGN KEY (`bank_id`) REFERENCES `banks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `supplierbanks_ibfk_4` FOREIGN KEY (`identificationtype_id`) REFERENCES `identificationtypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `supplierbanks_ibfk_5` FOREIGN KEY (`currency_id`) REFERENCES `ref__currencies` (`code`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `suppliercontactroles`
--
ALTER TABLE `suppliercontactroles`
  ADD CONSTRAINT `suppliercontactroles_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `suppliercontactroles_ibfk_3` FOREIGN KEY (`contactrole_id`) REFERENCES `contactroles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `suppliercontactroles_ibfk_4` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `suppliercontactrole_contactemails`
--
ALTER TABLE `suppliercontactrole_contactemails`
  ADD CONSTRAINT `suppliercontactrole_contactemails_ibfk_1` FOREIGN KEY (`suppliercontactrole_id`) REFERENCES `suppliercontactroles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `suppliercontactrole_contactemails_ibfk_2` FOREIGN KEY (`contactemail_id`) REFERENCES `contactemails` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `suppliercontactrole_contactphones`
--
ALTER TABLE `suppliercontactrole_contactphones`
  ADD CONSTRAINT `suppliercontactrole_contactphones_ibfk_1` FOREIGN KEY (`suppliercontactrole_id`) REFERENCES `suppliercontactroles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `suppliercontactrole_contactphones_ibfk_2` FOREIGN KEY (`contactphone_id`) REFERENCES `contactphones` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `suppliercontentposition`
--
ALTER TABLE `suppliercontentposition`
  ADD CONSTRAINT `suppliercontentposition_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `suppliercontentposition_ibfk_2` FOREIGN KEY (`appcategory_id`) REFERENCES `appcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `suppliercontentposition_ibfk_3` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `supplierpricefiles`
--
ALTER TABLE `supplierpricefiles`
  ADD CONSTRAINT `supplierFk` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `suppliers`
--
ALTER TABLE `suppliers`
  ADD CONSTRAINT `suppliers_ibfk_11` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `suppliers_ibfk_12` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `suppliers_restrictedmarkets`
--
ALTER TABLE `suppliers_restrictedmarkets`
  ADD CONSTRAINT `suppliers_restrictedmarkets_ibfk_3` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `suppliers_restrictedmarkets_ibfk_4` FOREIGN KEY (`ref__country_id`) REFERENCES `ref__countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `suppliertextcontent_history`
--
ALTER TABLE `suppliertextcontent_history`
  ADD CONSTRAINT `supptxtconth_supptxt` FOREIGN KEY (`suppliertext_id`) REFERENCES `supplier_texts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `suppliertext_contents`
--
ALTER TABLE `suppliertext_contents`
  ADD CONSTRAINT `suppliertext_contents_ibfk_1` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `supptxtcont_supptxt` FOREIGN KEY (`suppliertext_id`) REFERENCES `supplier_texts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `supplier_access`
--
ALTER TABLE `supplier_access`
  ADD CONSTRAINT `supplier_access_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `supplier_amenities`
--
ALTER TABLE `supplier_amenities`
  ADD CONSTRAINT `supplier_amenities_ibfk_2` FOREIGN KEY (`amenity_id`) REFERENCES `amenities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `supplier_amenities_ibfk_3` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `supplier_amenitychanges`
--
ALTER TABLE `supplier_amenitychanges`
  ADD CONSTRAINT `supplier_amenitychanges_ibfk_1` FOREIGN KEY (`amenity_id`) REFERENCES `amenities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `supplier_amenitychanges_ibfk_2` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `supplier_documents`
--
ALTER TABLE `supplier_documents`
  ADD CONSTRAINT `supplier_documents_ibfk_2` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `supplier_documents_ibfk_3` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `supplier_documents_ibfk_4` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `supplier_images`
--
ALTER TABLE `supplier_images`
  ADD CONSTRAINT `suppimg_prd` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `supplier_media`
--
ALTER TABLE `supplier_media`
  ADD CONSTRAINT `supplier_media_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `supplier_media_ibfk_2` FOREIGN KEY (`appmediatemplate_id`) REFERENCES `app_mediatemplates` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `supplier_mediareview`
--
ALTER TABLE `supplier_mediareview`
  ADD CONSTRAINT `supplier_mediareview_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `supplier_options`
--
ALTER TABLE `supplier_options`
  ADD CONSTRAINT `supplier_options_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `supplier_options_ibfk_2` FOREIGN KEY (`supplieroption_id`) REFERENCES `supplieroptions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `supplier_tags`
--
ALTER TABLE `supplier_tags`
  ADD CONSTRAINT `supplier_tags_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `supplier_texts`
--
ALTER TABLE `supplier_texts`
  ADD CONSTRAINT `supptxt_prd` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `supplier_videos`
--
ALTER TABLE `supplier_videos`
  ADD CONSTRAINT `supplier_videos_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `supplier_videos_ibfk_3` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `supplier_videos_ibfk_4` FOREIGN KEY (`app_id`) REFERENCES `apps` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `taskcomments`
--
ALTER TABLE `taskcomments`
  ADD CONSTRAINT `taskcomments_ibfk_1` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `taskcomments_ibfk_2` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tasks`
--
ALTER TABLE `tasks`
  ADD CONSTRAINT `tasks_ibfk_4` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `tasks_ibfk_5` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tasks_ibfk_6` FOREIGN KEY (`parent_id`) REFERENCES `tasks` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `tasks_ibfk_7` FOREIGN KEY (`iusergroup_id`) REFERENCES `iusergroups` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `tasktemplates`
--
ALTER TABLE `tasktemplates`
  ADD CONSTRAINT `tasktemplates_ibfk_1` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `tasktemplates_ibfk_2` FOREIGN KEY (`projecttemplate_id`) REFERENCES `projecttemplates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tasktemplates_ibfk_3` FOREIGN KEY (`iusergroup_id`) REFERENCES `iusergroups` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `tasktemplates_ibfk_4` FOREIGN KEY (`parent_id`) REFERENCES `tasktemplates` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `task_bookings`
--
ALTER TABLE `task_bookings`
  ADD CONSTRAINT `task_bookings_ibfk_2` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `task_contacts`
--
ALTER TABLE `task_contacts`
  ADD CONSTRAINT `task_contacts_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `task_contacts_ibfk_2` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `termdetails`
--
ALTER TABLE `termdetails`
  ADD CONSTRAINT `termdetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `termdetails_ibfk_3` FOREIGN KEY (`term_id`) REFERENCES `terms` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `terms`
--
ALTER TABLE `terms`
  ADD CONSTRAINT `terms_ibfk_1` FOREIGN KEY (`termtype_id`) REFERENCES `termtypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tpnotecategories`
--
ALTER TABLE `tpnotecategories`
  ADD CONSTRAINT `fk_lang_notecat` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `tpnotecategories_appcategories`
--
ALTER TABLE `tpnotecategories_appcategories`
  ADD CONSTRAINT `Fk2_appCategoryId` FOREIGN KEY (`appcategory_id`) REFERENCES `appcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `Fk2_noteCategoryId` FOREIGN KEY (`notecategory_id`) REFERENCES `tpnotecategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tpproductservice_appcategories`
--
ALTER TABLE `tpproductservice_appcategories`
  ADD CONSTRAINT `Fk_appCategoryId` FOREIGN KEY (`appcategory_id`) REFERENCES `appcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `Fk_serviceId` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tpsupplierservice_appcategories`
--
ALTER TABLE `tpsupplierservice_appcategories`
  ADD CONSTRAINT `fksupp_appCategoryId` FOREIGN KEY (`appcategory_id`) REFERENCES `appcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fksupp_serviceId` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tpsyncdetails`
--
ALTER TABLE `tpsyncdetails`
  ADD CONSTRAINT `tpsync_FK` FOREIGN KEY (`tpsynch_id`) REFERENCES `tpsyncs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tpsynclang_FK` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tpsynclogs`
--
ALTER TABLE `tpsynclogs`
  ADD CONSTRAINT `tpsync_log` FOREIGN KEY (`tpsync_id`) REFERENCES `tpsyncs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tp__allocations_products`
--
ALTER TABLE `tp__allocations_products`
  ADD CONSTRAINT `tp__allocations_products_ibfk_1` FOREIGN KEY (`allocation_id`) REFERENCES `tp__allocations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tp__allocations_products_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tp__allocation_customers`
--
ALTER TABLE `tp__allocation_customers`
  ADD CONSTRAINT `tp__allocation_customers_ibfk_1` FOREIGN KEY (`allocation_id`) REFERENCES `tp__allocations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tp__allocation_customers_ibfk_2` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tp__cancelationpolicies`
--
ALTER TABLE `tp__cancelationpolicies`
  ADD CONSTRAINT `tp__cancelationpolicies_ibfk_10` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tp__cancelationpolicies_ibfk_11` FOREIGN KEY (`serviceanalysis1`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tp__cancelationpolicies_ibfk_12` FOREIGN KEY (`serviceanalysis2`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tp__cancelationpolicies_ibfk_13` FOREIGN KEY (`serviceanalysis3`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tp__cancelationpolicies_ibfk_14` FOREIGN KEY (`serviceanalysis4`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tp__cancelationpolicies_ibfk_15` FOREIGN KEY (`serviceanalysis5`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tp__cancelationpolicies_ibfk_16` FOREIGN KEY (`serviceanalysis6`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tp__cancelationpolicies_ibfk_17` FOREIGN KEY (`service_code`) REFERENCES `tp__services` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tp__cancelationpolicies_ibfk_9` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tp__cancelationpolicydetails`
--
ALTER TABLE `tp__cancelationpolicydetails`
  ADD CONSTRAINT `tp__cancelationpolicydetails_ibfk_1` FOREIGN KEY (`pol_id`) REFERENCES `tp__cancelationpolicies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tp__services`
--
ALTER TABLE `tp__services`
  ADD CONSTRAINT `tp__services_ibfk_10` FOREIGN KEY (`analysis3`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tp__services_ibfk_11` FOREIGN KEY (`analysis4`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tp__services_ibfk_12` FOREIGN KEY (`analysis5`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tp__services_ibfk_13` FOREIGN KEY (`analysis6`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tp__services_ibfk_14` FOREIGN KEY (`message_code`) REFERENCES `tp__messagetypes` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tp__services_ibfk_7` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `tp__services_ibfk_8` FOREIGN KEY (`analysis1`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tp__services_ibfk_9` FOREIGN KEY (`analysis2`) REFERENCES `tp__productanalysis` (`code`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `transportbookings`
--
ALTER TABLE `transportbookings`
  ADD CONSTRAINT `transportbookings_ibfk_1` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicles` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `transportbookings_ibfk_10` FOREIGN KEY (`airportguide_id`) REFERENCES `airportguides` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `transportbookings_ibfk_11` FOREIGN KEY (`guide_id`) REFERENCES `guides` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `transportbookings_ibfk_12` FOREIGN KEY (`vehiclemodel_id`) REFERENCES `vehiclemodels` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `transportbookings_ibfk_3` FOREIGN KEY (`transporter_id`) REFERENCES `transporters` (`supplier_id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `transportbookings_ibfk_4` FOREIGN KEY (`bookingtype_id`) REFERENCES `bookingtypes` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `transportbookings_ibfk_5` FOREIGN KEY (`bookingstatus_id`) REFERENCES `bookingstatuses` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `transportbookings_ibfk_7` FOREIGN KEY (`mailerqueue_id`) REFERENCES `mailerqueue` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `transportbookings_ibfk_8` FOREIGN KEY (`transportstatus_id`) REFERENCES `transportstatuses` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `transportbookings_ibfk_9` FOREIGN KEY (`driver_id`) REFERENCES `drivers` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `transportbooking_bookingdetails`
--
ALTER TABLE `transportbooking_bookingdetails`
  ADD CONSTRAINT `transdetbook_bookdet` FOREIGN KEY (`bookingdetail_id`) REFERENCES `booking_details` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `transdetbook_transbook` FOREIGN KEY (`transportbooking_id`) REFERENCES `transportbookings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `transporters`
--
ALTER TABLE `transporters`
  ADD CONSTRAINT `transporters_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `transporter_consuppliers`
--
ALTER TABLE `transporter_consuppliers`
  ADD CONSTRAINT `transporter_consuppliers_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `transporter_consuppliers_ibfk_2` FOREIGN KEY (`transporter_id`) REFERENCES `transporters` (`supplier_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `transporthandlers`
--
ALTER TABLE `transporthandlers`
  ADD CONSTRAINT `transporthandlers_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `transportreservations`
--
ALTER TABLE `transportreservations`
  ADD CONSTRAINT `transportreservations_ibfk_1` FOREIGN KEY (`transportbooking_id`) REFERENCES `transportbookings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `transportreservations_ibfk_2` FOREIGN KEY (`transporter_id`) REFERENCES `transporters` (`supplier_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `transportreservations_ibfk_3` FOREIGN KEY (`transportstatus_id`) REFERENCES `transportstatuses` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `transportstatusdetails`
--
ALTER TABLE `transportstatusdetails`
  ADD CONSTRAINT `transportstatusdetails_ibfk_1` FOREIGN KEY (`transportstatus_id`) REFERENCES `transportstatuses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `transportstatusdetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`);

--
-- Constraints for table `transportstatuses`
--
ALTER TABLE `transportstatuses`
  ADD CONSTRAINT `transportstatuses_ibfk_1` FOREIGN KEY (`next_id`) REFERENCES `transportstatuses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tst_bookingstatuses`
--
ALTER TABLE `tst_bookingstatuses`
  ADD CONSTRAINT `fk_bookingstatus` FOREIGN KEY (`bookingstatus_id`) REFERENCES `bookingstatuses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tst_bookingstatuses_ibfk_1` FOREIGN KEY (`tp__tst_code`) REFERENCES `tp__tst` (`code`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `vehicleblocks`
--
ALTER TABLE `vehicleblocks`
  ADD CONSTRAINT `vehicleblocks_ibfk_1` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `vehicledocuments`
--
ALTER TABLE `vehicledocuments`
  ADD CONSTRAINT `vehicledocuments_ibfk_1` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `vehicledocuments_ibfk_2` FOREIGN KEY (`vehicledocumenttype_id`) REFERENCES `vehicledocumenttypes` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `vehiclemodels`
--
ALTER TABLE `vehiclemodels`
  ADD CONSTRAINT `vehiclemodels_ibfk_1` FOREIGN KEY (`vehiclebrand_id`) REFERENCES `vehiclebrands` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `vehiclemodels_ibfk_2` FOREIGN KEY (`vehicletype_id`) REFERENCES `vehicletypes` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `vehiclenotemessages`
--
ALTER TABLE `vehiclenotemessages`
  ADD CONSTRAINT `vehiclenotemessages_ibfk_1` FOREIGN KEY (`iuser_id`) REFERENCES `iusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `vehiclenotemessages_ibfk_2` FOREIGN KEY (`exuser_id`) REFERENCES `exusers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `vehiclenotemessages_ibfk_3` FOREIGN KEY (`vehiclenote_id`) REFERENCES `vehiclenotes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `vehiclenotes`
--
ALTER TABLE `vehiclenotes`
  ADD CONSTRAINT `vehiclenotes_ibfk_1` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `vehiclenotes_ibfk_2` FOREIGN KEY (`vehiclenotestatus_id`) REFERENCES `vehiclenotestatuses` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `vehicleoptiondetails`
--
ALTER TABLE `vehicleoptiondetails`
  ADD CONSTRAINT `vehicleoptiondetails_ibfk_1` FOREIGN KEY (`vehicleoption_id`) REFERENCES `vehicleoptions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `vehicleoptiondetails_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `vehicles`
--
ALTER TABLE `vehicles`
  ADD CONSTRAINT `vehicles_ibfk_1` FOREIGN KEY (`transporter_id`) REFERENCES `transporters` (`supplier_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `vehicles_ibfk_2` FOREIGN KEY (`vehiclemodel_id`) REFERENCES `vehiclemodels` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `vehicles_ibfk_3` FOREIGN KEY (`luggagesolution_id`) REFERENCES `luggagesolutions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `vehicle_media`
--
ALTER TABLE `vehicle_media`
  ADD CONSTRAINT `vehicle_media_ibfk_1` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `vehicle_options`
--
ALTER TABLE `vehicle_options`
  ADD CONSTRAINT `vehicle_options_ibfk_1` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `vehicle_options_ibfk_2` FOREIGN KEY (`vehicleoptions_id`) REFERENCES `vehicleoptions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
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 */;
