lib/wyrm/restore_schema.rb in wyrm-0.1.1 vs lib/wyrm/restore_schema.rb in wyrm-0.1.2

- old
+ new

@@ -15,11 +15,11 @@ end attr_reader :dst_db attr_reader :options attr_reader :container - attr_reader :schema_migration, :index_migration + attr_reader :schema_migration, :index_migration, :fk_migration def logger @logger ||= Logger.new STDERR end @@ -46,19 +46,18 @@ # create the destination schema def create eval( schema_migration ).apply dst_db, :up end - def restore_one_table( table_file, db_pump ) + def restore_one_table( table_file ) logger.info "restoring from #{table_file}" table_name = table_file.basename.sub_ext('').sub_ext('').to_s.to_sym # check if table has been restored already, and has the correct rows, # otherwise pass in a start row. - db_pump.from_bz2 table_file, dst_db, table_name + DbPump.from_bz2 table_file, dst_db, table_name end def restore_tables - db_pump = DbPump.new( options[:codec] ) table_files = Pathname.glob Pathname(container) + '*dbp.bz2' - table_files.sort_by{|tf| tf.stat.size}.each{|table_file| restore_one_table table_file, db_pump} + table_files.sort_by{|tf| tf.stat.size}.each{|table_file| restore_one_table table_file} end end