Skip to content

Commit

Permalink
FI-2765: Automatically run migrations (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jammjammjamm authored May 28, 2024
1 parent a4e874c commit 2dd6da7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/inferno/apps/cli/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module CLI
class Main < Thor
desc 'console', 'Start an interactive console session with Inferno'
def console
Migration.new.run(Logger::INFO)
Console.new.run
end

Expand All @@ -25,6 +26,7 @@ def migrate
type: :boolean,
desc: 'Automatically restart Inferno when a file is changed.'
def start
Migration.new.run(Logger::INFO)
command = 'foreman start --env=/dev/null'
if `gem list -i foreman`.chomp == 'false'
puts "You must install foreman with 'gem install foreman' prior to running Inferno."
Expand Down
4 changes: 2 additions & 2 deletions lib/inferno/apps/cli/migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
module Inferno
module CLI
class Migration
def run
def run(log_level = Logger::DEBUG)
Inferno::Application.start(:logging)
Inferno::Application['logger'].level = Logger::DEBUG
Inferno::Application['logger'].level = log_level

Utils::Migration.new.run
end
Expand Down

0 comments on commit 2dd6da7

Please sign in to comment.