Skip to content

Commit

Permalink
fix a few legibility issues I had with the 2 --skip-schema patches
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardochimal committed Feb 14, 2011
1 parent 2e0b985 commit a465a75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions lib/taps/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def clientoptparse(cmd)
o.define_head "Push a database to a taps server"
end

o.on( '--no-schema', "Don't transfer the schema, just data") {|v| opts[:no_schema] = true }
o.on("-s", "--skip-schema", "Don't transfer the schema, just data") { |v| opts[:skip_schema] = true }
o.on("-i", "--indexes-first", "Transfer indexes first before data") { |v| opts[:indexes_first] = true }
o.on("-r", "--resume=file", "Resume a Taps Session from a stored file") { |v| opts[:resume_filename] = v }
o.on("-c", "--chunksize=N", "Initial Chunksize") { |v| opts[:default_chunksize] = (v.to_i < 10 ? 10 : v.to_i) }
Expand All @@ -139,7 +139,6 @@ def clientoptparse(cmd)
opts[:table_filter] = "(#{r_tables})"
end
o.on("-e", "--exclude_tables=A,B,C", Array, "Shortcut to exclude a list of tables") { |v| opts[:exclude_tables] = v }
o.on("-s", "--skip-schema", "Skip schema migration") { |v| opts[:skip_schema] = true }
o.on("-d", "--debug", "Enable Debug Messages") { |v| opts[:debug] = true }
o.parse!(argv)

Expand Down
12 changes: 6 additions & 6 deletions lib/taps/operation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def file_prefix
end

def skip_schema?
!!opts[:no_schema]
!!opts[:skip_schema]
end

def indexes_first?
Expand Down Expand Up @@ -245,13 +245,13 @@ def to_hash
def run
catch_errors do
unless resuming?
pull_schema unless skip_schema?
pull_indexes if indexes_first?
pull_schema if !skip_schema?
pull_indexes if indexes_first? && !skip_schema?
end
setup_signal_trap
pull_partial_data if resuming?
pull_data
pull_indexes unless indexes_first?
pull_indexes if !indexes_first? && !skip_schema?
pull_reset_sequences
end
end
Expand Down Expand Up @@ -404,13 +404,13 @@ def to_hash
def run
catch_errors do
unless resuming?
push_schema unless skip_schema?
push_schema if !skip_schema?
push_indexes if indexes_first? && !skip_schema?
end
setup_signal_trap
push_partial_data if resuming?
push_data
push_indexes unless indexes_first? || skip_schema?
push_indexes if !indexes_first? && !skip_schema?
push_reset_sequences
end
end
Expand Down

0 comments on commit a465a75

Please sign in to comment.