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

Inherits:
Ronin::DB::CLI::Command show all
Includes:
DatabaseOptions
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
    --db-file PATH               The sqlite3 database file to use
-h, --help                       Print help information

Constant Summary

Constants included from URIMethods

URIMethods::ADAPTER_ALIASES

Instance Method Summary collapse

Methods included from DatabaseOptions

#db_config, included

Methods included from URIMethods

#normalize_adapter, #normalize_sqlite3_path, #parse_uri

Instance Method Details

#db_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.



64
65
66
# File 'lib/ronin/db/cli/commands/migrate.rb', line 64

def db_connect
  DB.connect(db_config, load_models: false)
end

#db_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.



71
72
73
# File 'lib/ronin/db/cli/commands/migrate.rb', line 71

def db_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.



56
57
58
59
# File 'lib/ronin/db/cli/commands/migrate.rb', line 56

def run
  db_connect
  db_migrate
end