Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Update dependent active record #98

Conversation

sandeep-patle1508
Copy link
Contributor

Update dependent active record to min 6.0.0 to support multi-database setup.

@jenseng
Copy link
Owner

jenseng commented Dec 12, 2022

Thanks @sandeep-patle1508! Sorry I missed this one until now 😢 ... are you still interested in moving this forward? If so, take a look at the conflicts and I'll be happy to review it once they're resolved

@sandeep-patle1508
Copy link
Contributor Author

Thanks @sandeep-patle1508! Sorry I missed this one until now 😢 ... are you still interested in moving this forward? If so, take a look at the conflicts and I'll be happy to review it once they're resolved

Hi @jenseng
I have created a new PR after rebasing with the latest master.
#110

Please review and add your comments if any changes are required.
Thanks

@jenseng
Copy link
Owner

jenseng commented Jan 2, 2024

Closing in favor of #110

@jenseng jenseng closed this Jan 2, 2024
jenseng pushed a commit that referenced this pull request Jan 2, 2024
)

Fix following issue(#95). This is the rebase from pull request #98.

**Background:**
We are trying to set up multiple databases with our **Rails 7**
application. Due to this gem, we are facing an issue.

When we are running **rails db:migrate**

it is overwriting the primary **db/schema.rb** file with secondary
schema file **db/marketing_sync_board_schema.rb**. After the migration
command run both are the same.

They are not causing any database label changes.

Also if we are using database-specific command it is working fine. 
`rails db:migrate`
`rails db:migrate:marketing_sync_board`

sample database.yml with multi database setup.
<pre>
default: &default
  adapter: postgresql
  encoding: unicode
  host: localhost
  database: multi_db_test_app_development
  username: admin
  password:
  pool: <%= ENV.fetch('RAILS_MAX_THREADS') { 5 } %>

marketing_sync_board_default: &marketing_sync_board_default
  <<: *default
  host: localhost
  username: admin
  password:
  database: marketing_sync_board_development
  migrations_paths: db/marketing_sync_board_migrate

development:
  primary:
    <<: *default
    database: multi_db_test_app_secondary_development
  marketing_sync_board:
    <<: *marketing_sync_board_default
</pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants