-- MySQL dump 10.13  Distrib 5.6.17, for Win64 (x86_64)
--
-- Host: localhost    Database: spumer2_db
-- ------------------------------------------------------
-- Server version	5.6.17

/*!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 utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `companies`
--

DROP TABLE IF EXISTS `companies`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `companies` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `partner_id` int(10) unsigned NOT NULL DEFAULT '1',
  `partner_share` float(5,2) unsigned NOT NULL DEFAULT '0.00',
  `plan_id` int(10) unsigned DEFAULT NULL,
  `plan_discount` float(5,2) unsigned NOT NULL DEFAULT '0.00',
  `bill_day` int(2) unsigned DEFAULT '1',
  `owner_user_id` int(10) unsigned DEFAULT NULL,
  `corporate_name` tinytext COLLATE utf8_unicode_ci NOT NULL,
  `url_login` tinytext COLLATE utf8_unicode_ci,
  `logo` tinytext COLLATE utf8_unicode_ci,
  `logo_margin` int(10) unsigned NOT NULL DEFAULT '0',
  `trade_name` tinytext COLLATE utf8_unicode_ci NOT NULL,
  `rfc` tinytext COLLATE utf8_unicode_ci,
  `address` tinytext COLLATE utf8_unicode_ci,
  `number_exterior` tinytext COLLATE utf8_unicode_ci,
  `number_interior` tinytext COLLATE utf8_unicode_ci,
  `neighborhood` tinytext COLLATE utf8_unicode_ci,
  `zip` int(10) unsigned DEFAULT NULL,
  `country_id` int(10) DEFAULT NULL,
  `state_id` int(10) unsigned DEFAULT NULL,
  `phone` tinytext COLLATE utf8_unicode_ci,
  `city` tinytext COLLATE utf8_unicode_ci,
  `domain` tinytext COLLATE utf8_unicode_ci,
  `email_sender` tinytext COLLATE utf8_unicode_ci,
  `ending_period` datetime DEFAULT NULL,
  `week_start_day` tinyint(1) DEFAULT '1' COMMENT '0 => sunday, 1 => monday, default 1 monday',
  `created` datetime DEFAULT NULL,
  `modified` datetime DEFAULT NULL,
  `users_disabled` tinyint(1) NOT NULL DEFAULT '0',
  `debtor_account` tinyint(1) NOT NULL DEFAULT '0',
  `opt_chatbox_avatar` tinyint(1) NOT NULL DEFAULT '0',
  `opt_chatbox_sound` tinyint(1) NOT NULL DEFAULT '1',
  `opt_chatbox_desktop_notification` tinyint(1) NOT NULL DEFAULT '0',
  `opt_auto_email_conversation` tinyint(1) NOT NULL DEFAULT '0',
  `opt_auto_email_address` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `opt_reply_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `companies_partner_id` (`partner_id`),
  KEY `companies_level_id` (`plan_id`),
  KEY `owner_user_id` (`owner_user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT;
/*!40101 SET character_set_client = @saved_cs_client */;

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

DROP TABLE IF EXISTS `contacts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contacts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int(10) unsigned NOT NULL,
  `country_id` int(10) unsigned NOT NULL,
  `group_id` int(10) unsigned NOT NULL,
  `visitor_id` int(10) unsigned NOT NULL,
  `email` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  `message` varchar(2048) COLLATE utf8_unicode_ci NOT NULL,
  `answer` varchar(8192) COLLATE utf8_unicode_ci DEFAULT NULL,
  `answered` tinyint(4) NOT NULL DEFAULT '0',
  `enabled` tinyint(4) NOT NULL DEFAULT '1',
  `created` datetime NOT NULL,
  `modified` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `company_id` (`company_id`),
  KEY `country_id` (`country_id`),
  KEY `group_id` (`group_id`),
  KEY `visitor_id` (`visitor_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

DROP TABLE IF EXISTS `countries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `countries` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(45) NOT NULL,
  `code` char(2) DEFAULT NULL,
  `iso_code_2` varchar(2) NOT NULL DEFAULT '',
  `iso_code_3` varchar(3) DEFAULT '',
  `iso_country` varchar(255) NOT NULL DEFAULT '',
  `iso_numeric` int(11) DEFAULT NULL,
  `currency_code` char(3) DEFAULT NULL,
  `currency_name` varchar(32) DEFAULT NULL,
  `currency_symbol` varchar(3) DEFAULT NULL,
  `flag` varchar(6) DEFAULT NULL,
  `lat` float DEFAULT '0',
  `lon` float DEFAULT '0',
  `change_value` float DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=895 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `country_ips`
--

DROP TABLE IF EXISTS `country_ips`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `country_ips` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `country_id` int(10) DEFAULT NULL,
  `ip` int(11) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `ip` (`ip`),
  KEY `country_id` (`country_id`)
) ENGINE=InnoDB AUTO_INCREMENT=62602 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `designs`
--

DROP TABLE IF EXISTS `designs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `designs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `company_id` int(11) NOT NULL,
  `data` varchar(4096) COLLATE utf8_unicode_ci NOT NULL DEFAULT '{"active":{"header":{"fgColor":"rgba(255,255,255,1)","bgColor":"rgba(58,58,58,1)","fontFamily":"inherit","fontSize":"14px","content":"We''re online!"},"body":{"fgColor":"rgba(102,102,102,1)","bgColor":"rgba(238,238,238,1)","fontFamily":"inherit","fontSize":"14px","content":null},"buttons":{"fgColor":"rgba(0,0,0,1)","bgColor":"rgba(0,0,0,1)","fontFamily":"","fontSize":"","content":""},"inputs":{"fgColor":"rgba(102,102,102,1)","bgColor":"rgba(255,255,255,0)","fontFamily":"inherit","fontSize":"14","content":"Type your message here...","content2":""}},"greet":{"header":{"fgColor":"rgba(255,255,255,1)","bgColor":"rgba(58,58,58,1)","fontFamily":"inherit","fontSize":"14","content":"We''re online!"},"body":{"fgColor":"rgba(102,102,102,1)","bgColor":"rgba(238,238,238,1)","fontFamily":"inherit","fontSize":"28","content":"To start a chat, send us a message"},"buttons":{"fgColor":"rgba(0,0,0,1)","bgColor":"rgba(0,0,0,1)","fontFamily":"","fontSize":"","content":""},"inputs":{"fgColor":"rgba(102,102,102,1)","bgColor":"rgba(255,255,255,0)","fontFamily":"inherit","fontSize":"14","content":"Type your message here...","content2":""}},"contact":{"header":{"fgColor":"rgba(255,255,255,1)","bgColor":"rgba(58,58,58,1)","fontFamily":"inherit","fontSize":"14px","content":"No estamos en linia"},"body":{"fgColor":"rgba(102,102,102,1)","bgColor":"rgba(238,238,238,1)","fontFamily":"inherit","fontSize":"22","content":"No operators are online, leave a message and we''ll get back to you as soon as we can"},"buttons":{"fgColor":"rgba(255,255,255,1)","bgColor":"rgba(74,163,223,1)","fontFamily":"inherit","fontSize":"12","content":"submit"},"inputs":{"fgColor":"rgba(102,102,102,1)","bgColor":"rgba(255,255,255,0)","fontFamily":"verdana","fontSize":"14","content":"Leave your email here","content2":"Leave your message here"}},"thanks":{"header":{"fgColor":"rgba(255,255,255,1)","bgColor":"rgba(58,58,58,1)","fontFamily":"inherit","fontSize":"14px","content":"Thank you"},"body":{"fgColor":"rgba(102,102,102,1)","bgColor":"rgba(238,238,238,1)","fontFamily":"inherit","fontSize":"22","content":"We''ll send you a message as soon as we can"},"buttons":{"fgColor":"rgba(255,255,255,1)","bgColor":"rgba(74,163,223,1)","fontFamily":"inherit","fontSize":"12","content":"edit message"},"inputs":{"fgColor":"rgba(0,0,0,1)","bgColor":"rgba(0,0,0,1)","fontFamily":"","fontSize":"","content":""}},"unlocked":{"header":{"fgColor":"rgba(255,255,255,1)","bgColor":"rgba(58,58,58,1)","fontFamily":"inherit","fontSize":"14px","content":"Operator disconnected!"},"body":{"fgColor":"rgba(102,102,102,1)","bgColor":"rgba(238,238,238,1)","fontFamily":"inherit","fontSize":"22","content":"The Operator marked this conversation as finished, if you want to continue send us a message"},"buttons":{"fgColor":"rgba(255,255,255,1)","bgColor":"rgba(74,163,223,1)","fontFamily":"inherit","fontSize":"12","content":"continue"},"inputs":{"fgColor":"rgba(0,0,0,1)","bgColor":"rgba(0,0,0,1)","fontFamily":"","fontSize":"","content":""}},"connecting":{"header":{"fgColor":"rgba(255,255,255,1)","bgColor":"rgba(58,58,58,1)","fontFamily":"inherit","fontSize":"14px","content":"Connecting"},"body":{"fgColor":"rgba(74,163,223,1)","bgColor":"rgba(238,238,238,1)","fontFamily":"inherit","fontSize":"25","content":""},"buttons":{"fgColor":"rgba(0,0,0,1)","bgColor":"rgba(0,0,0,1)","fontFamily":"","fontSize":"","content":""},"inputs":{"fgColor":"rgba(0,0,0,1)","bgColor":"rgba(0,0,0,1)","fontFamily":"","fontSize":"","content":""}}}',
  `enabled` tinyint(4) NOT NULL DEFAULT '1',
  `created` datetime NOT NULL,
  `modified` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `company_id` (`company_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `groups`
