-- phpMyAdmin SQL Dump
-- version 4.9.5deb2
-- https://www.phpmyadmin.net/
--
-- Hôte : localhost:3306
-- Généré le : jeu. 01 sep. 2022 à 14:32
-- Version du serveur :  8.0.30-0ubuntu0.20.04.2
-- Version de PHP : 7.4.25

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


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

--
-- Base de données : `ppap`
--

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

--
-- Structure de la table `api_authentication_log`
--

CREATE TABLE `api_authentication_log` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `route` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `host` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_agent` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `apikey` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Structure de la table `assig_deadline`
--

CREATE TABLE `assig_deadline` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `created_by_id` int DEFAULT NULL,
  `handled_by_id` int DEFAULT NULL,
  `vehicle_id` int DEFAULT NULL,
  `deadline_at` datetime DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `body` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `urgence_level` int DEFAULT NULL,
  `handled_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `assig_deadline_file`
--

CREATE TABLE `assig_deadline_file` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `deadline_id` int NOT NULL,
  `is_picture` tinyint(1) DEFAULT NULL,
  `mime_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `thumbnail_awsobject_key` varchar(14500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `width` int NOT NULL,
  `height` int NOT NULL,
  `extension` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `original_file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `thumbnail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `assig_event`
--

CREATE TABLE `assig_event` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `vehicle_id` int DEFAULT NULL,
  `user_id` int DEFAULT NULL,
  `mission_id` int DEFAULT NULL,
  `created_by_id` int DEFAULT NULL,
  `validated_by_id` int DEFAULT NULL,
  `last_update_by_id` int DEFAULT NULL,
  `time_sheet_id` int DEFAULT NULL,
  `date` date NOT NULL,
  `end` datetime NOT NULL,
  `start` datetime NOT NULL,
  `created_at` datetime NOT NULL,
  `validated_at` datetime DEFAULT NULL,
  `last_update_at` datetime DEFAULT NULL,
  `requires_validation` tinyint(1) DEFAULT NULL,
  `comment_for_manager` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `comment_for_driver` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `is_template` tinyint(1) DEFAULT NULL,
  `validation_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `validation_comment` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `import_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `can_dispatch_user` tinyint(1) DEFAULT NULL,
  `can_dispatch_vehicle` tinyint(1) DEFAULT NULL,
  `checked_at` datetime DEFAULT NULL,
  `prepay_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `is_generated_event` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `assig_event_type`
--

CREATE TABLE `assig_event_type` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `short_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `long_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `color` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `disabled` tinyint(1) NOT NULL,
  `prepay_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `prepay_label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `assig_life_cycle`
--

CREATE TABLE `assig_life_cycle` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `form_template_id` int DEFAULT NULL,
  `event_id` int NOT NULL,
  `is_pds` tinyint(1) DEFAULT NULL,
  `is_fds` tinyint(1) DEFAULT NULL,
  `requires_form_filling` tinyint(1) DEFAULT NULL,
  `place_lat` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `place_lon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `place_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `place_akd` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `assig_misc`
--

CREATE TABLE `assig_misc` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `event_id` int NOT NULL,
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `short_label` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '(DC2Type:json)',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `custom_color` varchar(6) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `assig_mission`
--

