about summary refs log tree commit diff
path: root/db/migrate
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-01-13 21:57:24 -0600
committermultiple creatures <dev@multiple-creature.party>2020-01-13 21:57:24 -0600
commit67516a07db44196cc4bb94bf94abe5c6f611cf07 (patch)
treef65b7c79f859329a0438d806e777fa1d7aa7f400 /db/migrate
parent1fbe7c340201ddff5232c7931a265136943ffd59 (diff)
add new privacy option to auto-defederate after a given timespan + add options to defederate and/or delete past posts + add `defed_in`/`parent:defed_in`/`thread:defed_in` bangtags + ui indicator for posts marked for auto-defederation
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20200114011918_create_defederating_statuses.rb9
-rw-r--r--db/migrate/20200114030940_add_unique_indexes_on_defederating_and_destructing_statuses.rb11
2 files changed, 20 insertions, 0 deletions
diff --git a/db/migrate/20200114011918_create_defederating_statuses.rb b/db/migrate/20200114011918_create_defederating_statuses.rb
new file mode 100644
index 000000000..55fc7f900
--- /dev/null
+++ b/db/migrate/20200114011918_create_defederating_statuses.rb
@@ -0,0 +1,9 @@
+class CreateDefederatingStatuses < ActiveRecord::Migration[5.2]
+  def change
+    create_table :defederating_statuses do |t|
+      t.references :status, foreign_key: true
+      t.datetime :defederate_after
+    end
+    safety_assured { add_index :defederating_statuses, :defederate_after }
+  end
+end
diff --git a/db/migrate/20200114030940_add_unique_indexes_on_defederating_and_destructing_statuses.rb b/db/migrate/20200114030940_add_unique_indexes_on_defederating_and_destructing_statuses.rb
new file mode 100644
index 000000000..6ad8f8b52
--- /dev/null
+++ b/db/migrate/20200114030940_add_unique_indexes_on_defederating_and_destructing_statuses.rb
@@ -0,0 +1,11 @@
+class AddUniqueIndexesOnDefederatingAndDestructingStatuses < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def change
+    remove_index :destructing_statuses, :status_id
+    remove_index :defederating_statuses, :status_id
+
+    add_index :destructing_statuses, :status_id, unique: true, algorithm: :concurrently
+    add_index :defederating_statuses, :status_id, unique: true, algorithm: :concurrently
+  end
+end