CREATE TABLE `l_forum_forums` (
  `forum_id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  `describe` text,
  `total_posts` int(11) NOT NULL DEFAULT '0',
  `total_themes` int(11) NOT NULL DEFAULT '0',
  `last_post_date` int(10) unsigned DEFAULT NULL,
  `last_user_name` varchar(255) DEFAULT NULL,
  `last_user_id` int(11) NULL,
  `closed` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`forum_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `l_forum_posts` (
  `post_id` int(11) NOT NULL AUTO_INCREMENT,
  `theme_id` int(11) NOT NULL DEFAULT '0',
  `user_id` int(11) DEFAULT NULL,
  `user_name` varchar(50) DEFAULT NULL,
  `msg` text NOT NULL,
  `email` varchar(30) DEFAULT NULL,
  `putdate` int(10) unsigned DEFAULT NULL,
  `ip` varbinary(16) DEFAULT NULL,
  `hidden` int(11) NOT NULL DEFAULT '0',
  `edited` int(11) NOT NULL DEFAULT '0',
  `total_votes` int(11) NOT NULL DEFAULT '0',
  `vote_result` int(11) NOT NULL DEFAULT '0',
  `rating` int(11) NOT NULL DEFAULT '0',
  `first` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`post_id`),
  FULLTEXT KEY `name` (`user_name`,`msg`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `l_forum_themes` (
  `theme_id` int(11) NOT NULL AUTO_INCREMENT,
  `forum_id` int(11) DEFAULT NULL,
  `author_name` varchar(32) DEFAULT NULL,
  `author_id` int(11) DEFAULT NULL,
  `subject` varchar(60) NOT NULL DEFAULT '',
  `total_posts` int(11) NOT NULL DEFAULT '0',
  `last_post_date` int(10) unsigned DEFAULT NULL,
  `last_user_name` varchar(32) DEFAULT NULL,
  `last_user_id` int(11) DEFAULT NULL,
  `pinup` tinyint(4) NOT NULL DEFAULT '0',
  `hidden` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`theme_id`),
  FULLTEXT KEY `subject` (`subject`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
