Database in Rails - mnishiguchi/authentication_demo GitHub Wiki

Database in Rails

http://edgeguides.rubyonrails.org/active_record_migrations.html#rolling-back

Database level validation

Rolling Back

rake db:rollback
  • Executes the drop_table command to remove the users table from the database.
  • Works only for reversible migrations by default.
  • In the case of an irreversible migration, such as one to remove a database column, it is necessary to define separate up and down methods in place of the single change method: