
Image Source:terminally-incoherent.com
Rails Migration is one good functionality of Ruby. It allows you to use Ruby to define certain changes to a database schema. This will enable you to use a version control system to keep things synchronized with the actual code. In actuality, it has a lot of good uses. For developers, they just need to update and run rake migrate when another developer makes a certain schema change. For production severs, you can run rake migrate when you bring out a new release to update the database. Migrations can help synchronise your work on multiple machines. Rails can do a lot of things like,
- create_table(name,options), drop_table(name),
- rename_table(old_name,new_name), add_column(table_name,column_name,type,options),
- rename_column(table_name,colum_name,new_column_name),
- change_column(table_name,column_name,type,options), remove_column(table_column,column_name),
- add_index(table_name,column_name,index_type), remove_index(table_name,column_name).