lib/arcopy/copy.rb
# Define two databases source & target
Define two databases source & target
Define two databases source & target
def start!
      if @copy_schema
        puts '-> copy schema'
        copy_schema
      end
      puts '-> copy data'
      copy_data
      if @reset_tables.any? || @skip_reset
        puts '-> resetting table sequences'
        if @target_db['adapter'].include?('postgresql')
          reset_pg_ai
        elsif @target_db['adapter'].include?('mysql')
          reset_mysql_ai
        end
      end
    end
def start! if @copy_schema puts '-> copy schema' copy_schema end puts '-> copy data' copy_data if @reset_tables . any? || @skip_reset puts '-> resetting table sequences' if @target_db [ 'adapter' ] . include? ( 'postgresql' ) reset_pg_ai elsif @target_db [ 'adapter' ] . include? ( 'mysql' ) reset_mysql_ai end end end
Define two databases source & target
Define two databases source & target
# Copy schema # Start copying data # Reset auto increments in postgresql