/*!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 `edits`
--

DROP TABLE IF EXISTS edits;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE edits (
  id int(10) unsigned NOT NULL auto_increment,
  post_id int(10) unsigned NOT NULL default '0',
  user_id int(10) unsigned NOT NULL default '0',
  `time` int(10) unsigned NOT NULL default '0',
  old_content mediumtext NOT NULL,
  PRIMARY KEY  (id),
  KEY POSTID USING BTREE (post_id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `error_log`
--

DROP TABLE IF EXISTS error_log;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE error_log (
  id int(10) unsigned NOT NULL auto_increment,
  `time` int(10) unsigned NOT NULL default '0',
  user_id int(10) unsigned NOT NULL default '0',
  ip int(10) unsigned NOT NULL default '0',
  path tinytext NOT NULL,
  method enum('POST','GET') default NULL,
  `query` text NOT NULL,
  error text NOT NULL,
  PRIMARY KEY  (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `forums`
--

DROP TABLE IF EXISTS forums;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE forums (
  id int(10) unsigned NOT NULL auto_increment,
  `name` varchar(80) NOT NULL default 'Untitled Forum',
  last_post_id int(10) unsigned default NULL,
  thread_count int(10) unsigned NOT NULL default '0',
  post_count int(10) unsigned NOT NULL default '0',
  flags set('header') NOT NULL,
  accessibility enum('normal','locked','archive','hidden') NOT NULL default 'normal',
  description varchar(255) NOT NULL,
  PRIMARY KEY  (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `group_permissions`
--

DROP TABLE IF EXISTS group_permissions;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE group_permissions (
  group_id int(10) unsigned NOT NULL default '0',
  permission varchar(64) NOT NULL default '',
  scope varchar(64) NOT NULL default '',
  polarity enum('allow','deny') default NULL,
  PRIMARY KEY  USING BTREE (group_id,permission,scope)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

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

DROP TABLE IF EXISTS groups;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE groups (
  id int(10) unsigned NOT NULL auto_increment,
  icon tinytext NOT NULL,
  `name` tinytext NOT NULL,
  UNIQUE KEY id (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

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

DROP TABLE IF EXISTS messages;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE messages (
  id int(10) unsigned NOT NULL auto_increment,
  from_user_id int(10) unsigned NOT NULL default '0',
  to_user_id int(10) unsigned NOT NULL default '0',
  `time` int(10) unsigned NOT NULL default '0',
  `subject` tinytext NOT NULL,
  message mediumtext NOT NULL,
  PRIMARY KEY  (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `posts`
--

DROP TABLE IF EXISTS posts;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE posts (
  id int(10) unsigned NOT NULL auto_increment,
  thread_id int(10) unsigned NOT NULL default '0',
  user_id int(10) unsigned NOT NULL default '0',
  flags set('deleted') NOT NULL default '',
  `time` int(10) unsigned NOT NULL default '0',
  format enum('bbcode','raw','html') NOT NULL default 'raw',
  content mediumtext NOT NULL,
  last_edit_id int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (id),
  KEY THREAD USING BTREE (thread_id),
  KEY `USER` USING BTREE (user_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `sessions`
--

DROP TABLE IF EXISTS sessions;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE sessions (
  id varchar(72) NOT NULL default '',
  user_id int(10) unsigned NOT NULL default '0',
  time_expires int(10) unsigned default NULL,
  `data` mediumtext,
  PRIMARY KEY  USING BTREE (id),
  KEY USER_ID USING BTREE (user_id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `shoutbox`
--

DROP TABLE IF EXISTS shoutbox;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE shoutbox (
  id int(10) unsigned NOT NULL auto_increment,
  `name` varchar(24) NOT NULL default 'Anonymous',
  user_id int(10) unsigned default NULL,
  ip int(10) unsigned NOT NULL default '0',
  `time` int(10) unsigned NOT NULL default '0',
  content mediumtext NOT NULL,
  PRIMARY KEY  (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `threads`
--

DROP TABLE IF EXISTS threads;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE threads (
  id int(10) unsigned NOT NULL auto_increment,
  forum_id int(10) unsigned NOT NULL default '0',
  `subject` varchar(48) NOT NULL default 'Untitled Thread',
  blurb varchar(96) NOT NULL default '',
  first_post_id int(10) unsigned NOT NULL,
  last_post_id int(10) unsigned NOT NULL,
  last_post_time int(10) unsigned NOT NULL default '0',
  post_count int(10) unsigned NOT NULL default '0',
  view_count int(10) unsigned NOT NULL default '0',
  flags set('locked','sticky','announcement','deleted') NOT NULL default '',
  PRIMARY KEY  (id),
  KEY FORUMID USING BTREE (forum_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `thread_views`
--

DROP TABLE IF EXISTS thread_views;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE thread_views (
  thread_id int(10) unsigned NOT NULL,
  user_id int(10) unsigned NOT NULL,
  last_viewed int(10) unsigned NOT NULL,
  PRIMARY KEY  (thread_id,user_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `user_groups`
--

DROP TABLE IF EXISTS user_groups;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE user_groups (
  user_id int(10) unsigned NOT NULL default '0',
  group_id tinyint(3) unsigned NOT NULL default '0',
  priority tinyint(3) unsigned NOT NULL default '0',
  PRIMARY KEY  USING BTREE (user_id,group_id,priority),
  KEY user_id USING BTREE (user_id),
  KEY group_id USING BTREE (group_id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

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

DROP TABLE IF EXISTS users;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE users (
  id int(10) unsigned NOT NULL auto_increment,
  `name` varchar(20) NOT NULL default '',
  `password` varchar(40) NOT NULL,
  time_joined int(10) unsigned NOT NULL default '0',
  time_active int(10) unsigned NOT NULL default '0',
  thread_view_cutoff int(10) unsigned NOT NULL,
  post_count int(10) unsigned NOT NULL default '0',
  flags set('lockedsig','lockedavatar','lockedtitle') NOT NULL default '',
  news_pic varchar(64) default NULL,
  avatar varchar(64) default NULL,
  contact_aim varchar(32) NOT NULL default '',
  contact_icq varchar(32) NOT NULL default '',
  contact_msn varchar(32) NOT NULL default '',
  contact_yim varchar(32) NOT NULL default '',
  contact_lj varchar(32) NOT NULL default '',
  contact_homepage varchar(96) NOT NULL default '',
  contact_email varchar(32) NOT NULL default '',
  pm_icon enum('bead','bellossom','dream','duskull','eatmail','gorgeous','letter','magnemite','pika','retro','slakoth','vee','wailmer','wingull','zigzagoon') NOT NULL default 'letter',
  custom_title varchar(32) NOT NULL,
  signature mediumtext NOT NULL,
  is_dumb tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (id),
  UNIQUE KEY `NAME` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
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 */;

