diff --git a/db/migrate/20160719002225_add_deleted_post_index_to_posts.rb b/db/migrate/20160719002225_add_deleted_post_index_to_posts.rb new file mode 100644 index 000000000..ec469b99c --- /dev/null +++ b/db/migrate/20160719002225_add_deleted_post_index_to_posts.rb @@ -0,0 +1,5 @@ +class AddDeletedPostIndexToPosts < ActiveRecord::Migration + def change + add_index :posts, [:topic_id, :post_number], where: 'deleted_at IS NOT NULL', name: 'idx_posts_deleted_posts' + end +end