about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-05-01 16:52:27 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-05-01 16:52:27 +0200
commit392ca0472a50ea930f46e22dccf5ce55b04ef588 (patch)
tree9f8c6b3dcb11a620a417205f9554e8d37e5f3e12 /db
parent252deefe3433d0cedafd973becd0d85b5182eb49 (diff)
parent33f3818d660c67194f94c7ff2bb180f4865e6748 (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `app/javascript/packs/admin.js`:
  Conflicts due to glitch-soc's theming system.
  Upstream changes have been ported to `app/javascript/core/admin.js`
- `app/models/trends/statuses.rb`:
  Minor conflict due to glitch-soc's option to allow CWed toots in trends.
  Ported upstream changes.
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180615122121_add_autofollow_to_invites.rb2
-rw-r--r--db/post_migrate/20220429101025_remove_ips_from_email_domain_blocks.rb12
-rw-r--r--db/post_migrate/20220429101850_clear_email_domain_blocks.rb14
-rw-r--r--db/schema.rb4
4 files changed, 28 insertions, 4 deletions
diff --git a/db/migrate/20180615122121_add_autofollow_to_invites.rb b/db/migrate/20180615122121_add_autofollow_to_invites.rb
index 850b1d693..8c5fb7410 100644
--- a/db/migrate/20180615122121_add_autofollow_to_invites.rb
+++ b/db/migrate/20180615122121_add_autofollow_to_invites.rb
@@ -5,7 +5,7 @@ class AddAutofollowToInvites < ActiveRecord::Migration[5.2]
 
   disable_ddl_transaction!
 
-  def change
+  def up
     safety_assured do
       add_column_with_default :invites, :autofollow, :bool, default: false, allow_null: false
     end
diff --git a/db/post_migrate/20220429101025_remove_ips_from_email_domain_blocks.rb b/db/post_migrate/20220429101025_remove_ips_from_email_domain_blocks.rb
new file mode 100644
index 000000000..fbb74d99e
--- /dev/null
+++ b/db/post_migrate/20220429101025_remove_ips_from_email_domain_blocks.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+class RemoveIpsFromEmailDomainBlocks < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def change
+    safety_assured do
+      remove_column :email_domain_blocks, :ips, :inet, array: true
+      remove_column :email_domain_blocks, :last_refresh_at, :datetime
+    end
+  end
+end
diff --git a/db/post_migrate/20220429101850_clear_email_domain_blocks.rb b/db/post_migrate/20220429101850_clear_email_domain_blocks.rb
new file mode 100644
index 000000000..ff525b650
--- /dev/null
+++ b/db/post_migrate/20220429101850_clear_email_domain_blocks.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class ClearEmailDomainBlocks < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  class EmailDomainBlock < ApplicationRecord
+  end
+
+  def up
+    EmailDomainBlock.where.not(parent_id: nil).in_batches.delete_all
+  end
+
+  def down; end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 55c5ea74c..4552828d6 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema.define(version: 2022_04_28_114902) do
+ActiveRecord::Schema.define(version: 2022_04_29_101850) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -389,8 +389,6 @@ ActiveRecord::Schema.define(version: 2022_04_28_114902) do
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.bigint "parent_id"
-    t.inet "ips", array: true
-    t.datetime "last_refresh_at"
     t.index ["domain"], name: "index_email_domain_blocks_on_domain", unique: true
   end