additionals/db/migrate/004_create_dashboard_roles.rb
2021-04-18 13:34:55 +02:00

17 lines
510 B
Ruby

# frozen_string_literal: true
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