about summary refs log tree commit diff
path: root/db/post_migrate
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-06-28 11:11:18 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-06-28 11:11:18 +0200
commitfe5f6bc7edf42e8c87dbdfa98f5707020e42d400 (patch)
tree2e632dfa964aad5cf118930389cf95904f3bd82a /db/post_migrate
parent63f79874b59b3ba28c0f940b9d36ea7aacb44c93 (diff)
parent02851848e964675bb59919fa5fd1bdee2c1c29db (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `.github/workflows/build-image.yml`:
  Fix erroneous deletion in a previous merge.
- `Gemfile`:
  Conflict caused by glitch-soc-only hCaptcha dependency
- `app/controllers/auth/sessions_controller.rb`:
  Minor conflict due to glitch-soc's theming system.
- `app/controllers/filters_controller.rb`:
  Minor conflict due to glitch-soc's theming system.
- `app/serializers/rest/status_serializer.rb`:
  Minor conflict due to glitch-soc having an extra `local_only` property
Diffstat (limited to 'db/post_migrate')
-rw-r--r--db/post_migrate/20220613110802_remove_whole_word_from_custom_filters.rb20
-rw-r--r--db/post_migrate/20220613110903_remove_irreversible_from_custom_filters.rb20
2 files changed, 40 insertions, 0 deletions
diff --git a/db/post_migrate/20220613110802_remove_whole_word_from_custom_filters.rb b/db/post_migrate/20220613110802_remove_whole_word_from_custom_filters.rb
new file mode 100644
index 000000000..7ef0749e5
--- /dev/null
+++ b/db/post_migrate/20220613110802_remove_whole_word_from_custom_filters.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+require Rails.root.join('lib', 'mastodon', 'migration_helpers')
+
+class RemoveWholeWordFromCustomFilters < ActiveRecord::Migration[6.1]
+  include Mastodon::MigrationHelpers
+
+  disable_ddl_transaction!
+
+  def up
+    safety_assured do
+      remove_column :custom_filters, :whole_word
+    end
+  end
+
+  def down
+    safety_assured do
+      add_column_with_default :custom_filters, :whole_word, :boolean, default: true, allow_null: false
+    end
+  end
+end
diff --git a/db/post_migrate/20220613110903_remove_irreversible_from_custom_filters.rb b/db/post_migrate/20220613110903_remove_irreversible_from_custom_filters.rb
new file mode 100644
index 000000000..6ed8bcfee
--- /dev/null
+++ b/db/post_migrate/20220613110903_remove_irreversible_from_custom_filters.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+require Rails.root.join('lib', 'mastodon', 'migration_helpers')
+
+class RemoveIrreversibleFromCustomFilters < ActiveRecord::Migration[6.1]
+  include Mastodon::MigrationHelpers
+
+  disable_ddl_transaction!
+
+  def up
+    safety_assured do
+      remove_column :custom_filters, :irreversible
+    end
+  end
+
+  def down
+    safety_assured do
+      add_column_with_default :custom_filters, :irreversible, :boolean, allow_null: false, default: false
+    end
+  end
+end