about summary refs log tree commit diff
path: root/db/migrate/20200725080000_create_account_domain_permissions.rb
blob: 2497eda694498e1c61820066d231cc17a5705558 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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