text: 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 utf8 */;
  
  --
  -- Database: `bugtracker`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `bugs`
  --
  
  CREATE TABLE IF NOT EXISTS `bugs` (
    `id` int(11) NOT NULL,
    `status_id` int(11) NOT NULL DEFAULT '1',
    `user_id` int(11) NOT NULL,
    `version_id` int(11) NOT NULL,
    `title` varchar(255) NOT NULL,
    `contents` longtext NOT NULL,
    `type_id` int(11) NOT NULL,
    `priority_id` int(11) NOT NULL,
    `component_id` int(11) NOT NULL,
    `milestone_id` int(11) DEFAULT NULL,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
  ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `bugs`
  --
  
  INSERT INTO `bugs` (`id`, `status_id`, `user_id`, `version_id`, `title`, `contents`, `type_id`, `priority_id`, `component_id`, `milestone_id`, `created_at`, `updated_at`) VALUES
  (1, 1, 1, 1, 'This is a test bug', ' Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc pharetra aliquet massa tempor semper. Vivamus tincidunt nisi in volutpat aliquet. Maecenas dictum iaculis enim, in tristique quam sodales vel. Proin id lacinia nibh. Curabitur non ante a ligula euismod porttitor. Morbi semper sed ipsum eu eleifend. Phasellus gravida risus vel mollis pretium. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.\r\n\r\nNam id sem egestas, condimentum justo nec, imperdiet libero. In imperdiet vehicula fringilla. Quisque imperdiet diam sed augue auctor tempus. Aliquam erat volutpat. Sed cursus nibh nisi, eget malesuada eros venenatis dictum. Duis ac mollis ipsum. Aenean metus augue, lacinia eget dolor sit amet, porta fermentum lorem. Praesent imperdiet elementum posuere. Praesent a porta ante, a suscipit mauris. Etiam condimentum molestie placerat. Sed imperdiet dictum urna vitae sollicitudin. Sed vulputate arcu a sem porttitor, vitae blandit erat viverra. Ut venenatis turpis condimentum lacinia tempus. Nunc est massa, auctor ut varius tincidunt, suscipit eget est. ', 1, 1, 1, NULL, '2014-01-22 11:24:08', '0000-00-00 00:00:00'),
  (4, 3, 1, 1, 'More Bugs', 'There be more bugs in here somewhere', 1, 1, 2, NULL, '2014-01-22 12:12:48', '0000-00-00 00:00:00');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `comments`
  --
  
  CREATE TABLE IF NOT EXISTS `comments` (
    `id` int(11) NOT NULL,
    `user_id` int(11) NOT NULL,
    `bug_id` int(11) NOT NULL,
    `contents` text NOT NULL,
    `thread_id` int(11) DEFAULT NULL,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `comments`
  --
  
  INSERT INTO `comments` (`id`, `user_id`, `bug_id`, `contents`, `thread_id`, `created_at`, `updated_at`) VALUES
  (1, 1, 1, 'This is some contents that can be considered a comment.', NULL, '2014-01-21 11:31:00', '0000-00-00 00:00:00');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `components`
  --
  
  CREATE TABLE IF NOT EXISTS `components` (
    `id` int(11) NOT NULL,
    `name` varchar(255) NOT NULL
  ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `components`
  --
  
  INSERT INTO `components` (`id`, `name`) VALUES
  (1, 'Graphics'),
  (2, 'Audio'),
  (3, 'Networking');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `milestones`
  --
  
  CREATE TABLE IF NOT EXISTS `milestones` (
    `id` int(11) NOT NULL,
    `name` varchar(255) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `priorities`
  --
  
  CREATE TABLE IF NOT EXISTS `priorities` (
    `id` int(11) NOT NULL,
    `name` varchar(255) NOT NULL
  ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `priorities`
  --
  
  INSERT INTO `priorities` (`id`, `name`) VALUES
  (1, 'Critical'),
  (2, 'Blocker'),
  (3, 'Major'),
  (4, 'Minor'),
  (5, 'Trivial');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `status`
  --
  
  CREATE TABLE IF NOT EXISTS `status` (
    `id` int(11) NOT NULL,
    `name` varchar(255) NOT NULL
  ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `status`
  --
  
  INSERT INTO `status` (`id`, `name`) VALUES
  (1, 'Open'),
  (2, 'Not assigned'),
  (3, 'Closed'),
  (4, 'Fixed'),
  (5, 'Verification'),
  (6, 'Non-reproducible ');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `types`
  --
  
  CREATE TABLE IF NOT EXISTS `types` (
    `id` int(11) NOT NULL,
    `name` varchar(255) NOT NULL
  ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `types`
  --
  
  INSERT INTO `types` (`id`, `name`) VALUES
  (1, 'Defect'),
  (2, 'Enhancement'),
  (3, 'Task');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `usergroups`
  --
  
  CREATE TABLE IF NOT EXISTS `usergroups` (
    `id` int(11) NOT NULL,
    `name` varchar(255) NOT NULL,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
  ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `usergroups`
  --
  
  INSERT INTO `usergroups` (`id`, `name`, `created_at`, `updated_at`) VALUES
  (1, 'Admin', '2014-01-21 10:54:43', '0000-00-00 00:00:00'),
  (2, 'User', '2014-01-21 10:54:49', '0000-00-00 00:00:00'),
  (3, 'Pending', '2014-01-21 10:54:59', '0000-00-00 00:00:00'),
  (4, 'Banned', '2014-01-21 10:55:08', '0000-00-00 00:00:00');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `users`
  --
  
  CREATE TABLE IF NOT EXISTS `users` (
    `id` int(11) NOT NULL,
    `first_name` varchar(255) NOT NULL,
    `middle_name` varchar(255) NOT NULL,
    `last_name` varchar(255) NOT NULL,
    `username` varchar(255) NOT NULL,
    `email` varchar(255) NOT NULL,
    `avatar` varchar(255) NOT NULL,
    `signature` varchar(255) NOT NULL,
    `password` varchar(255) NOT NULL,
    `group_id` int(11) NOT NULL,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `users`
  --
  
  INSERT INTO `users` (`id`, `first_name`, `middle_name`, `last_name`, `username`, `email`, `avatar`, `signature`, `password`, `group_id`, `created_at`, `updated_at`) VALUES
  (1, 'Mark', 'James', 'Lang', 'infiniteshroom', 'infiniteshroom@gmail.com', '', '', '$2a$08$9HwJ.Yvy39VkRqaE9QEsv.KuCTMrZsD6sN15FPTNBSipB2UjIC2my', 1, '2014-01-21 11:15:27', '0000-00-00 00:00:00');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `versions`
  --
  
  CREATE TABLE IF NOT EXISTS `versions` (
    `id` int(11) NOT NULL,
    `name` varchar(255) NOT NULL
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `versions`
  --
  
  INSERT INTO `versions` (`id`, `name`) VALUES
  (1, '1.0');
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `bugs`
  --
  ALTER TABLE `bugs`
    ADD PRIMARY KEY (`id`),
    ADD KEY `user_id` (`user_id`,`version_id`,`type_id`,`component_id`,`milestone_id`),
    ADD KEY `priority_id` (`priority_id`),
    ADD KEY `status_id` (`status_id`),
    ADD KEY `milestone_id` (`milestone_id`),
    ADD KEY `component_id` (`component_id`),
    ADD KEY `version_id` (`version_id`),
    ADD KEY `type_id` (`type_id`);
  
  --
  -- Indexes for table `comments`
  --
  ALTER TABLE `comments`
    ADD PRIMARY KEY (`id`),
    ADD KEY `thread_id` (`thread_id`),
    ADD KEY `user_id` (`user_id`),
    ADD KEY `blog_id` (`bug_id`);
  
  --
  -- Indexes for table `components`
  --
  ALTER TABLE `components`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `milestones`
  --
  ALTER TABLE `milestones`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `priorities`
  --
  ALTER TABLE `priorities`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `status`
  --
  ALTER TABLE `status`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `types`
  --
  ALTER TABLE `types`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `usergroups`
  --
  ALTER TABLE `usergroups`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`),
    ADD KEY `group_id` (`group_id`),
    ADD KEY `group_id_2` (`group_id`);
  
  --
  -- Indexes for table `versions`
  --
  ALTER TABLE `versions`
    ADD PRIMARY KEY (`id`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `bugs`
  --
  ALTER TABLE `bugs`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
  --
  -- AUTO_INCREMENT for table `comments`
  --
  ALTER TABLE `comments`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
  --
  -- AUTO_INCREMENT for table `components`
  --
  ALTER TABLE `components`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4;
  --
  -- AUTO_INCREMENT for table `milestones`
  --
  ALTER TABLE `milestones`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
  --
  -- AUTO_INCREMENT for table `priorities`
  --
  ALTER TABLE `priorities`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6;
  --
  -- AUTO_INCREMENT for table `status`
  --
  ALTER TABLE `status`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=7;
  --
  -- AUTO_INCREMENT for table `types`
  --
  ALTER TABLE `types`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4;
  --
  -- AUTO_INCREMENT for table `usergroups`
  --
  ALTER TABLE `usergroups`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
  --
  -- AUTO_INCREMENT for table `users`
  --
  ALTER TABLE `users`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
  --
  -- AUTO_INCREMENT for table `versions`
  --
  ALTER TABLE `versions`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `bugs`
  --
  ALTER TABLE `bugs`
    ADD CONSTRAINT `bugs_ibfk_1` FOREIGN KEY (`status_id`) REFERENCES `status` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `bugs_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `bugs_ibfk_3` FOREIGN KEY (`priority_id`) REFERENCES `priorities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `bugs_ibfk_4` FOREIGN KEY (`component_id`) REFERENCES `components` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `bugs_ibfk_5` FOREIGN KEY (`milestone_id`) REFERENCES `milestones` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `bugs_ibfk_6` FOREIGN KEY (`version_id`) REFERENCES `versions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `bugs_ibfk_7` FOREIGN KEY (`type_id`) REFERENCES `types` (`id`) ON DELETE CASCADE ON UPDATE 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 */;
  
  