Skip to content

Instantly share code, notes, and snippets.

@DGaffney
Created February 1, 2011 22:53
Show Gist options
  • Select an option

  • Save DGaffney/806905 to your computer and use it in GitHub Desktop.

Select an option

Save DGaffney/806905 to your computer and use it in GitHub Desktop.
class CreateCountries < ActiveRecord::Migration
def self.up
create_table :countries do |t|
t.column :code, :string, :size => 2
t.column :name, :string, :size => 80
end
add_index :countries, :code
Country.reset_column_information
Country.create(:code => 'AF', :name => 'Afghanistan')
Country.create(:code => 'AL', :name => 'Albania')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment