I'm running rails migrations every time I run the test suite (using in-memory sqlite database). How to turn off output from the migrations?
Example output
-- create_table("alerts", {:force=>true})
-> 0.0038s
-- create_table("businesses", {:force=>true})
-> 0.0061s
etc...
Every time a migration is generated using the rails g migration command, Rails generates the migration file with a unique timestamp. The timestamp is in the format YYYYMMDDHHMMSS . Whenever a migration is run, Rails inserts the migration timestamp into an internal table schema_migrations .
Migrations are a feature of Active Record that allows you to evolve your database schema over time. Rather than write schema modifications in pure SQL, migrations allow you to use a Ruby DSL to describe changes to your tables.
【Ruby on Rails】 When you want to delete a migration file you made, you can choose version and delete it. You don't need to execute rails db:rollback many times!
You can do it by calling ActiveRecord::Migration.verbose = false
Reference: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/migration.rb#L253
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With