CREATE TABLE `assig_mission` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `event_type_id` int DEFAULT NULL,
  `external_dispatch_unit_id` int DEFAULT NULL,
  `form_answer_id` int DEFAULT NULL,
  `client_id` int DEFAULT NULL,
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `comment_for_driver` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `comment_for_manager` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `is_billet_collectif` tinyint(1) DEFAULT NULL,
  `start_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `start_place` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `end_place` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `pickup_time` datetime DEFAULT NULL,
  `pickup_place` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `dropoff_time` datetime DEFAULT NULL,
  `dropoff_place` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `destination` varchar(521) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `client_name` varchar(521) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `client_address` varchar(521) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `client_phone` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `reason` varchar(521) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `passenger_count` int DEFAULT NULL,
  `ttc_price` double DEFAULT NULL,
  `is_template` tinyint(1) DEFAULT NULL,
  `template_description` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `template_category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `line` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `police` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `service` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `client_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `radio_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `dead_mileage_distance` double DEFAULT NULL,
  `commercial_distance` double DEFAULT NULL,
  `mileage_allowance` double DEFAULT NULL,
  `with_trainer` tinyint(1) DEFAULT NULL,
  `min_vehicle_capacity` int DEFAULT NULL,
  `motorization` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `is_external_dispatch` tinyint(1) DEFAULT NULL,
  `external_vehicle_requirements` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `vehicle_restrictions` varchar(510) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `not_covered` tinyint(1) DEFAULT NULL,
  `warned_client` tinyint(1) DEFAULT NULL,
  `template_sub_category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `assig_mission_file`
--

CREATE TABLE `assig_mission_file` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `is_picture` tinyint(1) DEFAULT NULL,
  `mime_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `thumbnail_awsobject_key` varchar(14500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `width` int NOT NULL,
  `height` int NOT NULL,
  `extension` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `original_file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `thumbnail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `assig_operation`
--

CREATE TABLE `assig_operation` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `event_id` int NOT NULL,
  `is_dm` tinyint(1) DEFAULT NULL,
  `is_free_dm` tinyint(1) DEFAULT NULL,
  `is_standard` tinyint(1) DEFAULT NULL,
  `real_trip_id` varchar(800) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `assig_pause`
--

CREATE TABLE `assig_pause` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `event_id` int NOT NULL,
  `is_paid` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `assig_provision`
--

CREATE TABLE `assig_provision` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `event_id` int NOT NULL,
  `is_paid` tinyint(1) DEFAULT NULL,
  `place_lat` double DEFAULT NULL,
  `place_lon` double DEFAULT NULL,
  `place_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `assig_time_sheet`
--

CREATE TABLE `assig_time_sheet` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `paid_driving_minutes` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `assig_vehicle_servicing`
--

CREATE TABLE `assig_vehicle_servicing` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `form_template_id` int DEFAULT NULL,
  `event_id` int NOT NULL,
  `is_maintenance` tinyint(1) DEFAULT NULL,
  `is_fluid_intake` tinyint(1) DEFAULT NULL,
  `requires_form_filling` tinyint(1) DEFAULT NULL,
  `is_washing` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `co_distant_storage`
--

CREATE TABLE `co_distant_storage` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `user_id` int DEFAULT NULL,
  `body` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `last_update` datetime DEFAULT NULL,
  `unique_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `co_group`
--

CREATE TABLE `co_group` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `role` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `custom_management` tinyint(1) DEFAULT NULL,
  `is_master` tinyint(1) DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT NULL,
  `is_private_chat_group` tinyint(1) DEFAULT NULL,
  `protected_storage_path` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `emails` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `co_group_thumbnail_file`
--

CREATE TABLE `co_group_thumbnail_file` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `target_group_id` int DEFAULT NULL,
  `is_picture` tinyint(1) DEFAULT NULL,
  `mime_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `thumbnail_awsobject_key` varchar(14500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `width` int NOT NULL,
  `height` int NOT NULL,
  `extension` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `original_file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `thumbnail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `co_l_place`
--

CREATE TABLE `co_l_place` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `lat` double NOT NULL,
  `lon` double NOT NULL,
  `label` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `description` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `akd` double DEFAULT NULL,
  `favorite` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `co_mm_group_master_slave`
--

CREATE TABLE `co_mm_group_master_slave` (
  `master_group_id` int NOT NULL,
  `slave_group_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `co_mm_group_member`
--

CREATE TABLE `co_mm_group_member` (
  `group_id` int NOT NULL,
  `user_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `co_parse_log`
--

CREATE TABLE `co_parse_log` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `parsed_at` datetime NOT NULL,
  `parsed_log` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Structure de la table `co_user`
--

CREATE TABLE `co_user` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `unit_id` int DEFAULT NULL,
  `parking_place_id` int DEFAULT NULL,
  `username` varchar(180) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `roles` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '(DC2Type:json)',
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `first_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `last_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `last_login` datetime DEFAULT NULL,
  `matricule` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `disabled_at` datetime DEFAULT NULL,
  `last_password_update_at` datetime DEFAULT NULL,
  `last_password_update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `email` varchar(180) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `last_virtual_location` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `last_vldate_time` datetime DEFAULT NULL,
  `extra_text` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `timezone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mobile_phone` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `chrono_card_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `optional_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `zenbus_pk` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `must_reset_credentials` tinyint(1) DEFAULT NULL,
  `max_connection_geolite` int DEFAULT NULL,
  `max_connection_portal` int DEFAULT NULL,
  `max_connection_flexnav` int DEFAULT NULL,
  `is_device_account` tinyint(1) DEFAULT NULL,
  `papa_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `co_user_device_install`
--

CREATE TABLE `co_user_device_install` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `user_id` int DEFAULT NULL,
  `install_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `app_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `device_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `device_os` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `device_browser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `first_login` datetime DEFAULT NULL,
  `last_login` datetime DEFAULT NULL,
  `last_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `co_user_expo_token`
--

CREATE TABLE `co_user_expo_token` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `user_id` int DEFAULT NULL,
  `created_by_id` int DEFAULT NULL,
  `install_token` varchar(510) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `exponent_push_token` varchar(510) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `operating_system` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `csv_abbreviations`
--

CREATE TABLE `csv_abbreviations` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `full_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `csv_bc`
--

CREATE TABLE `csv_bc` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `depart` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `arriver` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `nbr_passagers` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `adresse_client` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `nom_client` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `numero` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `unique_mashup` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `csv_single_table`
--

CREATE TABLE `csv_single_table` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `date` date DEFAULT NULL,
  `user_matricule` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `user_abrege` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `vehicule_immat` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `lieu_ps` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `lieu_fs` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `lieu_debut` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `lieu_fin` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `heure_ps` time DEFAULT NULL,
  `heure_fs` time DEFAULT NULL,
  `heure_debut` time DEFAULT NULL,
  `heure_fin` time DEFAULT NULL,
  `operation_numero` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `operation_abrege` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `service_abrege` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `bc_numero_voyage` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `bc_numero` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `bc_abrege` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `indis_motif` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `indis_abrege` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `operation_sem` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `operation_jour` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `vehicule_park` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `unique_mashup` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `doctrine_migration_versions`
--

CREATE TABLE `doctrine_migration_versions` (
  `version` varchar(191) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `executed_at` datetime DEFAULT NULL,
  `execution_time` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Structure de la table `gtfs_assignment_file`
--

CREATE TABLE `gtfs_assignment_file` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `imported_by_id` int DEFAULT NULL,
  `date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `gtfs_assignment_line`
--

CREATE TABLE `gtfs_assignment_line` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `assignment_file_id` int DEFAULT NULL,
  `gtfsAssignmentId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `gtfsDriverId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `gtfsVehicleId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `gtfsTripId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `with_current_version_trip_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `start` datetime NOT NULL,
  `end` datetime NOT NULL,
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `gtfs_dead_mileage`
--

CREATE TABLE `gtfs_dead_mileage` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `assignmentId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `activityType` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `startStopId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `endStopId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `start` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `end` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `gtfs_dead_mileage_type`
--

CREATE TABLE `gtfs_dead_mileage_type` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `deadMileageTypeId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `gtfs_indispo`
--

CREATE TABLE `gtfs_indispo` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `user_id` int DEFAULT NULL,
  `start_time` datetime NOT NULL,
  `end_time` datetime NOT NULL,
  `import_date_time` datetime NOT NULL,
  `body` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `color` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `gtfs_route`
--

CREATE TABLE `gtfs_route` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `gtfsRouteId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `shortName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `longName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `color` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `textColor` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `gtfs_stop`
--

CREATE TABLE `gtfs_stop` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `gtfsStopId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `lat` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `lng` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `gtfs_stop_time`
--

CREATE TABLE `gtfs_stop_time` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `stop_id` int DEFAULT NULL,
  `trip_id` int DEFAULT NULL,
  `arrivalTime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `departureTime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `stopSequence` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `gtfsTripId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `gtfsStopId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `gtfs_trip`
--

CREATE TABLE `gtfs_trip` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `gtfsTripId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `with_current_version_trip_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `shortName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `gtfsRouteId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `tripDetailStr` varchar(6000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `mail`
--

CREATE TABLE `mail` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `company_tag` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `stop` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '(DC2Type:array)',
  `user` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '(DC2Type:array)',
  `other` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '(DC2Type:array)',
  `date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Structure de la table `unit_thumbnail_file`
--

CREATE TABLE `unit_thumbnail_file` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `is_picture` tinyint(1) DEFAULT NULL,
  `mime_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `thumbnail_awsobject_key` varchar(14500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `width` int NOT NULL,
  `height` int NOT NULL,
  `extension` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `original_file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `thumbnail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `unit_unit`
--

CREATE TABLE `unit_unit` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `thumbnail_file_id` int DEFAULT NULL,
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `is_supervisor` tinyint(1) DEFAULT NULL,
  `default_lat` double NOT NULL,
  `default_lon` double NOT NULL,
  `color` varchar(6) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `is_disabled` tinyint(1) NOT NULL,
  `is_default` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `vehicle_file`
--

CREATE TABLE `vehicle_file` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `vehicle_id` int NOT NULL,
  `is_picture` tinyint(1) DEFAULT NULL,
  `mime_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `thumbnail_awsobject_key` varchar(14500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `width` int NOT NULL,
  `height` int NOT NULL,
  `extension` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `original_file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `thumbnail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `vehicle_fluid_intake`
--

CREATE TABLE `vehicle_fluid_intake` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `vehicle_id` int NOT NULL,
  `date_time` datetime NOT NULL,
  `is_fuel` tinyint(1) DEFAULT NULL,
  `is_ad_blue` tinyint(1) DEFAULT NULL,
  `liters` double NOT NULL,
  `ad_blue_liters` double DEFAULT NULL,
  `is_gas_fuel` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `vehicle_granted_license`
--

CREATE TABLE `vehicle_granted_license` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `license_id` int NOT NULL,
  `user_id` int DEFAULT NULL,
  `has_validity_range` tinyint(1) DEFAULT NULL,
  `start` date DEFAULT NULL,
  `end` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `vehicle_granted_license_file`
--

CREATE TABLE `vehicle_granted_license_file` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `granted_license_id` int NOT NULL,
  `is_picture` tinyint(1) DEFAULT NULL,
  `mime_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `thumbnail_awsobject_key` varchar(14500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `width` int NOT NULL,
  `height` int NOT NULL,
  `extension` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `original_file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `thumbnail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `vehicle_group`
--

CREATE TABLE `vehicle_group` (
  `vehicle_id` int NOT NULL,
  `group_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `vehicle_license`
--

CREATE TABLE `vehicle_license` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `label` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `has_validity_range` tinyint(1) DEFAULT NULL,
  `reminder_delay` int DEFAULT NULL,
  `reminder_emails` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `vehicle_mileage_record`
--

CREATE TABLE `vehicle_mileage_record` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `vehicle_id` int DEFAULT NULL,
  `mileage` int NOT NULL,
  `created_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `created_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `vehicle_mm_veh_lic_req`
--

CREATE TABLE `vehicle_mm_veh_lic_req` (
  `vehicle_id` int NOT NULL,
  `license_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `vehicle_vehicle`
--

CREATE TABLE `vehicle_vehicle` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `tail_mileage_record_id` int DEFAULT NULL,
  `parking_location_id` int DEFAULT NULL,
  `license_plate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `enable_group_restriction` tinyint(1) NOT NULL,
  `is_pmr` tinyint(1) DEFAULT NULL,
  `empty_mass` double DEFAULT NULL,
  `brand` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `model` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `euro_tier` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `fuel_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `autonomy` double DEFAULT NULL,
  `is_articulated` tinyint(1) DEFAULT NULL,
  `has_billetique` tinyint(1) DEFAULT NULL,
  `owner` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `capacity` int DEFAULT NULL,
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `length` double DEFAULT NULL,
  `width` double DEFAULT NULL,
  `height` double DEFAULT NULL,
  `disabled_at` datetime DEFAULT NULL,
  `entry_into_service` date DEFAULT NULL,
  `custodian` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `automated_gearbox` tinyint(1) DEFAULT NULL,
  `ac` tinyint(1) DEFAULT NULL,
  `speed_limitor` tinyint(1) DEFAULT NULL,
  `seated_capacity` int DEFAULT NULL,
  `standing_capacity` int DEFAULT NULL,
  `disabled_people_capacity` int DEFAULT NULL,
  `glove_compartment` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `has_chrono` tinyint(1) DEFAULT NULL,
  `frame_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `full_mass` double DEFAULT NULL,
  `maintenance_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `gauge` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `unit_id` int DEFAULT NULL,
  `radio` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `xml_duty`
--

CREATE TABLE `xml_duty` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `description` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `xml_duty_part`
--

CREATE TABLE `xml_duty_part` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `duty_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `start_point_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `end_point_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `stretch_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `startTime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `endTime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `xml_mobilitx_driver`
--

CREATE TABLE `xml_mobilitx_driver` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `cardNumber` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `firstName` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `lastName` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `personalId` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `xml_mobilitx_driver_assignment`
--

CREATE TABLE `xml_mobilitx_driver_assignment` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `duty_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `driver_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `xml_mobilitx_stretch`
--

CREATE TABLE `xml_mobilitx_stretch` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `startTime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `endTime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `preparationDuration` int DEFAULT NULL,
  `finishingDuration` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Structure de la table `xml_point`
--

CREATE TABLE `xml_point` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `name` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `latitude` double DEFAULT NULL,
  `longitude` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Index pour les tables déchargées
--

--
-- Index pour la table `assig_deadline`
--
ALTER TABLE `assig_deadline`
  ADD KEY `IDX_F3AFC65EB03A8386` (`created_by_id`),
  ADD KEY `IDX_F3AFC65EFE65AF40` (`handled_by_id`),
  ADD KEY `IDX_F3AFC65E545317D1` (`vehicle_id`);

--
-- Index pour la table `assig_deadline_file`
--
ALTER TABLE `assig_deadline_file`
  ADD KEY `IDX_E80A2E5873EA0AF8` (`deadline_id`);

--
-- Index pour la table `assig_event`
--
ALTER TABLE `assig_event`
  ADD UNIQUE KEY `UNIQ_AF6CB7FC2F974569` (`time_sheet_id`),
  ADD KEY `IDX_AF6CB7FC545317D1` (`vehicle_id`),
  ADD KEY `IDX_AF6CB7FCA76ED395` (`user_id`),
  ADD KEY `IDX_AF6CB7FCBE6CAE90` (`mission_id`),
  ADD KEY `IDX_AF6CB7FCB03A8386` (`created_by_id`),
  ADD KEY `IDX_AF6CB7FCC69DE5E5` (`validated_by_id`),
  ADD KEY `IDX_AF6CB7FCC375B8D2` (`last_update_by_id`);

--
-- Index pour la table `assig_life_cycle`
--
ALTER TABLE `assig_life_cycle`
  ADD UNIQUE KEY `UNIQ_BB3A880871F7E88B` (`event_id`),
  ADD KEY `IDX_BB3A8808F2B19FA9` (`form_template_id`);

--
-- Index pour la table `assig_misc`
--
ALTER TABLE `assig_misc`
  ADD UNIQUE KEY `UNIQ_D921C53371F7E88B` (`event_id`);

--
-- Index pour la table `assig_mission`
--
ALTER TABLE `assig_mission`
  ADD UNIQUE KEY `UNIQ_7CF82D50DB33F70B` (`form_answer_id`),
  ADD KEY `IDX_7CF82D50401B253C` (`event_type_id`),
  ADD KEY `IDX_7CF82D50CB853C56` (`external_dispatch_unit_id`),
  ADD KEY `IDX_7CF82D5019EB6921` (`client_id`);

--
-- Index pour la table `assig_operation`
--
ALTER TABLE `assig_operation`
  ADD UNIQUE KEY `UNIQ_C6A5A11C71F7E88B` (`event_id`);

--
-- Index pour la table `assig_pause`
--
ALTER TABLE `assig_pause`
  ADD UNIQUE KEY `UNIQ_43582FB671F7E88B` (`event_id`);

--
-- Index pour la table `assig_provision`
--
ALTER TABLE `assig_provision`
  ADD UNIQUE KEY `UNIQ_65BF45E171F7E88B` (`event_id`);

--
-- Index pour la table `assig_vehicle_servicing`
--
ALTER TABLE `assig_vehicle_servicing`
  ADD UNIQUE KEY `UNIQ_6C5206971F7E88B` (`event_id`),
  ADD KEY `IDX_6C52069F2B19FA9` (`form_template_id`);

--
-- Index pour la table `co_distant_storage`
--
ALTER TABLE `co_distant_storage`
  ADD KEY `IDX_E5122110A76ED395` (`user_id`);

--
-- Index pour la table `co_group_thumbnail_file`
--
ALTER TABLE `co_group_thumbnail_file`
  ADD UNIQUE KEY `UNIQ_833A1B7724FF092E` (`target_group_id`);

--
-- Index pour la table `co_mm_group_master_slave`
--
ALTER TABLE `co_mm_group_master_slave`
  ADD PRIMARY KEY (`master_group_id`,`slave_group_id`),
  ADD KEY `IDX_19B1AFABBDE117C0` (`master_group_id`),
  ADD KEY `IDX_19B1AFAB77CF7396` (`slave_group_id`);

--
-- Index pour la table `co_mm_group_member`
--
ALTER TABLE `co_mm_group_member`
  ADD PRIMARY KEY (`group_id`,`user_id`),
  ADD KEY `IDX_EAD8DFE4FE54D947` (`group_id`),
  ADD KEY `IDX_EAD8DFE4A76ED395` (`user_id`);

--
-- Index pour la table `co_user`
--
ALTER TABLE `co_user`
  ADD UNIQUE KEY `UNIQ_C80465C6F85E0677` (`username`),
  ADD UNIQUE KEY `UNIQ_C80465C6E7927C74` (`email`),
  ADD KEY `IDX_C80465C6F8BD700D` (`unit_id`),
  ADD KEY `IDX_C80465C66B2E732B` (`parking_place_id`);

--
-- Index pour la table `co_user_device_install`
--
ALTER TABLE `co_user_device_install`
  ADD KEY `IDX_41EC4363A76ED395` (`user_id`);

--
-- Index pour la table `co_user_expo_token`
--
ALTER TABLE `co_user_expo_token`
  ADD KEY `IDX_C36A53E6A76ED395` (`user_id`),
  ADD KEY `IDX_C36A53E6B03A8386` (`created_by_id`);

--
-- Index pour la table `csv_abbreviations`
--
ALTER TABLE `csv_abbreviations`
  ADD UNIQUE KEY `UNIQ_3DC79DF877153098` (`code`);

--
-- Index pour la table `csv_bc`
--
ALTER TABLE `csv_bc`
  ADD UNIQUE KEY `UNIQ_2B14E9428147EA1F` (`unique_mashup`);

--
-- Index pour la table `csv_single_table`
--
ALTER TABLE `csv_single_table`
  ADD UNIQUE KEY `UNIQ_CB3CEF9A8147EA1F` (`unique_mashup`);

--
-- Index pour la table `gtfs_assignment_file`
--
ALTER TABLE `gtfs_assignment_file`
  ADD KEY `IDX_C853D7C074953CEA` (`imported_by_id`);

--
-- Index pour la table `gtfs_assignment_line`
--
ALTER TABLE `gtfs_assignment_line`
  ADD KEY `IDX_95D85526F0F53495` (`assignment_file_id`);

--
-- Index pour la table `gtfs_indispo`
--
ALTER TABLE `gtfs_indispo`
  ADD KEY `IDX_52FCD5FAA76ED395` (`user_id`);

--
-- Index pour la table `unit_unit`
--
ALTER TABLE `unit_unit`
  ADD UNIQUE KEY `UNIQ_507DED095E237E06` (`name`),
  ADD UNIQUE KEY `UNIQ_507DED09B16F1215` (`thumbnail_file_id`);

--
-- Index pour la table `vehicle_file`
--
ALTER TABLE `vehicle_file`
  ADD KEY `IDX_FE02054C545317D1` (`vehicle_id`);

--
-- Index pour la table `vehicle_fluid_intake`
--
ALTER TABLE `vehicle_fluid_intake`
  ADD KEY `IDX_21608CE9545317D1` (`vehicle_id`);

--
-- Index pour la table `vehicle_granted_license`
--
ALTER TABLE `vehicle_granted_license`
  ADD KEY `IDX_D9C3387460F904B` (`license_id`),
  ADD KEY `IDX_D9C3387A76ED395` (`user_id`);

--
-- Index pour la table `vehicle_granted_license_file`
--
ALTER TABLE `vehicle_granted_license_file`
  ADD KEY `IDX_7145421F6C9AC1F6` (`granted_license_id`);

--
-- Index pour la table `vehicle_group`
--
ALTER TABLE `vehicle_group`
  ADD PRIMARY KEY (`vehicle_id`,`group_id`),
  ADD KEY `IDX_F6FC429545317D1` (`vehicle_id`),
  ADD KEY `IDX_F6FC429FE54D947` (`group_id`);

--
-- Index pour la table `vehicle_mileage_record`
--
ALTER TABLE `vehicle_mileage_record`
  ADD KEY `IDX_75803D93545317D1` (`vehicle_id`);

--
-- Index pour la table `vehicle_mm_veh_lic_req`
--
ALTER TABLE `vehicle_mm_veh_lic_req`
  ADD PRIMARY KEY (`vehicle_id`,`license_id`),
  ADD KEY `IDX_9A429E55545317D1` (`vehicle_id`),
  ADD KEY `IDX_9A429E55460F904B` (`license_id`);

--
-- Index pour la table `vehicle_vehicle`
--
ALTER TABLE `vehicle_vehicle`
  ADD KEY `IDX_4F3B9E91AE257F7` (`tail_mileage_record_id`),
  ADD KEY `IDX_4F3B9E95AE2EF5A` (`parking_location_id`),
  ADD KEY `IDX_4F3B9E9F8BD700D` (`unit_id`);

--
-- Index pour la table `xml_duty`
--
ALTER TABLE `xml_duty`
  ADD PRIMARY KEY (`id`);

--
-- Index pour la table `xml_duty_part`
--
ALTER TABLE `xml_duty_part`
  ADD PRIMARY KEY (`id`),
  ADD KEY `IDX_48924D1A3A1F9EC1` (`duty_id`),
  ADD KEY `IDX_48924D1ADF028890` (`start_point_id`),
  ADD KEY `IDX_48924D1A196B5B2F` (`end_point_id`),
  ADD KEY `IDX_48924D1A4DF3B01F` (`stretch_id`);

--
-- Index pour la table `xml_mobilitx_driver`
--
ALTER TABLE `xml_mobilitx_driver`
  ADD PRIMARY KEY (`id`);

--
-- Index pour la table `xml_mobilitx_driver_assignment`
--
ALTER TABLE `xml_mobilitx_driver_assignment`
  ADD PRIMARY KEY (`id`),
  ADD KEY `IDX_E135FF0C3A1F9EC1` (`duty_id`),
  ADD KEY `IDX_E135FF0CC3423909` (`driver_id`);

--
-- Index pour la table `xml_mobilitx_stretch`
--
ALTER TABLE `xml_mobilitx_stretch`
  ADD PRIMARY KEY (`id`);

--
-- Index pour la table `xml_point`
--
ALTER TABLE `xml_point`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT pour les tables déchargées
--

--
-- AUTO_INCREMENT pour la table `api_authentication_log`
--
ALTER TABLE `api_authentication_log`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `assig_deadline`
--
ALTER TABLE `assig_deadline`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `assig_deadline_file`
--
ALTER TABLE `assig_deadline_file`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `assig_event`
--
ALTER TABLE `assig_event`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `assig_event_type`
--
ALTER TABLE `assig_event_type`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `assig_life_cycle`
--
ALTER TABLE `assig_life_cycle`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `assig_misc`
--
ALTER TABLE `assig_misc`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `assig_mission`
--
ALTER TABLE `assig_mission`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `assig_mission_file`
--
ALTER TABLE `assig_mission_file`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `assig_operation`
--
ALTER TABLE `assig_operation`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `assig_pause`
--
ALTER TABLE `assig_pause`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `assig_provision`
--
ALTER TABLE `assig_provision`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `assig_time_sheet`
--
ALTER TABLE `assig_time_sheet`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `assig_vehicle_servicing`
--
ALTER TABLE `assig_vehicle_servicing`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `co_distant_storage`
--
ALTER TABLE `co_distant_storage`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `co_group`
--
ALTER TABLE `co_group`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `co_group_thumbnail_file`
--
ALTER TABLE `co_group_thumbnail_file`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `co_l_place`
--
ALTER TABLE `co_l_place`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `co_parse_log`
--
ALTER TABLE `co_parse_log`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `co_user`
--
ALTER TABLE `co_user`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `co_user_device_install`
--
ALTER TABLE `co_user_device_install`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `co_user_expo_token`
--
ALTER TABLE `co_user_expo_token`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `csv_abbreviations`
--
ALTER TABLE `csv_abbreviations`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `csv_bc`
--
ALTER TABLE `csv_bc`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `csv_single_table`
--
ALTER TABLE `csv_single_table`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `gtfs_assignment_file`
--
ALTER TABLE `gtfs_assignment_file`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `gtfs_assignment_line`
--
ALTER TABLE `gtfs_assignment_line`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `gtfs_dead_mileage`
--
ALTER TABLE `gtfs_dead_mileage`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `gtfs_dead_mileage_type`
--
ALTER TABLE `gtfs_dead_mileage_type`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `gtfs_indispo`
--
ALTER TABLE `gtfs_indispo`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `gtfs_route`
--
ALTER TABLE `gtfs_route`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `gtfs_stop`
--
ALTER TABLE `gtfs_stop`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `gtfs_stop_time`
--
ALTER TABLE `gtfs_stop_time`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `gtfs_trip`
--
ALTER TABLE `gtfs_trip`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `mail`
--
ALTER TABLE `mail`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `unit_thumbnail_file`
--
ALTER TABLE `unit_thumbnail_file`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `unit_unit`
--
ALTER TABLE `unit_unit`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `vehicle_file`
--
ALTER TABLE `vehicle_file`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `vehicle_fluid_intake`
--
ALTER TABLE `vehicle_fluid_intake`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `vehicle_granted_license`
--
ALTER TABLE `vehicle_granted_license`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `vehicle_granted_license_file`
--
ALTER TABLE `vehicle_granted_license_file`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `vehicle_license`
--
ALTER TABLE `vehicle_license`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `vehicle_mileage_record`
--
ALTER TABLE `vehicle_mileage_record`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `vehicle_vehicle`
--
ALTER TABLE `vehicle_vehicle`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- Contraintes pour les tables déchargées
--

--
-- Contraintes pour la table `assig_deadline`
--
ALTER TABLE `assig_deadline`
  ADD CONSTRAINT `FK_F3AFC65E545317D1` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicle_vehicle` (`id`),
  ADD CONSTRAINT `FK_F3AFC65EB03A8386` FOREIGN KEY (`created_by_id`) REFERENCES `co_user` (`id`),
  ADD CONSTRAINT `FK_F3AFC65EFE65AF40` FOREIGN KEY (`handled_by_id`) REFERENCES `co_user` (`id`);

--
-- Contraintes pour la table `assig_deadline_file`
--
ALTER TABLE `assig_deadline_file`
  ADD CONSTRAINT `FK_E80A2E5873EA0AF8` FOREIGN KEY (`deadline_id`) REFERENCES `assig_deadline` (`id`);

--
-- Contraintes pour la table `assig_event`
--
ALTER TABLE `assig_event`
  ADD CONSTRAINT `FK_AF6CB7FC2F974569` FOREIGN KEY (`time_sheet_id`) REFERENCES `assig_time_sheet` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `FK_AF6CB7FC545317D1` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicle_vehicle` (`id`),
  ADD CONSTRAINT `FK_AF6CB7FCA76ED395` FOREIGN KEY (`user_id`) REFERENCES `co_user` (`id`),
  ADD CONSTRAINT `FK_AF6CB7FCB03A8386` FOREIGN KEY (`created_by_id`) REFERENCES `co_user` (`id`),
  ADD CONSTRAINT `FK_AF6CB7FCBE6CAE90` FOREIGN KEY (`mission_id`) REFERENCES `assig_mission` (`id`),
  ADD CONSTRAINT `FK_AF6CB7FCC375B8D2` FOREIGN KEY (`last_update_by_id`) REFERENCES `co_user` (`id`),
  ADD CONSTRAINT `FK_AF6CB7FCC69DE5E5` FOREIGN KEY (`validated_by_id`) REFERENCES `co_user` (`id`);

--
-- Contraintes pour la table `assig_life_cycle`
--
ALTER TABLE `assig_life_cycle`
  ADD CONSTRAINT `FK_BB3A880871F7E88B` FOREIGN KEY (`event_id`) REFERENCES `assig_event` (`id`),
  ADD CONSTRAINT `FK_BB3A8808F2B19FA9` FOREIGN KEY (`form_template_id`) REFERENCES `fo_form_template` (`id`);

--
-- Contraintes pour la table `assig_misc`
--
ALTER TABLE `assig_misc`
  ADD CONSTRAINT `FK_D921C53371F7E88B` FOREIGN KEY (`event_id`) REFERENCES `assig_event` (`id`);

--
-- Contraintes pour la table `assig_mission`
--
ALTER TABLE `assig_mission`
  ADD CONSTRAINT `FK_7CF82D5019EB6921` FOREIGN KEY (`client_id`) REFERENCES `co_client` (`id`),
  ADD CONSTRAINT `FK_7CF82D50401B253C` FOREIGN KEY (`event_type_id`) REFERENCES `assig_event_type` (`id`),
  ADD CONSTRAINT `FK_7CF82D50CB853C56` FOREIGN KEY (`external_dispatch_unit_id`) REFERENCES `assig_external_dispatch_unit` (`id`),
  ADD CONSTRAINT `FK_7CF82D50DB33F70B` FOREIGN KEY (`form_answer_id`) REFERENCES `fo_form_answer` (`id`);

--
-- Contraintes pour la table `assig_operation`
--
ALTER TABLE `assig_operation`
  ADD CONSTRAINT `FK_C6A5A11C71F7E88B` FOREIGN KEY (`event_id`) REFERENCES `assig_event` (`id`);

--
-- Contraintes pour la table `assig_pause`
--
ALTER TABLE `assig_pause`
  ADD CONSTRAINT `FK_43582FB671F7E88B` FOREIGN KEY (`event_id`) REFERENCES `assig_event` (`id`);

--
-- Contraintes pour la table `assig_provision`
--
ALTER TABLE `assig_provision`
  ADD CONSTRAINT `FK_65BF45E171F7E88B` FOREIGN KEY (`event_id`) REFERENCES `assig_event` (`id`);

--
-- Contraintes pour la table `assig_vehicle_servicing`
--
ALTER TABLE `assig_vehicle_servicing`
  ADD CONSTRAINT `FK_6C5206971F7E88B` FOREIGN KEY (`event_id`) REFERENCES `assig_event` (`id`),
  ADD CONSTRAINT `FK_6C52069F2B19FA9` FOREIGN KEY (`form_template_id`) REFERENCES `fo_form_template` (`id`);

--
-- Contraintes pour la table `co_distant_storage`
--
ALTER TABLE `co_distant_storage`
  ADD CONSTRAINT `FK_E5122110A76ED395` FOREIGN KEY (`user_id`) REFERENCES `co_user` (`id`);

--
-- Contraintes pour la table `co_group_thumbnail_file`
--
ALTER TABLE `co_group_thumbnail_file`
  ADD CONSTRAINT `FK_833A1B7724FF092E` FOREIGN KEY (`target_group_id`) REFERENCES `co_group` (`id`);

--
-- Contraintes pour la table `co_mm_group_master_slave`
--
ALTER TABLE `co_mm_group_master_slave`
  ADD CONSTRAINT `FK_19B1AFAB77CF7396` FOREIGN KEY (`slave_group_id`) REFERENCES `co_group` (`id`),
  ADD CONSTRAINT `FK_19B1AFABBDE117C0` FOREIGN KEY (`master_group_id`) REFERENCES `co_group` (`id`);

--
-- Contraintes pour la table `co_mm_group_member`
--
ALTER TABLE `co_mm_group_member`
  ADD CONSTRAINT `FK_EAD8DFE4A76ED395` FOREIGN KEY (`user_id`) REFERENCES `co_user` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_EAD8DFE4FE54D947` FOREIGN KEY (`group_id`) REFERENCES `co_group` (`id`) ON DELETE CASCADE;

#TODO this cause error since we don't have the constraint localy we keep it here in case
--
-- Contraintes pour la table `co_user`
--
# ALTER TABLE `co_user`
#   ADD CONSTRAINT `FK_C80465C66B2E732B` FOREIGN KEY (`parking_place_id`) REFERENCES `co_l_place` (`id`)
#     ,
#   ADD CONSTRAINT `FK_C80465C6F8BD700D` FOREIGN KEY (`unit_id`) REFERENCES `unit_unit` (`id`)
;

--
-- Contraintes pour la table `co_user_device_install`
--
ALTER TABLE `co_user_device_install`
  ADD CONSTRAINT `FK_41EC4363A76ED395` FOREIGN KEY (`user_id`) REFERENCES `co_user` (`id`);

--
-- Contraintes pour la table `co_user_expo_token`
--
ALTER TABLE `co_user_expo_token`
  ADD CONSTRAINT `FK_C36A53E6A76ED395` FOREIGN KEY (`user_id`) REFERENCES `co_user` (`id`),
  ADD CONSTRAINT `FK_C36A53E6B03A8386` FOREIGN KEY (`created_by_id`) REFERENCES `co_user` (`id`);

--
-- Contraintes pour la table `gtfs_assignment_file`
--
ALTER TABLE `gtfs_assignment_file`
  ADD CONSTRAINT `FK_C853D7C074953CEA` FOREIGN KEY (`imported_by_id`) REFERENCES `co_user` (`id`);

--
-- Contraintes pour la table `gtfs_assignment_line`
--
ALTER TABLE `gtfs_assignment_line`
  ADD CONSTRAINT `FK_95D85526F0F53495` FOREIGN KEY (`assignment_file_id`) REFERENCES `gtfs_assignment_file` (`id`);

--
-- Contraintes pour la table `gtfs_indispo`
--
ALTER TABLE `gtfs_indispo`
  ADD CONSTRAINT `FK_52FCD5FAA76ED395` FOREIGN KEY (`user_id`) REFERENCES `co_user` (`id`);

--
-- Contraintes pour la table `unit_unit`
--
ALTER TABLE `unit_unit`
  ADD CONSTRAINT `FK_507DED09B16F1215` FOREIGN KEY (`thumbnail_file_id`) REFERENCES `unit_thumbnail_file` (`id`) ON DELETE SET NULL;

--
-- Contraintes pour la table `vehicle_file`
--
ALTER TABLE `vehicle_file`
  ADD CONSTRAINT `FK_FE02054C545317D1` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicle_vehicle` (`id`);

--
-- Contraintes pour la table `vehicle_fluid_intake`
--
ALTER TABLE `vehicle_fluid_intake`
  ADD CONSTRAINT `FK_21608CE9545317D1` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicle_vehicle` (`id`);

--
-- Contraintes pour la table `vehicle_granted_license`
--
ALTER TABLE `vehicle_granted_license`
  ADD CONSTRAINT `FK_D9C3387460F904B` FOREIGN KEY (`license_id`) REFERENCES `vehicle_license` (`id`),
  ADD CONSTRAINT `FK_D9C3387A76ED395` FOREIGN KEY (`user_id`) REFERENCES `co_user` (`id`);

--
-- Contraintes pour la table `vehicle_granted_license_file`
--
ALTER TABLE `vehicle_granted_license_file`
  ADD CONSTRAINT `FK_7145421F6C9AC1F6` FOREIGN KEY (`granted_license_id`) REFERENCES `vehicle_granted_license` (`id`);

--
-- Contraintes pour la table `vehicle_group`
--
ALTER TABLE `vehicle_group`
  ADD CONSTRAINT `FK_F6FC429545317D1` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicle_vehicle` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_F6FC429FE54D947` FOREIGN KEY (`group_id`) REFERENCES `co_group` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `vehicle_mileage_record`
--
ALTER TABLE `vehicle_mileage_record`
  ADD CONSTRAINT `FK_75803D93545317D1` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicle_vehicle` (`id`);

--
-- Contraintes pour la table `vehicle_mm_veh_lic_req`
--
ALTER TABLE `vehicle_mm_veh_lic_req`
  ADD CONSTRAINT `FK_9A429E55460F904B` FOREIGN KEY (`license_id`) REFERENCES `vehicle_license` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_9A429E55545317D1` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicle_vehicle` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `vehicle_vehicle`
--
ALTER TABLE `vehicle_vehicle`
  ADD CONSTRAINT `FK_4F3B9E91AE257F7` FOREIGN KEY (`tail_mileage_record_id`) REFERENCES `vehicle_mileage_record` (`id`),
  ADD CONSTRAINT `FK_4F3B9E95AE2EF5A` FOREIGN KEY (`parking_location_id`) REFERENCES `co_l_place` (`id`),
  ADD CONSTRAINT `FK_4F3B9E9F8BD700D` FOREIGN KEY (`unit_id`) REFERENCES `unit_unit` (`id`);

--
-- Contraintes pour la table `xml_duty_part`
--
ALTER TABLE `xml_duty_part`
  ADD CONSTRAINT `FK_48924D1A196B5B2F` FOREIGN KEY (`end_point_id`) REFERENCES `xml_point` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `FK_48924D1A3A1F9EC1` FOREIGN KEY (`duty_id`) REFERENCES `xml_duty` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `FK_48924D1A4DF3B01F` FOREIGN KEY (`stretch_id`) REFERENCES `xml_mobilitx_stretch` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `FK_48924D1ADF028890` FOREIGN KEY (`start_point_id`) REFERENCES `xml_point` (`id`) ON DELETE SET NULL;

--
-- Contraintes pour la table `xml_mobilitx_driver_assignment`
--
ALTER TABLE `xml_mobilitx_driver_assignment`
  ADD CONSTRAINT `FK_E135FF0C3A1F9EC1` FOREIGN KEY (`duty_id`) REFERENCES `xml_duty` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `FK_E135FF0CC3423909` FOREIGN KEY (`driver_id`) REFERENCES `xml_mobilitx_driver` (`id`) ON DELETE SET NULL;
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 */;
