-- Based on the page_vote table schema by Piotr Molski (Moli)
-- With tweaks by Jack Phoenix <jack@countervandalism.net>
CREATE TABLE IF NOT EXISTS /*_*/toplists_votes (
	-- Page ID
	tlv_page_id int unsigned NOT NULL,
	-- User ID
	tlv_user int unsigned NOT NULL,
	-- The user's vote (d'oh!)
	tlv_vote int(2) NOT NULL,
	-- The user's IP address at the time they cast their vote
	tlv_ip varbinary(40) NOT NULL default '',
	-- Timestamp in standard MW timestamp format
	tlv_timestamp binary(14) NOT NULL default '',
	-- MD5 hash of the user's IP address
	tlv_unique_id varchar(32) default NULL
)/*$wgDBTableOptions*/;

CREATE INDEX /*i*/tlv_user ON /*_*/toplists_votes (tlv_user, tlv_page_id);
CREATE INDEX /*i*/tlv_page_id ON /*_*/toplists_votes (tlv_page_id);
