-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Client :  corefortech-1.cl3af0urmvso.eu-west-3.rds.amazonaws.com:3306
-- Généré le :  Lun 29 Juin 2020 à 11:09
-- Version du serveur :  5.7.22-log
-- Version de PHP :  7.3.19-1+ubuntu18.04.1+deb.sury.org+1

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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 :  `corefortech`
--

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

--
-- Structure de la table `drowsiness`
--

CREATE TABLE `drowsiness` (
  `ID` int(11) NOT NULL,
  `token` varchar(150) NOT NULL,
  `itinerary` varchar(150) NOT NULL,
  `drosy` int(11) NOT NULL,
  `timestamp` decimal(50,0) NOT NULL,
  `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Structure de la table `itinerary`
--

CREATE TABLE `itinerary` (
  `ID` int(11) NOT NULL,
  `user` varchar(255) DEFAULT NULL,
  `organizations` varchar(255) NOT NULL,
  `token` varchar(255) NOT NULL,
  `start_city` varchar(255) DEFAULT NULL,
  `end_city` varchar(255) DEFAULT NULL,
  `timezone` varchar(255) DEFAULT NULL,
  `distance` int(11) DEFAULT '0',
  `duration` varchar(100) DEFAULT '0',
  `drowsiness` int(11) NOT NULL DEFAULT '0',
  `road` int(11) NOT NULL DEFAULT '0',
  `weather` int(11) NOT NULL DEFAULT '0',
  `traffic` int(11) NOT NULL DEFAULT '0',
  `timing` int(11) NOT NULL DEFAULT '0',
  `date_start` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_end` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Structure de la table `organizations`
--

CREATE TABLE `organizations` (
  `ID` int(11) NOT NULL,
  `token` text,
  `accessCode` varchar(50) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `tva` varchar(100) DEFAULT NULL,
  `pass` text,
  `city` varchar(100) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `zip` varchar(20) DEFAULT NULL,
  `date` datetime DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Structure de la table `points`
--

CREATE TABLE `points` (
  `ID` int(11) NOT NULL,
  `token` varchar(150) NOT NULL,
  `organizations` varchar(255) NOT NULL,
  `itinerary` varchar(150) NOT NULL,
  `lat` double DEFAULT NULL,
  `lgt` double DEFAULT NULL,
  `weather` int(4) NOT NULL,
  `distance` int(4) NOT NULL,
  `roadtype` int(4) NOT NULL,
  `traffic` int(4) NOT NULL DEFAULT '0',
  `circadian` int(4) NOT NULL,
  `timestamp` decimal(50,0) NOT NULL,
  `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Structure de la table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `token` text,
  `organization` varchar(255) NOT NULL,
  `name` varchar(50) DEFAULT NULL,
  `email` varchar(150) DEFAULT NULL,
  `password` text,
  `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Index pour les tables exportées
--

--
-- Index pour la table `drowsiness`
--
ALTER TABLE `drowsiness`
  ADD PRIMARY KEY (`ID`);

--
-- Index pour la table `itinerary`
--
ALTER TABLE `itinerary`
  ADD PRIMARY KEY (`ID`);

--
-- Index pour la table `organizations`
--
ALTER TABLE `organizations`
  ADD PRIMARY KEY (`ID`);

--
-- Index pour la table `points`
--
ALTER TABLE `points`
  ADD PRIMARY KEY (`ID`);

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

--
-- AUTO_INCREMENT pour les tables exportées
--

--
-- AUTO_INCREMENT pour la table `drowsiness`
--
ALTER TABLE `drowsiness`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=481510;
--
-- AUTO_INCREMENT pour la table `itinerary`
--
ALTER TABLE `itinerary`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=189;
--
-- AUTO_INCREMENT pour la table `organizations`
--
ALTER TABLE `organizations`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT pour la table `points`
--
ALTER TABLE `points`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=493321;
--
-- AUTO_INCREMENT pour la table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
/*!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 */;
