about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-02-24 17:28:23 +0100
committerGitHub <noreply@github.com>2022-02-24 17:28:23 +0100
commita29a982eaa0536a741b43ffb3397c74e3abe7196 (patch)
tree12d9852def5f0ac7f1fe03e51113a65bafa68e8e /db
parent91cc8d1e636a3515b15758d0ad449a0477ea8c4c (diff)
Change e-mail domain blocks to block IPs dynamically (#17635)
* Change e-mail domain blocks to block IPs dynamically

* Update app/workers/scheduler/email_domain_block_refresh_scheduler.rb

Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>

* Update app/workers/scheduler/email_domain_block_refresh_scheduler.rb

Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>

Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20220224010024_add_ips_to_email_domain_blocks.rb6
-rw-r--r--db/schema.rb5
2 files changed, 10 insertions, 1 deletions
diff --git a/db/migrate/20220224010024_add_ips_to_email_domain_blocks.rb b/db/migrate/20220224010024_add_ips_to_email_domain_blocks.rb
new file mode 100644
index 000000000..1b19a2aa1
--- /dev/null
+++ b/db/migrate/20220224010024_add_ips_to_email_domain_blocks.rb
@@ -0,0 +1,6 @@
+class AddIpsToEmailDomainBlocks < ActiveRecord::Migration[6.1]
+  def change
+    add_column :email_domain_blocks, :ips, :inet, array: true
+    add_column :email_domain_blocks, :last_refresh_at, :datetime
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 8842dcd8c..0e9b6e619 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_02_10_153119) do
+ActiveRecord::Schema.define(version: 2022_02_24_010024) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -387,6 +387,9 @@ ActiveRecord::Schema.define(version: 2022_02_10_153119) 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