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

ReversibleMigration cop for rails 6 multiple databases #463

Closed
uxxman opened this issue Apr 22, 2021 · 0 comments · Fixed by #612
Closed

ReversibleMigration cop for rails 6 multiple databases #463

uxxman opened this issue Apr 22, 2021 · 0 comments · Fixed by #612
Labels
enhancement New feature or request

Comments

@uxxman
Copy link

uxxman commented Apr 22, 2021

Cop doesn't detect violations for rails 6+ multi database project where there are different 'migrations_paths' for each database. It only works for violations for the main database with migrations residing in the 'migrate' folder.


Expected behavior

Cop should detect violations for all database migrations

Actual behavior

Only detect violations for database migrations inside 'migrate' folder and discards all other migrations.

Steps to reproduce the problem

Database.yml from the guides example for rails multi databases. Any migration inside 'db/animals_migrate' doesn't get reported for violations.

production:
  primary:
    database: my_primary_database
    user: root
    adapter: mysql
  primary_replica:
    database: my_primary_database
    user: root_readonly
    adapter: mysql
    replica: true
  animals:
    database: my_animals_database
    user: animals_root
    adapter: mysql
    migrations_paths: db/animals_migrate
  animals_replica:
    database: my_animals_database
    user: animals_readonly
    adapter: mysql
    replica: true

RuboCop version

1.13.0 (using Parser 3.0.1.0, rubocop-ast 1.4.1, running on ruby 3.0.1 x86_64-darwin20)

  • rubocop-performance 1.11.0
  • rubocop-rails 2.9.1
  • rubocop-rspec 2.2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants