From c17ab321be94097cc5fb5c057af7762d7f8bfbdd Mon Sep 17 00:00:00 2001 From: albert Date: Tue, 9 Apr 2013 15:20:34 -0400 Subject: [PATCH] fixes #1224 --- ...20130409191950_add_creator_id_index_to_comments.rb | 6 ++++++ db/structure.sql | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20130409191950_add_creator_id_index_to_comments.rb diff --git a/db/migrate/20130409191950_add_creator_id_index_to_comments.rb b/db/migrate/20130409191950_add_creator_id_index_to_comments.rb new file mode 100644 index 000000000..b8cd8246f --- /dev/null +++ b/db/migrate/20130409191950_add_creator_id_index_to_comments.rb @@ -0,0 +1,6 @@ +class AddCreatorIdIndexToComments < ActiveRecord::Migration + def change + execute "set statement_timeout = 0" + add_index :comments, :creator_id + end +end diff --git a/db/structure.sql b/db/structure.sql index 742c4c657..43ebf1a7d 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -4233,6 +4233,13 @@ CREATE INDEX index_comment_votes_on_user_id ON comment_votes USING btree (user_i CREATE INDEX index_comments_on_body_index ON comments USING gin (body_index); +-- +-- Name: index_comments_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE INDEX index_comments_on_creator_id ON comments USING btree (creator_id); + + -- -- Name: index_comments_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- @@ -6408,4 +6415,6 @@ INSERT INTO schema_migrations (version) VALUES ('20130331180246'); INSERT INTO schema_migrations (version) VALUES ('20130331182719'); -INSERT INTO schema_migrations (version) VALUES ('20130401013601'); \ No newline at end of file +INSERT INTO schema_migrations (version) VALUES ('20130401013601'); + +INSERT INTO schema_migrations (version) VALUES ('20130409191950'); \ No newline at end of file