Sha256: 4d0813ec588f6b43c5f67f9dc058d77cc97fc502d722428051918348c551e801

Contents?: true

Size: 658 Bytes

Versions: 2

Compression:

Stored size: 658 Bytes

Contents

# frozen_string_literal: true

module Mihari
  module Commands
    #
    # Database sub-commands
    #
    module Database
      class << self
        def included(thor)
          thor.class_eval do
            desc "migrate", "Migrate DB schemas"
            method_option :verbose, type: :boolean, default: true
            #
            # @param [String] direction
            #
            def migrate(direction = "up")
              ActiveRecord::Migration.verbose = options["verbose"]

              Mihari::Database.with_db_connection { Mihari::Database.migrate direction.to_sym }
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mihari-5.7.1 lib/mihari/commands/database.rb
mihari-5.7.0 lib/mihari/commands/database.rb