Translate

May 15, 2014

What happens when you run Rails migration?

Rails migration allows the creation of the table and provides the functionality that can be performed on a table with the following commands:

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, column_name, new_column_name)
change_column(table_name, column_name, type, options)
remove_column(table_name, column_name)
add_index(table_name, column_name, index_type)
remove_index(table_name, column_name)


-Rails Migration also allows the use of pre-defined data type in the application as it supports all the data types. The data types consist of string, integer, float, etc.

-Rails Migration allows the users to use the valid column options like limit (:limit=> "50"), default (:default => "hello"), and null (:null => false implies NOT NULL)