mysql_query("CREATE TABLE ".$prefix."_pages_categories (cid INT(10) DEFAULT '0' AUTO_INCREMENT, title VARCHAR(255) NOT NULL, description TEXT NOT NULL , PRIMARY KEY (cid))");
mysql_query("ALTER TABLE ".$prefix."_pages ADD cid INT(10) DEFAULT '0' NOT NULL AFTER pid");
// Session Table Alteration
mysql_query("ALTER TABLE ".$prefix."_session CHANGE host_addr host_addr VARCHAR(48) NOT NULL");
// Statistics Table Creation
mysql_query("CREATE TABLE nuke_stats_date (year smallint(6) NOT NULL default '0', month tinyint(4) NOT NULL default '0', date tinyint(4) NOT NULL default '0', hits bigint(20) NOT NULL default '0')");
mysql_query("CREATE TABLE nuke_stats_hour (year smallint(6) NOT NULL default '0', month tinyint(4) NOT NULL default '0', date tinyint(4) NOT NULL default '0', hour tinyint(4) NOT NULL default '0', hits int(11) NOT NULL default '0')");
mysql_query("CREATE TABLE nuke_stats_month (year smallint(6) NOT NULL default '0', month tinyint(4) NOT NULL default '0', hits bigint(20) NOT NULL default '0')");
mysql_query("CREATE TABLE nuke_stats_year (year smallint(6) NOT NULL default '0', hits bigint(20) NOT NULL default '0')");
// Authors and Users Table Alteration
mysql_query("ALTER TABLE ".$prefix."_authors CHANGE aid aid VARCHAR(25) NOT NULL");
mysql_query("ALTER TABLE ".$prefix."_authors CHANGE url url VARCHAR(255) NOT NULL");
mysql_query("ALTER TABLE ".$prefix."_authors CHANGE email email VARCHAR(255) NOT NULL");
mysql_query("ALTER TABLE ".$user_prefix."_users CHANGE email email VARCHAR(255) NOT NULL");
mysql_query("ALTER TABLE ".$user_prefix."_users CHANGE femail femail VARCHAR(255) NOT NULL");
mysql_query("ALTER TABLE ".$user_prefix."_users CHANGE url url VARCHAR(255) NOT NULL");
// Repair the Encyclopedia table (an error I had... Almost always I know what I do)
@mysql_query("ALTER TABLE ".$prefix."_encyclopedia CHANGE clanguage elanguage VARCHAR(30) NOT NULL");
// Downloads & Links Table Alteration
mysql_query("ALTER TABLE ".$prefix."_downloads_categories CHANGE parentid parentid INT(11) NOT NULL");
mysql_query("ALTER TABLE ".$prefix."_links_categories CHANGE parentid parentid INT(11) NOT NULL");
// Stories Table Alteration
mysql_query("ALTER TABLE ".$prefix."_stories ADD score INT(10) DEFAULT '0' NOT NULL");
mysql_query("ALTER TABLE ".$prefix."_stories ADD ratings INT(10) DEFAULT '0' NOT NULL");