about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/services/post_status_service.rb2
-rw-r--r--db/migrate/20191211235208_create_normalized_statuses.rb2
-rw-r--r--db/migrate/20191212022020_create_sharekeys.rb2
-rw-r--r--db/migrate/20191212022653_create_imported_statuses.rb2
4 files changed, 4 insertions, 4 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index 8b0f8ac05..dc1a3bcdc 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -130,7 +130,7 @@ class PostStatusService < BaseService
   end
 
   def unfilter_thread_on_reply
-    Redis.current.srem("filtered_threads:#{@account.id}", @in_reply_to.conversation_id)
+    ConversationKick.where(account_id: @in_reply_to.account_id, conversation: @in_reply_to.conversation_id).destroy_all
   end
 
   def inherit_reply_rejection
diff --git a/db/migrate/20191211235208_create_normalized_statuses.rb b/db/migrate/20191211235208_create_normalized_statuses.rb
index d47c4feb4..19c7cd6c3 100644
--- a/db/migrate/20191211235208_create_normalized_statuses.rb
+++ b/db/migrate/20191211235208_create_normalized_statuses.rb
@@ -1,7 +1,7 @@
 class CreateNormalizedStatuses < ActiveRecord::Migration[5.2]
   def up
     create_table :normalized_statuses do |t|
-      t.references :status, foreign_key: true, index: {unique: true}
+      t.references :status, null: false, foreign_key: {on_delete: :cascade}, index: {unique: true}
       t.text :text
     end
 
diff --git a/db/migrate/20191212022020_create_sharekeys.rb b/db/migrate/20191212022020_create_sharekeys.rb
index c0027babe..b66b7eeda 100644
--- a/db/migrate/20191212022020_create_sharekeys.rb
+++ b/db/migrate/20191212022020_create_sharekeys.rb
@@ -1,7 +1,7 @@
 class CreateSharekeys < ActiveRecord::Migration[5.2]
   def up
     create_table :sharekeys do |t|
-      t.references :status, foreign_key: true, index: {unique: true}
+      t.references :status, null: false, foreign_key: {on_delete: :cascade}, index: {unique: true}
       t.string :key
     end
 
diff --git a/db/migrate/20191212022653_create_imported_statuses.rb b/db/migrate/20191212022653_create_imported_statuses.rb
index 3d7a9c99d..a2bf0a68d 100644
--- a/db/migrate/20191212022653_create_imported_statuses.rb
+++ b/db/migrate/20191212022653_create_imported_statuses.rb
@@ -1,7 +1,7 @@
 class CreateImportedStatuses < ActiveRecord::Migration[5.2]
   def up
     create_table :imported_statuses do |t|
-      t.references :status, foreign_key: true, index: {unique: true}
+      t.references :status, null: false, foreign_key: {on_delete: :cascade}, index: {unique: true}
       t.string :origin, index: {unique: true}
     end