additionals/db/migrate/004_create_dashboard_roles.rb

17 lines
510 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2020-07-27 11:49:23 +03:00
class CreateDashboardRoles < ActiveRecord::Migration[5.2]
def change
create_table :dashboard_roles do |t|
t.references :dashboard,
null: false,
foreign_key: { on_delete: :cascade }
t.references :role,
null: false,
type: :integer,
foreign_key: { on_delete: :cascade }
t.index %i[dashboard_id role_id], name: 'dashboard_role_ids', unique: true
end
end
end