Class: Ronin::DB::CLI::Commands::Migrate Private
- Inherits:
-
DatabaseCommand
- Object
- Core::CLI::Command
- Ronin::DB::CLI::Command
- DatabaseCommand
- Ronin::DB::CLI::Commands::Migrate
- 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
Instance Method Summary collapse
-
#connect ⇒ Object
private
Connects to the database.
-
#migrate ⇒ Object
private
Runs migrations.
-
#run ⇒ Object
private
Runs the
ronin-db migrate
command.
Methods inherited from DatabaseCommand
Methods included from URIMethods
#normalize_adapter, #normalize_sqlite3_path, #parse_uri
Instance Method Details
#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.
60 61 62 |
# File 'lib/ronin/db/cli/commands/migrate.rb', line 60 def connect DB.connect(config, load_models: false) end |
#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.
67 68 69 |
# File 'lib/ronin/db/cli/commands/migrate.rb', line 67 def 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.
52 53 54 55 |
# File 'lib/ronin/db/cli/commands/migrate.rb', line 52 def run connect migrate end |