I am new to RoR. I used "rails generate model ServiceConfigs" command to generate a table. so may commands are as below rails generate model ServiceConfigs configs:string rake db:migrate -- can see app/db/service_config.rb created. Now edited service_config.rb file to add 2 columns and which has a foreign key relation to service table. So here is code I am new to RoR. I used "rails generate model S