about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2020-11-19 10:02:56 -0600
committerStarfall <us@starfall.systems>2020-11-19 10:02:56 -0600
commit383bb3804bdbd6caa442283cc96ef0cdbfdb4575 (patch)
tree54ecc09c325567ab1cfc4af9ba13ad134d9c3c72 /db
parent259470ec37dfc5c3d34ed5456adcd3ab1a622a18 (diff)
parentdb01f8b942b72eaa2eacbb144261b002f8079c9c (diff)
Merge branch 'glitch' into main
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 6d6f97f0a..7d39126f0 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"
@@ -189,6 +189,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.index "(((setweight(to_tsvector('simple'::regconfig, (display_name)::text), 'A'::\"char\") || setweight(to_tsvector('simple'::regconfig, (username)::text), 'B'::\"char\")) || setweight(to_tsvector('simple'::regconfig, (COALESCE(domain, ''::character varying))::text), 'C'::\"char\")))", name: "search_index", using: :gin
     t.index "lower((username)::text), COALESCE(lower((domain)::text), ''::text)", name: "index_accounts_on_username_and_domain_lower", unique: true
     t.index ["moved_to_account_id"], name: "index_accounts_on_moved_to_account_id"