diff --git a/app/models/photo.rb b/app/models/photo.rb index 75d7f83a8..5552aefed 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -6,7 +6,6 @@ class Photo < ApplicationRecord include Diaspora::Federated::Base - include Diaspora::Commentable include Diaspora::Shareable # NOTE API V1 to be extracted diff --git a/db/migrate/20190701234716_photos_remove_comment_count.rb b/db/migrate/20190701234716_photos_remove_comment_count.rb new file mode 100644 index 000000000..4d6330960 --- /dev/null +++ b/db/migrate/20190701234716_photos_remove_comment_count.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class PhotosRemoveCommentCount < ActiveRecord::Migration[5.1] + class Comment < ApplicationRecord + end + + def change + remove_column :photos, :comments_count, :integer + + reversible do |change| + change.up { Comment.where(commentable_type: "Photo").delete_all } + end + end +end