# -----------------------
# Land Down Under v420 > v450 upgrade
# Run this script in phpMyAdmin to update tables
# in your MySQL database
# -----------------------

CREATE TABLE ldu_plugins (
  plugin_id int(11) NOT NULL auto_increment,
  plugin_name varchar(32) NOT NULL default '',
  plugin_value text,
  PRIMARY KEY (plugin_id),
  KEY plugin_name (plugin_name)
) TYPE=MyISAM; 

CREATE TABLE ldu_pm (
  pm_id int(11) unsigned NOT NULL auto_increment,
  pm_state tinyint(2) NOT NULL default '0',
  pm_date datetime NOT NULL default '0000-00-00 00:00:00',
  pm_fromuserid int(11) NOT NULL default '0',
  pm_fromuser varchar(24) NOT NULL default '0',
  pm_touserid int(11) NOT NULL default '0',
  pm_title varchar(64) NOT NULL default '0',
  pm_text text NOT NULL,
  PRIMARY KEY  (pm_id),
  KEY pm_fromuserid (pm_fromuserid),
  KEY pm_touserid (pm_touserid)
) TYPE=MyISAM;

ALTER TABLE ldu_users ADD COLUMN user_extra5 varchar(255) NOT NULL default '' AFTER user_text;
ALTER TABLE ldu_users ADD COLUMN user_extra4 varchar(255) NOT NULL default '' AFTER user_text;
ALTER TABLE ldu_users ADD COLUMN user_extra3 varchar(255) NOT NULL default '' AFTER user_text;
ALTER TABLE ldu_users ADD COLUMN user_extra2 varchar(255) NOT NULL default '' AFTER user_text;
ALTER TABLE ldu_users ADD COLUMN user_extra1 varchar(255) NOT NULL default '' AFTER user_text;

ALTER TABLE ldu_users ADD COLUMN user_lang varchar(16) NOT NULL default '' AFTER user_skin;
INSERT INTO ldu_stats (stat_name, stat_value) VALUES ('totalpms', '0');
UPDATE ldu_users SET user_logcount='0', user_lastlog='0000-00-00 00:00' where 1;
ALTER TABLE ldu_stats MODIFY COLUMN stat_value int(11);