From 65c42e5398304273b54916cc90441ade23317d85 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Fri, 2 Aug 2019 02:30:35 -0500 Subject: filters now have options to separately match post text, content warnings/titles, & hashtags + option to filter threads containing a matching post --- db/migrate/20190801212756_add_thread_to_custom_filters.rb | 5 +++++ db/migrate/20190801213117_add_spoiler_to_custom_filters.rb | 5 +++++ db/migrate/20190801213606_add_tags_to_custom_filters.rb | 5 +++++ db/migrate/20190801222645_add_status_text_to_custom_filters.rb | 5 +++++ .../20190801222823_set_status_text_bool_for_existing_filters.rb | 6 ++++++ 5 files changed, 26 insertions(+) create mode 100644 db/migrate/20190801212756_add_thread_to_custom_filters.rb create mode 100644 db/migrate/20190801213117_add_spoiler_to_custom_filters.rb create mode 100644 db/migrate/20190801213606_add_tags_to_custom_filters.rb create mode 100644 db/migrate/20190801222645_add_status_text_to_custom_filters.rb create mode 100644 db/migrate/20190801222823_set_status_text_bool_for_existing_filters.rb (limited to 'db/migrate') diff --git a/db/migrate/20190801212756_add_thread_to_custom_filters.rb b/db/migrate/20190801212756_add_thread_to_custom_filters.rb new file mode 100644 index 000000000..de2507451 --- /dev/null +++ b/db/migrate/20190801212756_add_thread_to_custom_filters.rb @@ -0,0 +1,5 @@ +class AddThreadToCustomFilters < ActiveRecord::Migration[5.2] + def change + safety_assured { add_column :custom_filters, :thread, :boolean, null: false, default: false } + end +end diff --git a/db/migrate/20190801213117_add_spoiler_to_custom_filters.rb b/db/migrate/20190801213117_add_spoiler_to_custom_filters.rb new file mode 100644 index 000000000..63aba46ac --- /dev/null +++ b/db/migrate/20190801213117_add_spoiler_to_custom_filters.rb @@ -0,0 +1,5 @@ +class AddSpoilerToCustomFilters < ActiveRecord::Migration[5.2] + def change + safety_assured { add_column :custom_filters, :spoiler, :boolean, null: false, default: false } + end +end diff --git a/db/migrate/20190801213606_add_tags_to_custom_filters.rb b/db/migrate/20190801213606_add_tags_to_custom_filters.rb new file mode 100644 index 000000000..4ed1a6e34 --- /dev/null +++ b/db/migrate/20190801213606_add_tags_to_custom_filters.rb @@ -0,0 +1,5 @@ +class AddTagsToCustomFilters < ActiveRecord::Migration[5.2] + def change + safety_assured { add_column :custom_filters, :tags, :boolean, null: false, default: false } + end +end diff --git a/db/migrate/20190801222645_add_status_text_to_custom_filters.rb b/db/migrate/20190801222645_add_status_text_to_custom_filters.rb new file mode 100644 index 000000000..cf4bbd28b --- /dev/null +++ b/db/migrate/20190801222645_add_status_text_to_custom_filters.rb @@ -0,0 +1,5 @@ +class AddStatusTextToCustomFilters < ActiveRecord::Migration[5.2] + def change + safety_assured { add_column :custom_filters, :status_text, :boolean, null: false, default: false } + end +end diff --git a/db/migrate/20190801222823_set_status_text_bool_for_existing_filters.rb b/db/migrate/20190801222823_set_status_text_bool_for_existing_filters.rb new file mode 100644 index 000000000..787c63929 --- /dev/null +++ b/db/migrate/20190801222823_set_status_text_bool_for_existing_filters.rb @@ -0,0 +1,6 @@ +class SetStatusTextBoolForExistingFilters < ActiveRecord::Migration[5.2] + def up + CustomFilter.where(status_text: false).in_batches.update_all(status_text: true) + CustomFilter.where(spoiler_text: false).in_batches.update_all(spoiler_text: true) + end +end -- cgit