--

DROP TABLE IF EXISTS `groups`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `company_id` int(11) NOT NULL,
  `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `hash` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
  `active` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `enabled` tinyint(4) unsigned NOT NULL DEFAULT '1',
  `created` datetime NOT NULL,
  `modified` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `hash` (`hash`),
  KEY `company_id` (`company_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `macros`
--

DROP TABLE IF EXISTS `macros`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `macros` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int(10) unsigned NOT NULL,
  `keyword` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  `content` varchar(4096) COLLATE utf8_unicode_ci NOT NULL,
  `active` tinyint(4) NOT NULL DEFAULT '1',
  `enabled` tinyint(4) NOT NULL DEFAULT '1',
  `created` datetime NOT NULL,
  `modified` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `company_id` (`company_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `messages`
--

DROP TABLE IF EXISTS `messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `messages` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int(10) unsigned NOT NULL,
  `transcript_id` int(10) unsigned NOT NULL,
  `ordinal` int(10) unsigned NOT NULL,
  `type` enum('operator','visitor') COLLATE utf8_unicode_ci NOT NULL,
  `content` varchar(4096) COLLATE utf8_unicode_ci NOT NULL,
  `unread` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `enabled` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `time_sent` datetime DEFAULT NULL,
  `time_arrived` datetime DEFAULT NULL,
  `time_received` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `company_id` (`company_id`),
  KEY `transcript_id` (`transcript_id`)
) ENGINE=InnoDB AUTO_INCREMENT=329 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `payments`
--

DROP TABLE IF EXISTS `payments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `folio` int(10) unsigned NOT NULL,
  `company_id` int(10) unsigned NOT NULL,
  `partner_id` int(10) unsigned NOT NULL,
  `partner_share` float(5,2) unsigned NOT NULL DEFAULT '0.00',
  `plan_id` int(10) unsigned NOT NULL,
  `plan_discount` float(5,2) unsigned NOT NULL DEFAULT '0.00',
  `plan_price` float(12,2) NOT NULL,
  `total` float(12,2) NOT NULL DEFAULT '0.00',
  `bill_date` date NOT NULL,
  `notes` text COLLATE utf8_unicode_ci,
  `balance` float(12,2) NOT NULL DEFAULT '0.00',
  `paid` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `paid_date` datetime DEFAULT NULL,
  `paid_share` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `paid_share_date` datetime DEFAULT NULL,
  `created` datetime DEFAULT NULL,
  `modified` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `company_id` (`company_id`),
  KEY `plan_id` (`plan_id`),
  KEY `partner_id` (`partner_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `plans`
--

