diff --git a/config/database.rb b/config/database.rb index 6c58a8b..7d13eee 100644 --- a/config/database.rb +++ b/config/database.rb @@ -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 diff --git a/lib/rake_support/migrations.rb b/lib/rake_support/migrations.rb index ae8d606..5a68f27 100644 --- a/lib/rake_support/migrations.rb +++ b/lib/rake_support/migrations.rb @@ -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}