diff --git a/db/migrate/20190408072550_add_index_id_baked_version_on_posts.rb b/db/migrate/20190408072550_add_index_id_baked_version_on_posts.rb new file mode 100644 index 00000000000..5bcb2be5371 --- /dev/null +++ b/db/migrate/20190408072550_add_index_id_baked_version_on_posts.rb @@ -0,0 +1,7 @@ +class AddIndexIdBakedVersionOnPosts < ActiveRecord::Migration[5.2] + def change + add_index :posts, [:id, :baked_version], + order: { id: :desc }, + where: "(deleted_at IS NULL)" + end +end