From 39b07aad85c0abd897f37860f5c9da854dcf523d Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Mon, 21 Sep 2020 02:22:56 -0500 Subject: Drop Monsterfork v2 thread permissions; simplify feed filters --- ...20200721212401_backfill_account_id_on_conversations.rb | 15 --------------- .../20200726095058_backfill_semiprivate_on_statuses.rb | 14 -------------- db/migrate/20200923000001_remove_conversation_account.rb | 7 +++++++ db/migrate/20200923000002_remove_semiprivate_flag.rb | 7 +++++++ 4 files changed, 14 insertions(+), 29 deletions(-) delete mode 100644 db/migrate/20200721212401_backfill_account_id_on_conversations.rb delete mode 100644 db/migrate/20200726095058_backfill_semiprivate_on_statuses.rb create mode 100644 db/migrate/20200923000001_remove_conversation_account.rb create mode 100644 db/migrate/20200923000002_remove_semiprivate_flag.rb (limited to 'db/migrate') diff --git a/db/migrate/20200721212401_backfill_account_id_on_conversations.rb b/db/migrate/20200721212401_backfill_account_id_on_conversations.rb deleted file mode 100644 index 595fd8e52..000000000 --- a/db/migrate/20200721212401_backfill_account_id_on_conversations.rb +++ /dev/null @@ -1,15 +0,0 @@ -class BackfillAccountIdOnConversations < ActiveRecord::Migration[5.2] - disable_ddl_transaction! - - def up - Rails.logger.info('Backfilling owners of conversation threads...') - safety_assured do - Conversation.left_outer_joins(:statuses).where(statuses: { id: nil }).in_batches.destroy_all - execute('UPDATE conversations SET account_id = s.account_id FROM (SELECT account_id, conversation_id FROM statuses WHERE NOT reply) AS s WHERE conversations.id = s.conversation_id') - end - end - - def down - true - end -end diff --git a/db/migrate/20200726095058_backfill_semiprivate_on_statuses.rb b/db/migrate/20200726095058_backfill_semiprivate_on_statuses.rb deleted file mode 100644 index 0f247146e..000000000 --- a/db/migrate/20200726095058_backfill_semiprivate_on_statuses.rb +++ /dev/null @@ -1,14 +0,0 @@ -class BackfillSemiprivateOnStatuses < ActiveRecord::Migration[5.2] - disable_ddl_transaction! - - def up - Rails.logger.info('Backfilling semiprivate statuses...') - safety_assured do - Status.where(id: StatusDomainPermission.select(:status_id)).in_batches.update_all(semiprivate: true) - end - end - - def down - true - end -end diff --git a/db/migrate/20200923000001_remove_conversation_account.rb b/db/migrate/20200923000001_remove_conversation_account.rb new file mode 100644 index 000000000..1b61d41bf --- /dev/null +++ b/db/migrate/20200923000001_remove_conversation_account.rb @@ -0,0 +1,7 @@ +class RemoveConversationAccount < ActiveRecord::Migration[5.2] + def change + safety_assured do + remove_column :conversations, :account_id + end + end +end diff --git a/db/migrate/20200923000002_remove_semiprivate_flag.rb b/db/migrate/20200923000002_remove_semiprivate_flag.rb new file mode 100644 index 000000000..cd732c616 --- /dev/null +++ b/db/migrate/20200923000002_remove_semiprivate_flag.rb @@ -0,0 +1,7 @@ +class RemoveSemiprivateFlag < ActiveRecord::Migration[5.2] + def change + safety_assured do + remove_column :statuses, :semiprivate + end + end +end -- cgit