ALTER TABLE `torrent_config` DROP `lang_level`;
ALTER TABLE `torrent_config` ADD `announce_text` VARCHAR( 255 ) AFTER `welcome_message` ;
ALTER TABLE `torrent_config` ADD `torrent_complaints` ENUM( 'true', 'false' ) DEFAULT 'false' NOT NULL AFTER `down_limit` ;
ALTER TABLE `torrent_torrents` CHANGE `info_hash` `info_hash` VARCHAR( 20 ) BINARY DEFAULT NULL;
ALTER TABLE `torrent_torrents` ADD INDEX ( `info_hash` );



ALTER TABLE `torrent_categories` ADD UNIQUE (
`name`
);
ALTER TABLE `torrent_categories` ADD INDEX ( `sort_index` );
ALTER TABLE `torrent_download_completed` DROP INDEX `user` ;
ALTER TABLE `torrent_files` ADD UNIQUE (
`torrent` ,
`filename`
);
ALTER TABLE `torrent_peers` ADD INDEX ( `torrent` , `seeder` );
ALTER TABLE `torrent_peers` ADD UNIQUE (
`torrent` ,
`unique_id`
);
ALTER TABLE `torrent_peers` CHANGE `uid` `uid` INT( 11 ) UNSIGNED DEFAULT '0' NOT NULL ;
DROP TABLE `torrent_download`;
ALTER TABLE `torrent_config`  DROP `max_num_file_day_e`, DROP `max_num_file_week_e`;

ALTER TABLE `torrent_users` ADD `jabber` VARCHAR( 255 ) AFTER `icq` ;
ALTER TABLE `torrent_users` ADD `skype` VARCHAR( 255 ) AFTER `msn` ;

ALTER TABLE `torrent_trackers` ADD `support` ENUM( 'selective', 'global', 'single' ) DEFAULT 'selective' NOT NULL AFTER `url` ;

ALTER TABLE `torrent_online_users` DROP INDEX `id`;
ALTER TABLE `torrent_online_users` ADD PRIMARY KEY ( `id` ) ;

DROP TABLE `torrent_error_log` ;

ALTER TABLE `torrent_config` DROP `use_gzip` ;
ALTER TABLE `torrent_config` DROP `maxupload_day_num` ;
ALTER TABLE `torrent_config` DROP `maxupload_day_share` ;

ALTER TABLE `torrent_private_messages` CHANGE `from` `sender` INT( 11 ) UNSIGNED DEFAULT '0' NOT NULL ;
ALTER TABLE `torrent_private_messages` CHANGE `to` `recipient` INT( 11 ) UNSIGNED DEFAULT '0' NOT NULL;
CREATE TABLE `torrent_private_messages_blacklist` (
  `master` int(11) unsigned NOT NULL default '0',
  `slave` int(11) unsigned NOT NULL default '0',
  PRIMARY KEY  (`master`,`slave`),
  KEY `master` (`master`)
) TYPE=MyISAM;

CREATE TABLE `torrent_private_messages_bookmarks` (
  `master` int(11) unsigned NOT NULL default '0',
  `slave` int(11) unsigned NOT NULL default '0',
  PRIMARY KEY  (`master`,`slave`),
  KEY `master` (`master`)
) TYPE=MyISAM;
ALTER TABLE `torrent_private_messages` CHANGE `read` `is_read` ENUM( 'true', 'false' ) DEFAULT 'false' NOT NULL ;

ALTER TABLE `torrent_torrents` DROP INDEX `info_hash_2`;
ALTER TABLE `torrent_torrents` ADD INDEX ( `leechers` ) ;
ALTER TABLE `torrent_torrents` ADD INDEX ( `tot_peer` ) ;
ALTER TABLE `torrent_torrents` ADD INDEX ( `password` ) ;
ALTER TABLE `torrent_torrents` ADD INDEX ( `tracker` ) ;
ALTER TABLE `torrent_torrents` ADD INDEX ( `evidence` ) ;
ALTER TABLE `torrent_torrents` ADD INDEX `rating` ( `numratings` , `ratingsum` );
ALTER TABLE `torrent_torrents` ADD INDEX ( `numfiles` ) ;
ALTER TABLE `torrent_torrents` ADD INDEX ( `downloaded` ) ;
ALTER TABLE `torrent_torrents` DROP INDEX `category_visible` ;
ALTER TABLE `torrent_torrents` ADD INDEX ( `category` ) ;
ALTER TABLE `torrent_torrents` ADD INDEX ( `type` ) ;
ALTER TABLE `torrent_users` ADD INDEX ( `banned` ) ;