Skip to content

Commit

Permalink
Silence schema dump logging
Browse files Browse the repository at this point in the history
  • Loading branch information
renatolond committed Nov 14, 2024
1 parent 3d93008 commit ff95023
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class << self
def connection
@connection ||= begin
c = Sequel.connect(connection_string, **connection_options)
c.sql_log_level = :debug
logger = Logger.new($stdout, level: Logger::INFO)
logger.level = Logger::DEBUG if Environment.test? || Environment.development?
c.logger = logger
Expand Down
3 changes: 3 additions & 0 deletions lib/rake_support/migrations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ def dump_schema(db)
return unless Environment.development? || Environment.test?

db.extension :schema_dumper
old_loggers = db.loggers
db.logger = nil
schema = db.dump_schema_migration(same_db: true)
db.loggers = old_loggers
current_migration = db[:schema_migrations].order_by(Sequel[:filename].desc).get(:filename)
schema = "# **Autogenerated file! Do not modify by hand!**
# Current migration: #{current_migration}
Expand Down

0 comments on commit ff95023

Please sign in to comment.