Sha256: 0822f972d3a84d8a900083a9d0b7d4e12f1302d5427eaddc6a1db5f3c1f18a4f

Contents?: true

Size: 684 Bytes

Versions: 4

Compression:

Stored size: 684 Bytes

Contents

# frozen_string_literal: true

module Mihari
  module Commands
    #
    # Database sub-commands
    #
    module Database
      class << self
        def included(thor)
          thor.class_eval do
            include Mixins

            desc "migrate", "Migrate DB schemas"
            around :with_db_connection
            method_option :verbose, type: :boolean, default: true
            #
            # @param [String] direction
            #
            def migrate(direction = "up")
              ActiveRecord::Migration.verbose = options["verbose"]
              Mihari::Database.migrate direction.to_sym
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mihari-6.3.0 lib/mihari/commands/database.rb
mihari-6.2.0 lib/mihari/commands/database.rb
mihari-6.1.0 lib/mihari/commands/database.rb
mihari-6.0.0 lib/mihari/commands/database.rb