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)


122
123
124
# File 'lib/pg_online_schema_change/cli.rb', line 122

def self.exit_on_failure?
  true
end

Instance Method Details

#performObject



100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/pg_online_schema_change/cli.rb', line 100

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

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

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

  PgOnlineSchemaChange::Orchestrate.run!(client_options)
end

#versionObject



118
119
120
# File 'lib/pg_online_schema_change/cli.rb', line 118

def version
  puts PgOnlineSchemaChange::VERSION
end