class CreateMksRateServiceBundles < ActiveRecord::Migration[5.1] def change create_table :mks_rate_service_bundles do |t| t.string :code, unique: true t.string :name, null: false t.string :description t.float :percent_discount, null: false, default: 0 t.references :service_delivery_unit, index: { name: 'sdu_on_sb_indx' } t.timestamps end add_foreign_key :mks_rate_service_bundles, :mks_rate_service_delivery_units, column: :service_delivery_unit_id end end