text: /*
   Navicat MySQL Data Transfer
  
   Source Server         : user admin (local) 2
   Source Server Type    : MySQL
   Source Server Version : 50718
   Source Host           : 0.0.0.0
   Source Database       : users
  
   Target Server Type    : MySQL
   Target Server Version : 50718
   File Encoding         : utf-8
  
   Date: 07/03/2017 15:41:24 PM
  */
  
  SET NAMES utf8mb4;
  SET FOREIGN_KEY_CHECKS = 0;
  
  -- ----------------------------
  --  Table structure for `roles`
  -- ----------------------------
  DROP TABLE IF EXISTS `roles`;
  CREATE TABLE `roles` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `active` tinyint(4) DEFAULT NULL,
    `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    UNIQUE KEY `name` (`name`)
  ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  -- ----------------------------
  --  Table structure for `user_event_log`
  -- ----------------------------
  DROP TABLE IF EXISTS `user_event_log`;
  CREATE TABLE `user_event_log` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `user_id` int(11) NOT NULL,
    `event_log` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `event_data` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  -- ----------------------------
  --  Table structure for `users`
  -- ----------------------------
  DROP TABLE IF EXISTS `users`;
  CREATE TABLE `users` (
    `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
    `email` varchar(255) NOT NULL,
    `password` varchar(40) NOT NULL,
    `role` varchar(11) NOT NULL,
    `name` varchar(255) DEFAULT NULL,
    `gateway_customer_id` varchar(16) DEFAULT NULL,
    `last_login` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    UNIQUE KEY `idx_email` (`email`) USING BTREE COMMENT 'Unique email constraint'
  ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
  
  SET FOREIGN_KEY_CHECKS = 1;
  