Home How do I increase column data type size by using reversible migration?
 How can I increase the length of a column via a migration but ensure that my migration can be rolled backed? I have read this question and answers but I have concluded that both answers, including the accepted answer do not allow for a reversible migration. Does anyone contest this? In the link above the following code is not reversible, as far as I can tell, if a record exists with a login column who's length is longer than the original length: class YourMigration < ActiveRecord::Migration def up change_column :users, :login, :string, :limit => 55 end def down change_column :users, :login, :string, :limit => 40 end end  Doing something like the following is acceptable but I am wondering if there is more I can do?: class YourMigration < ActiveRecord::Migration def up change_column :users, :login, :string, :limit => 55 end def down change_column :users, :login, :string end end