Class: Hanami::CliSubCommands::DB Private
- Inherits:
-
Thor
- Object
- Thor
- Hanami::CliSubCommands::DB
- Extended by:
- Hanami::CliBase
- Defined in:
- lib/hanami/cli_sub_commands/db.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.
A set of subcommands related to DB
It is run with:
`bundle exec hanami db`
Instance Method Summary collapse
- #apply ⇒ Object private
- #console(name = nil) ⇒ Object private
- #create ⇒ Object private
- #drop ⇒ Object private
- #migrate(version = nil) ⇒ Object private
- #prepare ⇒ Object private
- #version ⇒ Object private
Methods included from Hanami::CliBase
Instance Method Details
#apply ⇒ 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.
63 64 65 66 67 68 69 70 71 |
# File 'lib/hanami/cli_sub_commands/db.rb', line 63 def apply if [:help] invoke :help, ['apply'] else assert_development_environment! require 'hanami/commands/db/apply' Hanami::Commands::DB::Apply.new().start end end |
#console(name = nil) ⇒ 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.
17 18 19 20 21 22 23 24 |
# File 'lib/hanami/cli_sub_commands/db.rb', line 17 def console(name = nil) if [:help] invoke :help, ['console'] else require 'hanami/commands/db/console' Hanami::Commands::DB::Console.new(, name).start end end |
#create ⇒ 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.
28 29 30 31 32 33 34 35 36 |
# File 'lib/hanami/cli_sub_commands/db.rb', line 28 def create if [:help] invoke :help, ['create'] else assert_allowed_environment! require 'hanami/commands/db/create' Hanami::Commands::DB::Create.new().start end end |
#drop ⇒ 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.
40 41 42 43 44 45 46 47 48 |
# File 'lib/hanami/cli_sub_commands/db.rb', line 40 def drop if [:help] invoke :help, ['drop'] else assert_allowed_environment! require 'hanami/commands/db/drop' Hanami::Commands::DB::Drop.new().start end end |
#migrate(version = nil) ⇒ 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.
52 53 54 55 56 57 58 59 |
# File 'lib/hanami/cli_sub_commands/db.rb', line 52 def migrate(version = nil) if [:help] invoke :help, ['migrate'] else require 'hanami/commands/db/migrate' Hanami::Commands::DB::Migrate.new(, version).start end end |
#prepare ⇒ 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.
75 76 77 78 79 80 81 82 83 |
# File 'lib/hanami/cli_sub_commands/db.rb', line 75 def prepare if [:help] invoke :help, ['prepare'] else assert_allowed_environment! require 'hanami/commands/db/prepare' Hanami::Commands::DB::Prepare.new().start end end |
#version ⇒ 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.
89 90 91 92 93 94 95 96 |
# File 'lib/hanami/cli_sub_commands/db.rb', line 89 def version if [:help] invoke :help, ['version'] else require 'hanami/commands/db/version' Hanami::Commands::DB::Version.new().start end end |