Sha256: 68d4fed84c32d54f524cf1cc2c7894772cb5b7be1db1c4d2fb5069391a0fe9b1

Contents?: true

Size: 707 Bytes

Versions: 24

Compression:

Stored size: 707 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 Concerns::DatabaseConnectable

            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

24 entries across 24 versions & 1 rubygems

Version Path
mihari-8.0.2 lib/mihari/commands/database.rb
mihari-8.0.1 lib/mihari/commands/database.rb
mihari-8.0.0 lib/mihari/commands/database.rb
mihari-7.6.4 lib/mihari/commands/database.rb
mihari-7.6.3 lib/mihari/commands/database.rb
mihari-7.6.2 lib/mihari/commands/database.rb
mihari-7.6.1 lib/mihari/commands/database.rb
mihari-7.6.0 lib/mihari/commands/database.rb
mihari-7.5.0 lib/mihari/commands/database.rb
mihari-7.4.0 lib/mihari/commands/database.rb
mihari-7.3.2 lib/mihari/commands/database.rb
mihari-7.3.1 lib/mihari/commands/database.rb
mihari-7.3.0 lib/mihari/commands/database.rb
mihari-7.2.0 lib/mihari/commands/database.rb
mihari-7.1.3 lib/mihari/commands/database.rb
mihari-7.1.2 lib/mihari/commands/database.rb
mihari-7.1.1 lib/mihari/commands/database.rb
mihari-7.1.0 lib/mihari/commands/database.rb
mihari-7.0.5 lib/mihari/commands/database.rb
mihari-7.0.4 lib/mihari/commands/database.rb