Class: Heroku::Command::Db

Inherits:
Base
  • Object
show all
Defined in:
lib/heroku/command/db.rb

Overview

manage the database for an app

Instance Attribute Summary

Attributes inherited from Base

#args, #options

Instance Method Summary collapse

Methods inherited from Base

#api, #app, #heroku, #initialize, namespace

Methods included from Helpers

#action, #ask, #confirm, #confirm_billing, #confirm_command, #create_git_remote, #deprecate, #display, #display_header, #display_object, #display_row, #display_table, #error, error_with_failure, error_with_failure=, extended, extended_into, #fail, #format_bytes, #format_date, #format_error, #format_with_bang, #get_terminal_environment, #git, #has_git?, #home_directory, #host_name, #hprint, #hputs, included, included_into, #json_decode, #json_encode, #launchy, #line_formatter, #longest, #output_with_bang, #quantify, #redisplay, #retry_on_exception, #run_command, #running_on_a_mac?, #running_on_windows?, #set_buffer, #shell, #spinner, #status, #string_distance, #styled_array, #styled_error, #styled_hash, #styled_header, #suggestion, #time_ago, #truncate, #with_tty

Constructor Details

This class inherits a constructor from Heroku::Command::Base

Instance Method Details

#pullObject

db:pull [DATABASE_URL]

pull heroku data down into your local database

DATABASE_URL should reference your local database. if not specified, it will be guessed from config/database.yml

-c, –chunksize SIZE # specify the number of rows to send in each batch -d, –debug # enable debugging output -e, –exclude TABLES # exclude the specified tables from the pull -f, –filter REGEX # only pull certain tables -r, –resume FILE # resume transfer described by a .dat file -t, –tables TABLES # only pull the specified tables



48
49
50
51
52
53
54
55
56
57
# File 'lib/heroku/command/db.rb', line 48

def pull
  load_taps
  opts = parse_taps_opts

  display("Warning: Data in the database '#{opts[:database_url]}' will be overwritten and will not be recoverable.")

  if confirm_command
    taps_client(:pull, opts)
  end
end

#pushObject

db:push [DATABASE_URL]

push local data up to your app

DATABASE_URL should reference your local database. if not specified, it will be guessed from config/database.yml

-c, –chunksize SIZE # specify the number of rows to send in each batch -d, –debug # enable debugging output -e, –exclude TABLES # exclude the specified tables from the push -f, –filter REGEX # only push certain tables -r, –resume FILE # resume transfer described by a .dat file -t, –tables TABLES # only push the specified tables



23
24
25
26
27
28
29
30
31
32
# File 'lib/heroku/command/db.rb', line 23

def push
  load_taps
  opts = parse_taps_opts

  display("Warning: Data in the app '#{app}' will be overwritten and will not be recoverable.")

  if confirm_command
    taps_client(:push, opts)
  end
end