Sha256: 6fed23eb2d63b0e0435b44e3647dd5c9cead0f62cc0c9648eb12219a711ea39b

Contents?: true

Size: 369 Bytes

Versions: 30

Compression:

Stored size: 369 Bytes

Contents

class AddMoreTeams < ActiveRecord::Migration
  def self.up
    f = File.join(RAILS_ROOT, 'db', 'migrate', 'teams.txt')
    File.open(f) do |tf|
      while line = tf.gets
        line.chomp!
        name, short_name = line.split(', ')
        Team.create(:name => name, :short_name => short_name)
      end
    end
  end

  def self.down
    # Not reversible
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
tournament-5.0.0 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-4.2.0 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-4.0.2 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-4.0.0 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-3.3.3 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-3.3.2 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-3.3.1 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-3.3.0 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-3.2.2 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-3.2.1 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-3.2.0 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-3.1.1 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-3.1.0 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-3.0.3 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-3.0.2 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-3.0.1 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-3.0.0 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-2.1.2 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-2.0.0 webgui/db/migrate/20090301025902_add_more_teams.rb
tournament-2.2.1 webgui/db/migrate/20090301025902_add_more_teams.rb