Skip to content

Commit

Permalink
Corrected --content to --change in error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneeseguin committed Apr 23, 2012
1 parent 0f2502e commit 60d145f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .rvmrc
Expand Up @@ -6,10 +6,10 @@
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
# Only full ruby name is supported here, for short names use:
# echo "rvm use 1.9.3" > .rvmrc
environment_id="ruby-1.9.3-p125@psql-cm"
environment_id="ruby-1.9.3-p194@psql-cm"

# Uncomment the following lines if you want to verify rvm version per project
# rvmrc_rvm_version="1.12.3 (stable)" # 1.10.1 seams as a safe start
# rvmrc_rvm_version="1.12.5 (master)" # 1.10.1 seams as a safe start
# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
# echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
# return 1
Expand Down
2 changes: 1 addition & 1 deletion lib/psql-cm/database.rb
Expand Up @@ -12,7 +12,7 @@ def initialize(options = {})

# Delegator to PG::Connection
def __getobj__ ; @db end
def __setobj__(object) ; end
def __setobj__(object) end

def db
unless @config[:dbname] == 'postgres'
Expand Down
4 changes: 2 additions & 2 deletions lib/psql-cm/restore.rb
Expand Up @@ -23,10 +23,10 @@ def restore!
sh "psql #{db(database).psql_args} #{database} < #{cm_file}"

ensure_cm_table_exists(database,schema)
row = db(database).exec("SELECT content from #{schema}.#{config.cm_table}
Tempfile.open('base.sql') do |temp_file|
row = db(database).exec("SELECT content from #{schema}.#{config.cm_table}
WHERE is_base IS true ORDER BY created_at
DESC LIMIT 1;")
Tempfile.open('base.sql') do |temp_file|
temp_file.write(row)
sh "psql #{db(database).psql_args} #{database} < #{temp_file.path}"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/psql-cm/submit.rb
Expand Up @@ -4,7 +4,7 @@ def submit!
databases.each do |database|
schemas(database).each do |schema|
if config.change.to_s.empty?
halt! "Content must be given! (--content=<file or \"sql string\">)"
halt! "Content must be given! (--change=<file or \"sql string\">)"
elsif File.exists?(config.change)
content = File.open(config.change, 'r') { |file| file.read }
else # SQL String
Expand Down

0 comments on commit 60d145f

Please sign in to comment.