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

question: Is there a way to disable logging for some migrations? #84

Closed
ChrisCPO opened this issue Dec 13, 2022 · 4 comments · Fixed by #86
Closed

question: Is there a way to disable logging for some migrations? #84

ChrisCPO opened this issue Dec 13, 2022 · 4 comments · Fixed by #86

Comments

@ChrisCPO
Copy link

We chose to go with this gem over strong-migrations because of the nicer logging. However if does not play well with a Gem called data-migrate. In the sense that the logging is really verbose, where updating thousands of records will create tens of thousands of migration logs.

So is there a way to disable the logging for some migrations but not others perhaps a class method or option ?

@rchoquet
Copy link
Contributor

Hello @ChrisCPO! Not with the current implementation, but it indeed seems a legit use case for data migrations.

What do you think about this API?

# frozen_string_literal: true

class MyMigration < ActiveRecord::Migration[7.0]
  safe_pg_migrations_verbose false

  def change
    ...
  end
end

@ChrisCPO
Copy link
Author

@rchoquet thanks for the quick response.

Seems like a great API!

@ThHareau
Copy link
Contributor

ThHareau commented Feb 3, 2023

Hi @ChrisCPO 🙂 I've just merged the implementation above. Tell us if it suits your needs

@ChrisCPO
Copy link
Author

ChrisCPO commented Feb 5, 2023

@ThHareau thank you! Will check it out this week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants