# -----------------------
# Land Down Under v475 > v480 upgrade / 2002-oct-16
# Run this script in phpMyAdmin to update tables
# in your MySQL database
# -----------------------

CREATE TABLE ldu_buddies (
  buddies_id int(11) NOT NULL auto_increment,
  buddies_ownerid int(11) NOT NULL default '0',
  buddies_buddyid int(11) NOT NULL default '0',
  buddies_buddyname varchar(24) NOT NULL default '',
  PRIMARY KEY  (buddies_id),
  KEY com_code (buddies_ownerid)
) TYPE=MyISAM;

CREATE TABLE ldu_forum_posts (
  fp_id mediumint(8) unsigned NOT NULL auto_increment,
  fp_topicid mediumint(8) NOT NULL default '0',
  fp_sectionid smallint(5) NOT NULL default '0',
  fp_posterid int(11) NOT NULL default '-1',
  fp_postername varchar(24) NOT NULL default '',
  fp_updated int(11) NOT NULL default '0',
  fp_text text NOT NULL,
  PRIMARY KEY  (fp_id),
  KEY fp_updated (fp_updated)
) TYPE=MyISAM;

CREATE TABLE ldu_forum_sections (
  fs_id smallint(5) unsigned NOT NULL auto_increment,
  fs_state tinyint(1) unsigned NOT NULL default '0',
  fs_order smallint(5) unsigned NOT NULL default '0',
  fs_minlevel tinyint(2) unsigned NOT NULL default '0',
  fs_title varchar(128) NOT NULL default '',
  fs_desc varchar(255) NOT NULL default '',
  fs_icon varchar(255) NOT NULL default '',
  fs_topiccount smallint(5) NOT NULL default '0',
  fs_postcount smallint(5) NOT NULL default '0',
  fs_viewcount mediumint(8) NOT NULL default '0',
  PRIMARY KEY  (fs_id),
  KEY fs_order (fs_order)
) TYPE=MyISAM;

CREATE TABLE ldu_forum_topics (
  ft_id mediumint(8) unsigned NOT NULL auto_increment,
  ft_state tinyint(1) unsigned NOT NULL default '0',
  ft_sticky tinyint(1) unsigned NOT NULL default '0',
  ft_sectionid mediumint(8) NOT NULL default '0',
  ft_title varchar(64) NOT NULL default '',
  ft_creationdate int(11) NOT NULL default '0',
  ft_updated int(11) NOT NULL default '0',
  ft_postcount smallint(5) NOT NULL default '0',
  ft_viewcount mediumint(8) NOT NULL default '0',
  PRIMARY KEY  (ft_id),
  KEY ft_updated (ft_updated)
) TYPE=MyISAM;

INSERT INTO ldu_config VALUES ('28', 'latesttopics', 2, '5');
INSERT INTO ldu_config VALUES ('28', 'maxtopicsperpage', 2, '25');
INSERT INTO ldu_config VALUES ('30', 'disableforums', 3, '0');
INSERT INTO ldu_config VALUES ('35', 'parsebbcodeforums', 3, '1');
INSERT INTO ldu_config VALUES ('35', 'parsesmiliesforums', 3, '1');
INSERT INTO ldu_forum_sections VALUES ('1', '0', '10', '0', 'General discussion', 'General chat.', 'system/img/forums.gif', '0', '0', '0');
INSERT INTO ldu_forum_sections VALUES ('2', '0', '20', '0', 'Off-topic', 'Various and off-topic.', 'system/img/forums.gif', '0', '0', '0');
INSERT INTO ldu_forum_sections VALUES ('3', '0', '30', '0', 'Twilight zone !', 'Testing area ...', 'system/img/forums.gif', '0', '0', '0');
UPDATE ldu_pm SET pm_state=1 WHERE PM_state=0;
INSERT INTO ldu_stats (stat_name, stat_value) VALUES ('version', '480');
DELETE FROM ldu_config WHERE config_name='logtofile';



