about summary refs log tree commit diff
path: root/db/migrate/20200725071818_create_status_domain_permissions.rb
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-07-25 23:19:56 -0500
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:45:15 -0500
commit70763ef0ea6cb6b997ac144d8b4d855b16fb838c (patch)
tree22188b8531085b35652f5459fc04e84384d1a231 /db/migrate/20200725071818_create_status_domain_permissions.rb
parent3c6057034eea75f1992c9d2f2b2c2e401858bdc7 (diff)
[Feature, Privacy] Add base support for per-domain post privacy
Diffstat (limited to 'db/migrate/20200725071818_create_status_domain_permissions.rb')
-rw-r--r--db/migrate/20200725071818_create_status_domain_permissions.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/db/migrate/20200725071818_create_status_domain_permissions.rb b/db/migrate/20200725071818_create_status_domain_permissions.rb
new file mode 100644
index 000000000..e8faf3e00
--- /dev/null
+++ b/db/migrate/20200725071818_create_status_domain_permissions.rb
@@ -0,0 +1,13 @@
+class CreateStatusDomainPermissions < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def change
+    create_table :status_domain_permissions do |t|
+      t.references :status, null: false, index: { algorithm: :concurrently }, foreign_key: { on_delete: :cascade }
+      t.string :domain, null: false, default: '', index: { algorithm: :concurrently }
+      t.integer :visibility, null: false, default: 0, index: { algorithm: :concurrently }
+    end
+
+    add_index :status_domain_permissions, [:status_id, :domain], unique: true, algorithm: :concurrently
+  end
+end