about summary refs log tree commit diff
path: root/db/migrate/20200725080000_create_account_domain_permissions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20200725080000_create_account_domain_permissions.rb')
-rw-r--r--db/migrate/20200725080000_create_account_domain_permissions.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/db/migrate/20200725080000_create_account_domain_permissions.rb b/db/migrate/20200725080000_create_account_domain_permissions.rb
new file mode 100644
index 000000000..2497eda69
--- /dev/null
+++ b/db/migrate/20200725080000_create_account_domain_permissions.rb
@@ -0,0 +1,13 @@
+class CreateAccountDomainPermissions < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def change
+    create_table :account_domain_permissions do |t|
+      t.references :account, 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 :account_domain_permissions, [:account_id, :domain], unique: true, algorithm: :concurrently
+  end
+end