Failsafe cases for relocator

pull/629/head
Alejandro 10 years ago
parent 8f60aee13b
commit a96e36aff5

@ -56,9 +56,13 @@ module CartoDB
return_code = system(command)
raise "Error dumping and restoring! Please cleanup" if return_code != true
get_tables(@config[:target]).reject{|t| t == "spatial_ref_sys"}.each do |table|
puts "Cartodbfying table #{table}.."
@cartodbfy_conn ||= PG.connect(@config[:target][:conn])
puts @cartodbfy_conn.query("select cdb_cartodbfytable('#{@config[:target][:schema]}.#{table}')").to_a
begin
puts "Cartodbfying table #{table}.."
@cartodbfy_conn ||= PG.connect(@config[:target][:conn])
puts @cartodbfy_conn.query("select cdb_cartodbfytable('#{@config[:target][:schema]}.#{table}')").to_a
rescue PG::Error => e
puts "Cannot cartodbfy table #{table}."
end
end
end
end

@ -84,7 +84,7 @@ module CartoDB
User.terminate_database_connections(user.database_name, user.database_host)
relocator.migrate
#wipe all OIDs
user.tables.each{|t| t.table_id=nil; t.save}
user.tables.update({:table_id =>nil})
user.user_timeout = old_user_timeout
user.set_statement_timeouts
relocator.compare

Loading…
Cancel
Save