text: -- phpMyAdmin SQL Dump
  -- version 3.4.10.1
  -- http://www.phpmyadmin.net
  --
  -- Host: localhost
  -- Generation Time: Jul 19, 2012 at 12:03 PM
  -- Server version: 5.5.20
  -- PHP Version: 5.3.10
  
  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: `test`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `posts`
  --
  
  CREATE TABLE IF NOT EXISTS `posts` (
    `post_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `post_text` text COLLATE utf8_unicode_ci NOT NULL,
    `post_date` datetime NOT NULL,
    `post_topic` int(10) unsigned NOT NULL,
    `post_by` int(10) unsigned NOT NULL,
    PRIMARY KEY (`post_id`),
    KEY `post_date` (`post_date`),
    KEY `post_topic` (`post_topic`),
    KEY `post_by` (`post_by`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `topics`
  --
  
  CREATE TABLE IF NOT EXISTS `topics` (
    `topic_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `topic_title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `topic_text` text COLLATE utf8_unicode_ci NOT NULL,
    `topic_date` datetime NOT NULL,
    `topic_by` int(10) unsigned NOT NULL,
    `topic_score` double NOT NULL,
    `topic_replies` int(10) unsigned NOT NULL,
    `sticky` tinyint(1) NOT NULL DEFAULT '0',
    `locked` tinyint(1) NOT NULL DEFAULT '0',
    PRIMARY KEY (`topic_id`),
    KEY `topic_by` (`topic_by`),
    KEY `topic_date` (`topic_date`),
    KEY `topic_score` (`topic_score`),
    KEY `topic_replies` (`topic_replies`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `users`
  --
  
  CREATE TABLE IF NOT EXISTS `users` (
    `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `user_name` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
    `user_pass` binary(32) NOT NULL,
    `permissions` tinyint(1) NOT NULL DEFAULT '0',
    PRIMARY KEY (`user_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `posts`
  --
  ALTER TABLE `posts`
    ADD CONSTRAINT `posts_ibfk_1` FOREIGN KEY (`post_topic`) REFERENCES `topics` (`topic_id`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `posts_ibfk_2` FOREIGN KEY (`post_by`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
  
  --
  -- Constraints for table `topics`
  --
  ALTER TABLE `topics`
    ADD CONSTRAINT `topics_ibfk_1` FOREIGN KEY (`topic_by`) REFERENCES `users` (`user_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 */;