-- MySQL dump 10.13  Distrib 5.1.37, for debian-linux-gnu (i486)
--
-- Host: localhost    Database: id
-- ------------------------------------------------------
-- Server version	5.1.37-1ubuntu5

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

--
-- Temporary table structure for view `first_account_conversion`
--

DROP TABLE IF EXISTS `first_account_conversion`;
/*!50001 DROP VIEW IF EXISTS `first_account_conversion`*/;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `first_account_conversion` (
  `site_id` varchar(255),
  `visitor_id` bigint(20),
  `session_timestamp` bigint(20),
  `timestamp` bigint(20),
  `from_start_of_session` bigint(21)
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `interaction`
--

DROP TABLE IF EXISTS `interaction`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `interaction` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `visitor_id` bigint(20) DEFAULT NULL,
  `category` varchar(45) DEFAULT NULL,
  `model` varchar(45) DEFAULT NULL,
  `created` datetime DEFAULT NULL,
  `displayed` datetime DEFAULT NULL,
  `closed` datetime DEFAULT NULL,
  `actioned` datetime DEFAULT NULL,
  `displayed_url` varchar(255) DEFAULT NULL,
  `name` varchar(45) DEFAULT NULL,
  `cancelled` datetime DEFAULT NULL,
  `cancelled_reason` varchar(255) DEFAULT NULL,
  `site_id` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `interaction`
--

LOCK TABLES `interaction` WRITE;
/*!40000 ALTER TABLE `interaction` DISABLE KEYS */;
/*!40000 ALTER TABLE `interaction` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Temporary table structure for view `log_view`
--

DROP TABLE IF EXISTS `log_view`;
/*!50001 DROP VIEW IF EXISTS `log_view`*/;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `log_view` (
  `site_id` varchar(255),
  `visitor_id` bigint(20),
  `first_session_id` bigint(20),
  `first_session_timestamp` bigint(20),
  `last_session_id` bigint(20),
  `session_id` bigint(20),
  `session_timestamp` bigint(20),
  `session_last_req` bigint(20),
  `num_pageviews` int(11),
  `prior_session_lastreq` bigint(20),
  `prior_session_id` bigint(20),
  `time_sinse_priorsession` int(11),
  `first_page_id` bigint(20),
  `last_page_id` bigint(20),
  `request_id` bigint(20),
  `request_timestamp` bigint(20),
  `request_last_req` bigint(20),
  `document_id` bigint(20),
  `url` varchar(255),
  `page_title` varchar(255)
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;

--
-- Temporary table structure for view `pre_account_conversion_log_view`
--

DROP TABLE IF EXISTS `pre_account_conversion_log_view`;
/*!50001 DROP VIEW IF EXISTS `pre_account_conversion_log_view`*/;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `pre_account_conversion_log_view` (
  `site_id` varchar(255),
  `visitor_id` bigint(20),
  `first_session_id` bigint(20),
  `first_session_timestamp` bigint(20),
  `last_session_id` bigint(20),
  `session_id` bigint(20),
  `session_timestamp` bigint(20),
  `session_last_req` bigint(20),
  `num_pageviews` int(11),
  `prior_session_lastreq` bigint(20),
  `prior_session_id` bigint(20),
  `time_sinse_priorsession` int(11),
  `first_page_id` bigint(20),
  `last_page_id` bigint(20),
  `request_id` bigint(20),
  `request_timestamp` bigint(20),
  `request_last_req` bigint(20),
  `document_id` bigint(20),
  `url` varchar(255),
  `page_title` varchar(255)
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;

--
-- Temporary table structure for view `pre_account_conversion_session_view`
--

DROP TABLE IF EXISTS `pre_account_conversion_session_view`;
/*!50001 DROP VIEW IF EXISTS `pre_account_conversion_session_view`*/;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `pre_account_conversion_session_view` (
  `visitor_id` bigint(20),
  `site_id` varchar(255),
  `session_id` bigint(20),
  `session_last_req` bigint(20),
  `session_timestamp` bigint(20),
  `prior_session_id` bigint(20),
  `prior_session_lastreq` bigint(20)
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `predictor_event`
--

DROP TABLE IF EXISTS `predictor_event`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `predictor_event` (
  `id` int(11) NOT NULL,
  `name` varchar(45) DEFAULT NULL,
  `timestamp` int(11) DEFAULT NULL,
  `date` datetime DEFAULT NULL,
  `visitor_id` varchar(45) DEFAULT NULL,
  `site_id` varchar(45) DEFAULT NULL,
  `category` varchar(45) DEFAULT NULL,
  `post_data` varchar(45) DEFAULT NULL,
  `result` varchar(45) DEFAULT NULL,
  `raw_data` text,
  `url` varchar(255) DEFAULT NULL,
  `last_request_id` bigint(20) DEFAULT NULL,
  `session_id` bigint(20) DEFAULT NULL,
  `last_request_timestamp` int(11) DEFAULT NULL,
  `session_timestamp` int(11) DEFAULT NULL,
  `goal` varchar(45) DEFAULT NULL,
  `predictor` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `predictor_event`
--

LOCK TABLES `predictor_event` WRITE;
/*!40000 ALTER TABLE `predictor_event` DISABLE KEYS */;
/*!40000 ALTER TABLE `predictor_event` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `score`
--

DROP TABLE IF EXISTS `score`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `score` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `visitor_id` bigint(20) DEFAULT NULL,
  `timestamp` datetime DEFAULT NULL,
  `request_id` bigint(20) DEFAULT NULL,
  `value` decimal(3,2) DEFAULT NULL,
  `category` varchar(45) DEFAULT NULL,
  `model` varchar(45) DEFAULT NULL,
  `site_id` varchar(255) DEFAULT NULL,
  `client` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `score`
--

LOCK TABLES `score` WRITE;
/*!40000 ALTER TABLE `score` DISABLE KEYS */;
/*!40000 ALTER TABLE `score` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Temporary table structure for view `session_view`
--

DROP TABLE IF EXISTS `session_view`;
/*!50001 DROP VIEW IF EXISTS `session_view`*/;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `session_view` (
  `visitor_id` bigint(20),
  `site_id` varchar(255),
  `session_id` bigint(20),
  `session_last_req` bigint(20),
  `session_timestamp` bigint(20),
  `prior_session_id` bigint(20),
  `prior_session_lastreq` bigint(20),
  `time_sinse_priorsession` int(11),
  `num_pageviews` int(11)
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `visitor_predictors`
--

DROP TABLE IF EXISTS `visitor_predictors`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `visitor_predictors` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(45) DEFAULT NULL,
  `predictors` longtext NOT NULL,
  `category` varchar(45) DEFAULT NULL,
  `visitor_id` bigint(20) NOT NULL,
  `site_id` varchar(255) NOT NULL,
  `timestamp` int(11) DEFAULT NULL,
  `sequence` tinyint(4) DEFAULT NULL,
  `max_timestamp` int(11) DEFAULT NULL,
  `min_timestamp` int(11) DEFAULT NULL,
  `locked` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `comp_key` (`category`,`visitor_id`,`site_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `visitor_predictors`
--

LOCK TABLES `visitor_predictors` WRITE;
/*!40000 ALTER TABLE `visitor_predictors` DISABLE KEYS */;
/*!40000 ALTER TABLE `visitor_predictors` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Final view structure for view `first_account_conversion`
--

/*!50001 DROP TABLE `first_account_conversion`*/;
/*!50001 DROP VIEW IF EXISTS `first_account_conversion`*/;
/*!50001 SET @saved_cs_client          = @@character_set_client */;
/*!50001 SET @saved_cs_results         = @@character_set_results */;
/*!50001 SET @saved_col_connection     = @@collation_connection */;
/*!50001 SET character_set_client      = utf8 */;
/*!50001 SET character_set_results     = utf8 */;
/*!50001 SET collation_connection      = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `first_account_conversion` AS select `s`.`site_id` AS `site_id`,`s`.`visitor_id` AS `visitor_id`,min(`s`.`timestamp`) AS `session_timestamp`,min(`r`.`timestamp`) AS `timestamp`,(min(`r`.`timestamp`) - min(`s`.`timestamp`)) AS `from_start_of_session` from (`otowa`.`owa_request` `r` join `otowa`.`owa_session` `s` on((`r`.`session_id` = `s`.`id`))) where (`r`.`document_id` = '-1611674786') group by `s`.`visitor_id`,`s`.`site_id` having (count(0) >= 6) */;
/*!50001 SET character_set_client      = @saved_cs_client */;
/*!50001 SET character_set_results     = @saved_cs_results */;
/*!50001 SET collation_connection      = @saved_col_connection */;

--
-- Final view structure for view `log_view`
--

/*!50001 DROP TABLE `log_view`*/;
/*!50001 DROP VIEW IF EXISTS `log_view`*/;
/*!50001 SET @saved_cs_client          = @@character_set_client */;
/*!50001 SET @saved_cs_results         = @@character_set_results */;
/*!50001 SET @saved_col_connection     = @@collation_connection */;
/*!50001 SET character_set_client      = utf8 */;
/*!50001 SET character_set_results     = utf8 */;
/*!50001 SET collation_connection      = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `log_view` AS select `s`.`site_id` AS `site_id`,`v`.`id` AS `visitor_id`,`v`.`first_session_id` AS `first_session_id`,`v`.`first_session_timestamp` AS `first_session_timestamp`,`v`.`last_session_id` AS `last_session_id`,`s`.`id` AS `session_id`,`s`.`timestamp` AS `session_timestamp`,`s`.`last_req` AS `session_last_req`,`s`.`num_pageviews` AS `num_pageviews`,`s`.`prior_session_lastreq` AS `prior_session_lastreq`,`s`.`prior_session_id` AS `prior_session_id`,`s`.`time_sinse_priorsession` AS `time_sinse_priorsession`,`s`.`first_page_id` AS `first_page_id`,`s`.`last_page_id` AS `last_page_id`,`r`.`id` AS `request_id`,`r`.`timestamp` AS `request_timestamp`,`r`.`last_req` AS `request_last_req`,`d`.`id` AS `document_id`,`d`.`url` AS `url`,`d`.`page_title` AS `page_title` from (((`otowa`.`owa_visitor` `v` join `otowa`.`owa_session` `s` on((`v`.`id` = `s`.`visitor_id`))) join `otowa`.`owa_request` `r` on((`r`.`session_id` = `s`.`id`))) join `otowa`.`owa_document` `d` on((`r`.`document_id` = `d`.`id`))) */;
/*!50001 SET character_set_client      = @saved_cs_client */;
/*!50001 SET character_set_results     = @saved_cs_results */;
/*!50001 SET collation_connection      = @saved_col_connection */;

--
-- Final view structure for view `pre_account_conversion_log_view`
--

/*!50001 DROP TABLE `pre_account_conversion_log_view`*/;
/*!50001 DROP VIEW IF EXISTS `pre_account_conversion_log_view`*/;
/*!50001 SET @saved_cs_client          = @@character_set_client */;
/*!50001 SET @saved_cs_results         = @@character_set_results */;
/*!50001 SET @saved_col_connection     = @@collation_connection */;
/*!50001 SET character_set_client      = utf8 */;
/*!50001 SET character_set_results     = utf8 */;
/*!50001 SET collation_connection      = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pre_account_conversion_log_view` AS select `lv`.`site_id` AS `site_id`,`lv`.`visitor_id` AS `visitor_id`,`lv`.`first_session_id` AS `first_session_id`,`lv`.`first_session_timestamp` AS `first_session_timestamp`,`lv`.`last_session_id` AS `last_session_id`,`lv`.`session_id` AS `session_id`,`lv`.`session_timestamp` AS `session_timestamp`,`lv`.`session_last_req` AS `session_last_req`,`lv`.`num_pageviews` AS `num_pageviews`,`lv`.`prior_session_lastreq` AS `prior_session_lastreq`,`lv`.`prior_session_id` AS `prior_session_id`,`lv`.`time_sinse_priorsession` AS `time_sinse_priorsession`,`lv`.`first_page_id` AS `first_page_id`,`lv`.`last_page_id` AS `last_page_id`,`lv`.`request_id` AS `request_id`,`lv`.`request_timestamp` AS `request_timestamp`,`lv`.`request_last_req` AS `request_last_req`,`lv`.`document_id` AS `document_id`,`lv`.`url` AS `url`,`lv`.`page_title` AS `page_title` from (`id`.`log_view` `lv` left join `id`.`first_account_conversion` `fac` on(((`lv`.`site_id` = `fac`.`site_id`) and (`lv`.`visitor_id` = `fac`.`visitor_id`)))) where (isnull(`fac`.`visitor_id`) or (`lv`.`request_timestamp` < `fac`.`timestamp`)) */;
/*!50001 SET character_set_client      = @saved_cs_client */;
/*!50001 SET character_set_results     = @saved_cs_results */;
/*!50001 SET collation_connection      = @saved_col_connection */;

--
-- Final view structure for view `pre_account_conversion_session_view`
--

/*!50001 DROP TABLE `pre_account_conversion_session_view`*/;
/*!50001 DROP VIEW IF EXISTS `pre_account_conversion_session_view`*/;
/*!50001 SET @saved_cs_client          = @@character_set_client */;
/*!50001 SET @saved_cs_results         = @@character_set_results */;
/*!50001 SET @saved_col_connection     = @@collation_connection */;
/*!50001 SET character_set_client      = utf8 */;
/*!50001 SET character_set_results     = utf8 */;
/*!50001 SET collation_connection      = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pre_account_conversion_session_view` AS select `pre_account_conversion_log_view`.`visitor_id` AS `visitor_id`,`pre_account_conversion_log_view`.`site_id` AS `site_id`,`pre_account_conversion_log_view`.`session_id` AS `session_id`,`pre_account_conversion_log_view`.`session_last_req` AS `session_last_req`,`pre_account_conversion_log_view`.`session_timestamp` AS `session_timestamp`,`pre_account_conversion_log_view`.`prior_session_id` AS `prior_session_id`,`pre_account_conversion_log_view`.`prior_session_lastreq` AS `prior_session_lastreq` from `id`.`pre_account_conversion_log_view` group by `pre_account_conversion_log_view`.`session_id`,`pre_account_conversion_log_view`.`site_id`,`pre_account_conversion_log_view`.`visitor_id` */;
/*!50001 SET character_set_client      = @saved_cs_client */;
/*!50001 SET character_set_results     = @saved_cs_results */;
/*!50001 SET collation_connection      = @saved_col_connection */;

--
-- Final view structure for view `session_view`
--

/*!50001 DROP TABLE `session_view`*/;
/*!50001 DROP VIEW IF EXISTS `session_view`*/;
/*!50001 SET @saved_cs_client          = @@character_set_client */;
/*!50001 SET @saved_cs_results         = @@character_set_results */;
/*!50001 SET @saved_col_connection     = @@collation_connection */;
/*!50001 SET character_set_client      = utf8 */;
/*!50001 SET character_set_results     = utf8 */;
/*!50001 SET collation_connection      = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `session_view` AS select `otowa`.`owa_session`.`visitor_id` AS `visitor_id`,`otowa`.`owa_session`.`site_id` AS `site_id`,`otowa`.`owa_session`.`id` AS `session_id`,`otowa`.`owa_session`.`last_req` AS `session_last_req`,`otowa`.`owa_session`.`timestamp` AS `session_timestamp`,`otowa`.`owa_session`.`prior_session_id` AS `prior_session_id`,`otowa`.`owa_session`.`prior_session_lastreq` AS `prior_session_lastreq`,`otowa`.`owa_session`.`time_sinse_priorsession` AS `time_sinse_priorsession`,`otowa`.`owa_session`.`num_pageviews` AS `num_pageviews` from `otowa`.`owa_session` */;
/*!50001 SET character_set_client      = @saved_cs_client */;
/*!50001 SET character_set_results     = @saved_cs_results */;
/*!50001 SET collation_connection      = @saved_col_connection */;
/*!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 2010-03-13  0:15:56

