class CreateMksRateServiceRates < ActiveRecord::Migration[5.1] def change create_table :mks_rate_service_rates do |t| t.references :chargeable_service, index: { name: 'cs_on_sr_indx' } t.references :equipment_item, index: { name: 'cs_on_ei_indx' } t.float :base_rate, default: 0 t.float :utilization_rate, default: 0 t.timestamps end add_foreign_key :mks_rate_service_rates, :mks_rate_chargeable_services, column: :chargeable_service_id add_foreign_key :mks_rate_service_rates, :mks_edm_equipment_items, column: :equipment_item_id end end