Class: Ronin::DB::CLI::Commands::Migrate Private

Inherits:
DatabaseCommand show all
Defined in:
lib/ronin/db/cli/commands/migrate.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Runs database migrations.

Usage

ronin-db migrate [options]

Options

    --db NAME                    The database to connect to (Default: default)
    --db-uri URI                 The database URI to connect to
-h, --help                       Print help information

Constant Summary

Constants included from URIMethods

URIMethods::ADAPTER_ALIASES

Instance Method Summary collapse

Methods inherited from DatabaseCommand

#config

Methods included from URIMethods

#normalize_adapter, #normalize_sqlite3_path, #parse_uri

Instance Method Details

#connectObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Connects to the database.



60
61
62
# File 'lib/ronin/db/cli/commands/migrate.rb', line 60

def connect
  DB.connect(config, load_models: false)
end

#migrateObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Runs migrations.



67
68
69
# File 'lib/ronin/db/cli/commands/migrate.rb', line 67

def migrate
  DB.migrate!
end

#runObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Runs the ronin-db migrate command.



52
53
54
55
# File 'lib/ronin/db/cli/commands/migrate.rb', line 52

def run
  connect
  migrate
end