Class: Ardb::CLI::MigrateCommand
- Inherits:
-
Object
- Object
- Ardb::CLI::MigrateCommand
- Includes:
- ValidCommand
- Defined in:
- lib/ardb/cli/commands.rb
Instance Method Summary collapse
Instance Method Details
#help ⇒ Object
180 181 182 183 184 185 |
# File 'lib/ardb/cli/commands.rb', line 180 def help "Usage: ardb migrate [options]\n\n" \ "Options: #{@clirb}\n" \ "Description:\n" \ " #{self.summary}" end |
#run(argv, *args) ⇒ Object
161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/ardb/cli/commands.rb', line 161 def run(argv, *args) super Ardb.init(true) begin Ardb.adapter.migrate_db Ardb.adapter.dump_schema unless ENV['ARDB_MIGRATE_NO_SCHEMA'] rescue StandardError => e @stderr.puts e @stderr.puts e.backtrace.join("\n") @stderr.puts "error migrating #{Ardb.config.database.inspect} database" raise CommandExitError end end |
#summary ⇒ Object
176 177 178 |
# File 'lib/ardb/cli/commands.rb', line 176 def summary "Migrate the configured DB" end |