Browse files

Corrected --content to --change in error message.

  • Loading branch information...
1 parent 0f2502e commit 60d145f3aec45a663ca53405a8f9eb3973c254a0 @wayneeseguin committed Apr 23, 2012
Showing with 6 additions and 6 deletions.
  1. +2 −2 .rvmrc
  2. +1 −1 lib/psql-cm/database.rb
  3. +2 −2 lib/psql-cm/restore.rb
  4. +1 −1 lib/psql-cm/submit.rb
View
4 .rvmrc
@@ -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
View
2 lib/psql-cm/database.rb
@@ -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'
View
4 lib/psql-cm/restore.rb
@@ -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
View
2 lib/psql-cm/submit.rb
@@ -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

0 comments on commit 60d145f

Please sign in to comment.