about summary refs log tree commit diff
path: root/db/migrate
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20190801212756_add_thread_to_custom_filters.rb5
-rw-r--r--db/migrate/20190801213117_add_spoiler_to_custom_filters.rb5
-rw-r--r--db/migrate/20190801213606_add_tags_to_custom_filters.rb5
-rw-r--r--db/migrate/20190801222645_add_status_text_to_custom_filters.rb5
-rw-r--r--db/migrate/20190801222823_set_status_text_bool_for_existing_filters.rb6
5 files changed, 26 insertions, 0 deletions
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