From 74e30ea25b0638ba1486ee17666d1b7a07db575f Mon Sep 17 00:00:00 2001 From: Toks Date: Mon, 9 Dec 2013 13:18:48 -0500 Subject: [PATCH] #1140: Add indexes for noteupdater: and artcomm: --- ...e_versions_and_artist_commentary_versions.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 db/migrate/20131209181023_add_updater_id_and_post_id_indexes_to_note_versions_and_artist_commentary_versions.rb diff --git a/db/migrate/20131209181023_add_updater_id_and_post_id_indexes_to_note_versions_and_artist_commentary_versions.rb b/db/migrate/20131209181023_add_updater_id_and_post_id_indexes_to_note_versions_and_artist_commentary_versions.rb new file mode 100644 index 000000000..3e0b9bc86 --- /dev/null +++ b/db/migrate/20131209181023_add_updater_id_and_post_id_indexes_to_note_versions_and_artist_commentary_versions.rb @@ -0,0 +1,17 @@ +class AddUpdaterIdAndPostIdIndexesToNoteVersionsAndArtistCommentaryVersions < ActiveRecord::Migration + def self.up + execute "set statement_timeout = 0" + remove_index :note_versions, :updater_id + remove_index :artist_commentary_versions, :updater_id + add_index :note_versions, [:updater_id, :post_id] + add_index :artist_commentary_versions, [:updater_id, :post_id] + end + + def self.down + execute "set statement_timeout = 0" + remove_index :note_versions, [:updater_id, :post_id] + remove_index :artist_commentary_versions, [:updater_id, :post_id] + add_index :note_versions, :updater_id + add_index :artist_commentary_versions, :updater_id + end +end