Class: Ronin::DB::CLI::Commands::Migrate Private
- Inherits:
-
Ronin::DB::CLI::Command
- Object
- Core::CLI::Command
- Ronin::DB::CLI::Command
- Ronin::DB::CLI::Commands::Migrate
- 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
Instance Method Summary collapse
-
#db_connect ⇒ Object
private
Connects to the database.
-
#db_migrate ⇒ Object
private
Runs migrations.
-
#run ⇒ Object
private
Runs the
ronin-db migrate
command.
Methods included from DatabaseOptions
Methods included from URIMethods
#normalize_adapter, #normalize_sqlite3_path, #parse_uri
Instance Method Details
#db_connect ⇒ Object
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_migrate ⇒ Object
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 |
#run ⇒ Object
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 |