upon further investigation and a lot of googling, i have found that in order to get environment_id and state_id columns into the engines table, I have to add
t.belongs_to :environment t.belongs_to :state
into the migrations files.
Thanks for the assistance Frederic.