Class: PgOnlineSchemaChange::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/pg_online_schema_change/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)

50
51
52
# File 'lib/pg_online_schema_change/cli.rb', line 50

def self.exit_on_failure?
  true
end

Instance Method Details

#performObject


33
34
35
36
37
38
39
40
41
42
# File 'lib/pg_online_schema_change/cli.rb', line 33

def perform
  client_options = Struct.new(*options.keys.map(&:to_sym)).new(*options.values)
  PgOnlineSchemaChange.logger(verbose: client_options.verbose)

  PgOnlineSchemaChange.logger.warn("DEPRECATED: -w is deprecated. Please pass PGPASSWORD environment variable instead.") if client_options.password

  client_options.password = ENV["PGPASSWORD"] || client_options.password

  PgOnlineSchemaChange::Orchestrate.run!(client_options)
end

#versionObject


46
47
48
# File 'lib/pg_online_schema_change/cli.rb', line 46

def version
  puts PgOnlineSchemaChange::VERSION
end