5

Rails 6 has Multiple Databases with Active Record.

My question is what if I want to rollback a migration in one specific database?

something like this is not working:

rails db:rollback:primary

Link to "Multiple Databases with Active Record" documentation: https://edgeguides.rubyonrails.org/active_record_multiple_databases.html

Navid Farjad
  • 435
  • 5
  • 16
  • 1
    One option is to set `ENV['DATABASE_URL']` which has precidence over any settings from database.yml. Not very elegant but works. – max Oct 04 '19 at 10:52

1 Answers1

5

try run rails db:migrate:down:secondary VERSION=yourdbversionnumber.

I realized that this command are available when i try to run rails db:migrate:down and then rails give this in the terminal. Also, maybe for further details on rails db:migrate:down,refer to How to rollback a specific migration?

Helmi Hidzir
  • 51
  • 3
  • 5