CREATE TABLE `ls_vote` ( `target_id` int(11) unsigned NOT NULL DEFAULT '0', `target_type` enum('topic','blog','user','comment') NOT NULL DEFAULT 'topic', `user_voter_id` int(11) unsigned NOT NULL, `vote_direction` tinyint(2) DEFAULT '0', `vote_value` float(9,3) NOT NULL DEFAULT '0.000', `vote_date` datetime NOT NULL, `vote_ip` varchar(15) NOT NULL DEFAULT '', `old_vote` float(9,3) NOT NULL DEFAULT '0.000', PRIMARY KEY (`target_id`,`target_type`,`user_voter_id`), KEY `user_voter_id` (`user_voter_id`), KEY `vote_ip` (`vote_ip`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;