here i am trying to customize the column name in mysql. i have generated the model in rails using
rails generate scaffold my_products product_category:string product_name:string
when i do rake db:migrate
the id is generated by default. but i want to change the id
column name to product_id
,which will be same as ID with primary key, so it will be easy for querying and other manipulation.
How should i do it?
or can i change id to product_id while generating model?