class CreateEcomModelCrewTimes < ActiveRecord::Migration[6.0] def change create_table :ecom_model_crew_times do |t| t.date :date, null: false t.time :checkin_time t.time :checkout_time t.references :crew, index: { name: 'ct_on_crew_indx' } t.string :remark t.boolean :overtime, null: false, default: false t.timestamps end add_foreign_key :ecom_model_crew_times, :ecom_model_crews, column: :crew_id end end