about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-11-12 17:42:53 -0600
committerFire Demon <firedemon@creature.cafe>2020-11-14 17:39:08 -0600
commitf60e0b62f4e5300645f235983e5b75bcf16b370d (patch)
tree0c437e6600b7a8bdf806d63fa76ce751bbe66d58 /db
parentec3abd7c87116ad2df5b1da5701afe68a7f74844 (diff)
parent265b26489a9214a6c98a4dfa88f08ce490211ebc (diff)
Merge remote-tracking branch 'upstream/master' into merge-glitch
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20200614002136_add_sensitized_to_accounts.rb5
-rw-r--r--db/migrate/20201017233919_add_suspension_origin_to_accounts.rb5
-rw-r--r--db/post_migrate/20201017234926_fill_account_suspension_origin.rb11
-rw-r--r--db/schema.rb4
4 files changed, 24 insertions, 1 deletions
diff --git a/db/migrate/20200614002136_add_sensitized_to_accounts.rb b/db/migrate/20200614002136_add_sensitized_to_accounts.rb
new file mode 100644
index 000000000..bc2dfcb63
--- /dev/null
+++ b/db/migrate/20200614002136_add_sensitized_to_accounts.rb
@@ -0,0 +1,5 @@
+class AddSensitizedToAccounts < ActiveRecord::Migration[5.2]
+  def change
+    add_column :accounts, :sensitized_at, :datetime
+  end
+end
diff --git a/db/migrate/20201017233919_add_suspension_origin_to_accounts.rb b/db/migrate/20201017233919_add_suspension_origin_to_accounts.rb
new file mode 100644
index 000000000..f0db02143
--- /dev/null
+++ b/db/migrate/20201017233919_add_suspension_origin_to_accounts.rb
@@ -0,0 +1,5 @@
+class AddSuspensionOriginToAccounts < ActiveRecord::Migration[5.2]
+  def change
+    add_column :accounts, :suspension_origin, :integer
+  end
+end
diff --git a/db/post_migrate/20201017234926_fill_account_suspension_origin.rb b/db/post_migrate/20201017234926_fill_account_suspension_origin.rb
new file mode 100644
index 000000000..ab7407d79
--- /dev/null
+++ b/db/post_migrate/20201017234926_fill_account_suspension_origin.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class FillAccountSuspensionOrigin < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def up
+    Account.suspended.where(suspension_origin: nil).in_batches.update_all(suspension_origin: :local)
+  end
+
+  def down; end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 138a73191..6c8182f39 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: 2020_10_08_220312) do
+ActiveRecord::Schema.define(version: 2020_10_17_234926) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -206,6 +206,8 @@ ActiveRecord::Schema.define(version: 2020_10_08_220312) do
     t.integer "avatar_storage_schema_version"
     t.integer "header_storage_schema_version"
     t.string "devices_url"
+    t.integer "suspension_origin"
+    t.datetime "sensitized_at"
     t.boolean "require_dereference", default: false, null: false
     t.boolean "show_replies", default: true, null: false
     t.boolean "show_unlisted", default: true, null: false