3

I want to add a secondary database to my RoR project, so I followed this: https://guides.rubyonrails.org/active_record_multiple_databases.html

So now I have two databases: jobtitleio & profiles

My issue is that when I run: rails db:migrate:profiles, the migration is applied to the other database (the primary one). => in this example, I want to add a table, and the table is added to the jobtitleio database.

Here is my database.yml:

development:
  jobtitleio:
    <<: *default
    database: jobtitleio_development
  profiles:
    <<: *default
    database: profiles_development
    migrations_paths: db/profiles/migrate

I ran this to create the migration: rails g migration CreateUsers url:text external_id:integer --database profiles which created the migration file in the right folder (db/profiles/migrate).

So this is where I'm at, my migration is created in the right folder, and is ran to be applied to the profiles database (using rails db:migrate:profiles). So why is it applied to the other database ?

Thanks for your help !

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.