-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Gegenereerd op: 17 apr 2018 om 10:20
-- Serverversie: 10.1.28-MariaDB
-- PHP-versie: 5.6.32

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

--
-- Database: `blueco_mpd_fleet_manager`
--

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

--
-- Tabelstructuur voor tabel `user_app`
--

DROP TABLE IF EXISTS `user_app`;
CREATE TABLE `user_app` (
  `user_app_id` int(11) NOT NULL,
  `user` int(11) NOT NULL COMMENT 'link to table user',
  `token` varchar(128) COLLATE utf8_unicode_ci NOT NULL COMMENT 'login token',
  `device_token_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'mobile device token id (Firebase)',
  `platform` varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Device platform (Android, iOS, browser)',
  `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_last_active` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Last date this device connected to the server'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Indexen voor geëxporteerde tabellen
--

--
-- Indexen voor tabel `user_app`
--
ALTER TABLE `user_app`
  ADD PRIMARY KEY (`user_app_id`),
  ADD UNIQUE KEY `user` (`user`,`device_token_id`),
  ADD KEY `device_token_id` (`device_token_id`),
  ADD KEY `token` (`token`,`user`) USING BTREE,
  ADD KEY `date_created` (`date_created`),
  ADD KEY `date_last_active` (`date_last_active`);

--
-- AUTO_INCREMENT voor geëxporteerde tabellen
--

--
-- AUTO_INCREMENT voor een tabel `user_app`
--
ALTER TABLE `user_app`
  MODIFY `user_app_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
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 */;
