-- 
-- SQL for CommunityVoice Extension
-- 
-- Table for ratings
DROP TABLE IF EXISTS /*$wgDBprefix*/cv_ratings_votes;
CREATE TABLE /*$wgDBPrefix*/cv_ratings_votes (
    -- Category of item being rated
    vot_category VARBINARY(255) NOT NULL default '',
    -- Title of item being rated
    vot_title VARBINARY(255) NOT NULL default '',
    -- User who made the rating, 0 for anons (however it shoudn't be allowed)
    vot_user INTEGER NOT NULL default 0,
    -- Value of rating
    vot_rating INTEGER NOT NULL default 0
) /*$wgDBTableOptions*/;
CREATE INDEX /*i*/vot_category_title ON /*$wgDBPrefix*/cv_ratings_votes( vot_category, vot_title );
CREATE INDEX /*i*/vot_category_title_user ON /*$wgDBPrefix*/cv_ratings_votes( vot_category, vot_title, vot_user );
CREATE INDEX /*i*/vot_category_title_rating ON /*$wgDBPrefix*/cv_ratings_votes( vot_category, vot_title, vot_rating );
