Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorBenjamin Neff <benjamin@coding4coffee.ch>2019-07-02 02:50:36 +0300
committerBenjamin Neff <benjamin@coding4coffee.ch>2019-07-02 02:58:54 +0300
commit034d78e3e4ac94037393bd6f718858e65edeec66 (patch)
treeca5bafde088cb8887e3bfe0ef39726b9a1ac5bec /db
parente92eb887824046941904749fc6584f312dece80e (diff)
Remove commentable functionality from photos
This is not (and as far as I know, was never) used. If we want to make standalone photos commentable, we can always add it back, but it would also need to change federation for it to work, because comments support only posts there. But for now it makes the code cleaner and easier to remove it.
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20190701234716_photos_remove_comment_count.rb14
1 files changed, 14 insertions, 0 deletions
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