Skip to content

Instantly share code, notes, and snippets.

@rissajeanne
Created November 18, 2011 21:29
Show Gist options
  • Save rissajeanne/1377816 to your computer and use it in GitHub Desktop.
Save rissajeanne/1377816 to your computer and use it in GitHub Desktop.
// exp_rating_stats
ALTER TABLE `exp_rating_stats` CHANGE `weblog_id` `channel_id` int(4) unsigned NOT NULL DEFAULT '0', CHANGE `form_name` `collection` varchar(50) NOT NULL, CHANGE `rating_date` `last_rating_date` int(10) unsigned NOT NULL DEFAULT '0', ADD COLUMN `member_id` INT UNSIGNED NOT NULL DEFAULT 0 AFTER `channel_id`, ADD KEY (`member_id`);
// exp_ratings
ALTER TABLE `exp_ratings` CHANGE `weblog_id` `channel_id` int(4) unsigned NOT NULL DEFAULT '0', CHANGE `form_name` `collection` varchar(50) NOT NULL, CHANGE `rating_rev_r_y` `rating_helpful_y` int(10) NOT NULL DEFAULT '0', CHANGE `rating_rev_r_n` `rating_helpful_n` int(10) NOT NULL DEFAULT '0', DROP COLUMN `entry_title`, ADD KEY (`channel_id`), ADD KEY (`collection`), DROP KEY form_name;
// populate member_id
UPDATE exp_rating_stats, exp_channel_titles SET exp_rating_stats.member_id = exp_channel_titles.author_id WHERE exp_rating_stats.entry_id = exp_channel_titles.entry_id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment