Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE log (
- log_id int(10) unsigned NOT NULL AUTO_INCREMENT,
- user_id int(10) unsigned NOT NULL,
- log_ip varchar(15) NOT NULL,
- log_error_text text NOT NULL,
- log_occured_on datetime NOT NULL,
- PRIMARY KEY (log_id),
- KEY user_id (user_id),
- KEY log_occured_on (log_occured_on)
- ) TYPE=InnoDB AUTO_INCREMENT=2 ;
- CREATE TABLE peer (
- peer_id int(10) unsigned NOT NULL PRIMARY KEY,
- peer_info_hash char(20) binary NOT NULL,
- torrent_id int(10) unsigned NOT NULL,
- user_id int(10) unsigned NOT NULL,
- peer_ip int(11) NOT NULL DEFAULT '0',
- peer_port smallint(5) unsigned NOT NULL DEFAULT '0',
- peer_update_time timestamp NOT NULL,
- peer_expire_time timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- peer_left bigint(20) unsigned NOT NULL,
- peer_uploaded bigint(20) unsigned NOT NULL,
- peer_downloaded bigint(20) unsigned NOT NULL,
- peer_upload_speed int(11) unsigned NOT NULL,
- peer_download_speed int(11) unsigned NOT NULL,
- UNIQUE KEY hash(peer_info_hash,peer_ip,peer_port),
- KEY torrent_id (torrent_id),
- KEY peer_left (peer_left),
- KEY peer_expire_time (peer_expire_time),
- KEY peer_update_time (peer_update_time),
- KEY user_id (user_id)
- ) TYPE=HEAP;
- CREATE TABLE session (
- session_id char(40) NOT NULL,
- user_id int(11) unsigned NOT NULL,
- session_ip char(15) NOT NULL,
- session_expire_time datetime NOT NULL,
- PRIMARY KEY (session_id),
- KEY user_id (user_id)
- ) TYPE=HEAP;
- CREATE TABLE torrent (
- torrent_id int(10) unsigned NOT NULL AUTO_INCREMENT,
- torrent_info_hash char(20) binary NOT NULL,
- torrent_downloaded_last_month int(10) unsigned NOT NULL DEFAULT '0',
- torrent_downloaded_this_month int(10) unsigned NOT NULL DEFAULT '0',
- torrent_file_name char(200) NOT NULL,
- torrent_file_path text NOT NULL,
- torrent_size bigint(20) unsigned NOT NULL,
- PRIMARY KEY (torrent_id),
- UNIQUE KEY torrent_info_hash (torrent_info_hash)
- ) TYPE=InnoDB AUTO_INCREMENT=57 ;
- CREATE TABLE user (
- user_id int(10) unsigned NOT NULL AUTO_INCREMENT,
- user_serial char(40) NOT NULL,
- user_account_status enum('Active','Suspended') NOT NULL,
- user_access_levels text NOT NULL,
- user_torrent_uid char(8) binary NOT NULL,
- user_closure_reason text,
- user_closure_reason_public text,
- user_uploaded_total bigint(20) unsigned NOT NULL DEFAULT '0',
- user_uploaded_month bigint(20) unsigned NOT NULL DEFAULT '0',
- user_uploaded_week bigint(20) unsigned NOT NULL DEFAULT '0',
- user_uploaded_day bigint(20) unsigned NOT NULL DEFAULT '0',
- user_downloaded_total bigint(20) unsigned NOT NULL DEFAULT '0',
- user_downloaded_month bigint(20) unsigned NOT NULL DEFAULT '0',
- user_downloaded_week bigint(20) unsigned NOT NULL DEFAULT '0',
- user_downloaded_day bigint(20) unsigned NOT NULL DEFAULT '0',
- user_webdownloaded_total bigint(20) unsigned NOT NULL DEFAULT '0',
- user_webdownloaded_month bigint(20) unsigned NOT NULL DEFAULT '0',
- user_webdownloaded_week bigint(20) unsigned NOT NULL DEFAULT '0',
- user_webdownloaded_day bigint(20) unsigned NOT NULL DEFAULT '0',
- user_torrentfiles_total int(10) unsigned NOT NULL DEFAULT '0',
- user_torrentfiles_month int(10) unsigned NOT NULL DEFAULT '0',
- user_torrentfiles_week int(10) unsigned NOT NULL DEFAULT '0',
- user_torrentfiles_day int(10) unsigned NOT NULL DEFAULT '0',
- user_no_traffic_limits enum('Y','N') NOT NULL DEFAULT 'N',
- PRIMARY KEY (user_id),
- UNIQUE KEY user_serial (user_serial),
- UNIQUE KEY user_torrent_uid (user_torrent_uid)
- ) TYPE=InnoDB PACK_KEYS=0 AUTO_INCREMENT=3 ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement