class CreateMksRateChargeableServiceDiscounts < ActiveRecord::Migration[5.1] def change create_table :mks_rate_chargeable_service_discounts do |t| t.string :unit_variable, null: false t.float :from, null: false t.float :to, null: false t.float :value, null: false t.integer :chargeable_service_id t.timestamps end add_foreign_key :mks_rate_chargeable_service_discounts, :mks_rate_chargeable_services, column: :chargeable_service_id end end