text: -- phpMyAdmin SQL Dump
  -- version 4.4.13.1
  -- http://www.phpmyadmin.net
  --
  -- Host: localhost:3306
  -- Generation Time: Nov 25, 2015 at 09:47 PM
  -- Server version: 5.6.26
  -- PHP Version: 5.5.29
  
  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 */;
  
  --
  -- Database: `eventos`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `blocked`
  --
  
  CREATE TABLE IF NOT EXISTS `blocked` (
    `id` int(11) NOT NULL,
    `user_id` int(11) NOT NULL,
    `blocked_user` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `blog`
  --
  
  CREATE TABLE IF NOT EXISTS `blog` (
    `id` int(11) unsigned NOT NULL,
    `text` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `id_user` tinyint(3) unsigned DEFAULT NULL,
    `id_event` tinyint(3) unsigned DEFAULT NULL
  ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `conversation`
  --
  
  CREATE TABLE IF NOT EXISTS `conversation` (
    `id` int(11) NOT NULL,
    `time` date NOT NULL
  ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `event`
  --
  
  CREATE TABLE IF NOT EXISTS `event` (
    `id` int(11) unsigned NOT NULL,
    `id_admin` tinyint(3) unsigned DEFAULT NULL,
    `place` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `date` datetime DEFAULT NULL,
    `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `lat` double DEFAULT NULL,
    `lon` double DEFAULT NULL
  ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `eventimg`
  --
  
  CREATE TABLE IF NOT EXISTS `eventimg` (
    `id` int(11) unsigned NOT NULL,
    `id_event` tinyint(3) unsigned DEFAULT NULL,
    `url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
  ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `eventtitlepic`
  --
  
  CREATE TABLE IF NOT EXISTS `eventtitlepic` (
    `id_event` tinyint(3) unsigned DEFAULT NULL,
    `url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `eventtitlepic`
  --
  
  INSERT INTO `eventtitlepic` (`id_event`, `url`) VALUES
  (5, '/web/img/eventsImg/manzana.jpg');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `mappositions`
  --
  
  CREATE TABLE IF NOT EXISTS `mappositions` (
    `eventID` int(11) unsigned NOT NULL,
    `lat` double NOT NULL,
    `lng` double NOT NULL,
    `featType` char(255) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `messages`
  --
  
  CREATE TABLE IF NOT EXISTS `messages` (
    `id` int(11) NOT NULL,
    `message` text NOT NULL,
    `sender_id` int(11) NOT NULL,
    `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `conversation_id` int(11) NOT NULL
  ) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `participants`
  --
  
  CREATE TABLE IF NOT EXISTS `participants` (
    `id` int(11) NOT NULL,
    `conversation_id` int(11) NOT NULL,
    `user_id` int(11) NOT NULL
  ) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `personalschedule`
  --
  
  CREATE TABLE IF NOT EXISTS `personalschedule` (
    `id` int(11) NOT NULL,
    `id_user` int(11) NOT NULL,
    `start_date` int(11) NOT NULL,
    `end_date` int(11) NOT NULL,
    `name` varchar(255) NOT NULL,
    `description` varchar(255) NOT NULL,
    `id_conference` int(11) NOT NULL
  ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `rsvp`
  --
  
  CREATE TABLE IF NOT EXISTS `rsvp` (
    `id` int(11) unsigned NOT NULL,
    `id_event` tinyint(3) unsigned DEFAULT NULL,
    `id_user` int(11) unsigned DEFAULT NULL,
    `status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
  ) ENGINE=InnoDB AUTO_INCREMENT=862 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `schedule`
  --
  
  CREATE TABLE IF NOT EXISTS `schedule` (
    `id` int(11) unsigned NOT NULL,
    `id_event` tinyint(1) unsigned DEFAULT NULL,
    `start_date` int(11) unsigned DEFAULT NULL,
    `end_date` int(11) unsigned DEFAULT NULL,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
  ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `user`
  --
  
  CREATE TABLE IF NOT EXISTS `user` (
    `id` int(11) NOT NULL,
    `first_name` varchar(30) NOT NULL,
    `last_name` varchar(45) NOT NULL,
    `email` varchar(45) NOT NULL,
    `password` varchar(255) NOT NULL,
    `facebook_id` varchar(30) DEFAULT NULL,
    `twitter_id` varchar(30) DEFAULT NULL,
    `google_id` varchar(30) DEFAULT NULL,
    `company` varchar(20) DEFAULT NULL,
    `t_shirt_size` varchar(8) DEFAULT NULL,
    `food_preference` text,
    `special_needs` text,
    `language` text,
    `picture` varchar(80) DEFAULT '/web/img/profilePics/unknown.jpg',
    `role` varchar(255) DEFAULT NULL,
    `modify_date` datetime DEFAULT NULL
  ) ENGINE=InnoDB AUTO_INCREMENT=853 DEFAULT CHARSET=utf8;
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `blocked`
  --
  ALTER TABLE `blocked`
    ADD PRIMARY KEY (`id`),
    ADD KEY `userId` (`user_id`),
    ADD KEY `blockedUser` (`blocked_user`);
  
  --
  -- Indexes for table `blog`
  --
  ALTER TABLE `blog`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `conversation`
  --
  ALTER TABLE `conversation`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `event`
  --
  ALTER TABLE `event`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `eventimg`
  --
  ALTER TABLE `eventimg`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `mappositions`
  --
  ALTER TABLE `mappositions`
    ADD KEY `eventID` (`eventID`);
  
  --
  -- Indexes for table `messages`
  --
  ALTER TABLE `messages`
    ADD PRIMARY KEY (`id`),
    ADD KEY `conversationId` (`conversation_id`),
    ADD KEY `senderId` (`sender_id`);
  
  --
  -- Indexes for table `participants`
  --
  ALTER TABLE `participants`
    ADD PRIMARY KEY (`id`),
    ADD KEY `conversation_id` (`conversation_id`),
    ADD KEY `user_id` (`user_id`);
  
  --
  -- Indexes for table `personalschedule`
  --
  ALTER TABLE `personalschedule`
    ADD PRIMARY KEY (`id`),
    ADD KEY `id_user` (`id_user`),
    ADD KEY `id_conference` (`id_conference`);
  
  --
  -- Indexes for table `rsvp`
  --
  ALTER TABLE `rsvp`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `schedule`
  --
  ALTER TABLE `schedule`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `user`
  --
  ALTER TABLE `user`
    ADD PRIMARY KEY (`id`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `blocked`
  --
  ALTER TABLE `blocked`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
  --
  -- AUTO_INCREMENT for table `blog`
  --
  ALTER TABLE `blog`
    MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
  --
  -- AUTO_INCREMENT for table `conversation`
  --
  ALTER TABLE `conversation`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
  --
  -- AUTO_INCREMENT for table `event`
  --
  ALTER TABLE `event`
    MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
  --
  -- AUTO_INCREMENT for table `eventimg`
  --
  ALTER TABLE `eventimg`
    MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
  --
  -- AUTO_INCREMENT for table `messages`
  --
  ALTER TABLE `messages`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
  --
  -- AUTO_INCREMENT for table `participants`
  --
  ALTER TABLE `participants`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
  --
  -- AUTO_INCREMENT for table `personalschedule`
  --
  ALTER TABLE `personalschedule`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
  --
  -- AUTO_INCREMENT for table `rsvp`
  --
  ALTER TABLE `rsvp`
    MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
  --
  -- AUTO_INCREMENT for table `schedule`
  --
  ALTER TABLE `schedule`
    MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
  --
  -- AUTO_INCREMENT for table `user`
  --
  ALTER TABLE `user`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `blocked`
  --
  ALTER TABLE `blocked`
    ADD CONSTRAINT `blocked_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE,
    ADD CONSTRAINT `blocked_ibfk_2` FOREIGN KEY (`blocked_user`) REFERENCES `user` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `mappositions`
  --
  ALTER TABLE `mappositions`
    ADD CONSTRAINT `mappositions_ibfk_1` FOREIGN KEY (`eventID`) REFERENCES `event` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `messages`
  --
  ALTER TABLE `messages`
    ADD CONSTRAINT `messages_ibfk_1` FOREIGN KEY (`sender_id`) REFERENCES `user` (`id`) ON DELETE CASCADE,
    ADD CONSTRAINT `messages_ibfk_2` FOREIGN KEY (`conversation_id`) REFERENCES `conversation` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `participants`
  --
  ALTER TABLE `participants`
    ADD CONSTRAINT `participants_ibfk_1` FOREIGN KEY (`conversation_id`) REFERENCES `conversation` (`id`) ON DELETE CASCADE,
    ADD CONSTRAINT `participants_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `personalschedule`
  --
  ALTER TABLE `personalschedule`
    ADD CONSTRAINT `personalschedule_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `user` (`id`) ON DELETE CASCADE;
  
  /*!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 */;
  