DROP TABLE IF EXISTS `plans`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `plans` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` tinytext COLLATE utf8_unicode_ci NOT NULL,
  `name_slug` tinytext COLLATE utf8_unicode_ci,
  `users_limit` int(10) unsigned NOT NULL DEFAULT '1',
  `clients_limit` int(10) unsigned NOT NULL DEFAULT '0',
  `premium` tinyint(1) DEFAULT '0',
  `personalized` tinyint(1) DEFAULT '0',
  `mails_limit` int(10) unsigned NOT NULL DEFAULT '0',
  `email_marketing_limit_clients` int(10) unsigned NOT NULL DEFAULT '0',
  `price` float(12,2) NOT NULL DEFAULT '0.00',
  `disk_space_limit` float(12,2) DEFAULT '0.00',
  `trial` tinyint(1) DEFAULT '0',
  `created` datetime DEFAULT NULL,
  `modified` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `transcripts`
--

DROP TABLE IF EXISTS `transcripts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `transcripts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int(10) unsigned NOT NULL,
  `country_id` int(10) unsigned NOT NULL,
  `group_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `visitor_id` int(10) unsigned NOT NULL,
  `response_time` int(10) unsigned NOT NULL,
  `duration` int(10) unsigned NOT NULL,
  `total_messages` int(10) unsigned NOT NULL,
  `visitor_message_count` int(10) unsigned NOT NULL,
  `operator_message_count` int(10) unsigned NOT NULL,
  `gist` enum('ENGAGED','NO_REPLY_VI','NO_REPLY_OP') COLLATE utf8_unicode_ci NOT NULL,
  `emailed` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `illegal_disconnection` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `manual_disconnection` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `enabled` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `created` datetime NOT NULL,
  `modified` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `company_id` (`company_id`),
  KEY `country_id` (`country_id`),
  KEY `group_id` (`group_id`),
  KEY `user_id` (`user_id`),
  KEY `visitor_id` (`visitor_id`)
) ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int(10) unsigned DEFAULT NULL COMMENT 'allow null, so to create company after creating user',
  `group_id` int(10) unsigned DEFAULT NULL COMMENT 'allow null, so to create group after creating user',
  `plan_id` int(10) unsigned NOT NULL,
  `bank_id` int(10) unsigned DEFAULT NULL,
  `country_id` int(10) unsigned DEFAULT NULL,
  `visitor_count` int(10) unsigned NOT NULL DEFAULT '0',
  `conekta_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `creditcard_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `username` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `password` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `avatar` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `name` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  `registration_token` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
  `is_admin` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_registered` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `enabled` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `group` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'useless, kept for consultorcrm',
  `last_activity` datetime DEFAULT NULL,
  `created` datetime NOT NULL,
  `modified` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`),
  KEY `company_id` (`company_id`),
  KEY `group_id` (`group_id`),
  KEY `plan_id` (`plan_id`),
  KEY `bank_id` (`bank_id`),
  KEY `country_id` (`country_id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `visitor_hits`
--

DROP TABLE IF EXISTS `visitor_hits`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `visitor_hits` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int(11) unsigned NOT NULL,
  `visitor_id` int(11) unsigned NOT NULL,
  `group_id` int(11) unsigned NOT NULL,
  `ip_address` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `domain` varchar(256) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `page` varchar(256) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `protocol` enum('http','https') COLLATE utf8_unicode_ci DEFAULT 'http',
  `user_agent` varchar(1024) COLLATE utf8_unicode_ci DEFAULT '',
  `referer` varchar(1024) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `lang` varchar(256) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `enabled` tinyint(4) NOT NULL DEFAULT '1',
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `company_id` (`company_id`),
  KEY `visitor_id` (`visitor_id`),
  KEY `group_id` (`group_id`)
) ENGINE=InnoDB AUTO_INCREMENT=21362 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `visitors`
--

DROP TABLE IF EXISTS `visitors`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `visitors` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int(10) unsigned NOT NULL,
  `country_id` int(10) unsigned NOT NULL,
  `name` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `note` varchar(4096) COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  `phone` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `address` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `enabled` tinyint(4) DEFAULT '1',
  `last_activity` datetime DEFAULT NULL,
  `created` datetime NOT NULL,
  `modified` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `company_id` (`company_id`),
  KEY `country_id` (`country_id`)
) ENGINE=InnoDB AUTO_INCREMENT=17238 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2015-10-09 17:42:05
