class CreateMksEdmEquipments < ActiveRecord::Migration[5.1] def change create_table :mks_edm_equipments do |t| t.string :code, unique: true t.string :name, null: false t.string :description t.float :minimum_acquisition_time, null: false, default: 0 t.references :equipment_category, index: { name: 'equipment_on_ec_indx' } t.timestamps end add_foreign_key :mks_edm_equipments, :mks_edm_equipment_categories, column: :equipment_category_id end end