Sha256: ae3649f7ec74b5697b15f9ff303fbdc3d7a0bb2dc746ec4da7a521287955f980

Contents?: true

Size: 1.2 KB

Versions: 723

Compression:

Stored size: 1.2 KB

Contents

class CreateCountries < ActiveRecord::Migration

  # ISO 3166 is the International Standard for country codes.
  #
  # ISO 3166-1:2006 Codes for the representation of names of countries and their subdivisions - Part 1: 
  # Country codes which is what most users know as ISO's country codes. First published in 1974, it is has since 
  # then become one of the world's most popular and most widely used standard solution for coding country names. 
  # It contains a two-letter code which is recommended as the general purpose code, a three-letter code which has 
  # better mnenomic properties and a numeric-3 code which can be useful if script independence of the codes is important.
  #
  # http://www.iso.org/iso/country_codes/background_on_iso_3166/what_is_iso_3166.htm

  def change
    create_table :countries do |t|
      t.string :name,         :size => 80, :null => false
      t.text :display_name
      t.string :alpha_2,      :size => 2
      t.string :alpha_3,      :size => 3
      t.string :numeric_3, :size => 3
      t.text :note
      t.integer :position
    end
    add_index :countries, :name
    add_index :countries, :alpha_2
    add_index :countries, :alpha_3
    add_index :countries, :numeric_3
  end
end

Version data entries

723 entries across 715 versions & 23 rubygems

Version Path
enju_circulation-0.0.57 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_resource_merge-0.0.13 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_circulation-0.0.56 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_circulation-0.0.55 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_circulation-0.0.54 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_circulation-0.0.53 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_circulation-0.0.52 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_biblio-0.0.2 db/migrate/20081025083323_create_countries.rb
enju_biblio-0.0.1 db/migrate/20081025083323_create_countries.rb
enju_event-0.0.24 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_resource_merge-0.0.12 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_circulation-0.0.51 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_circulation-0.0.50 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_resource_merge-0.0.11 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_event-0.0.23 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_event-0.1.10 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_circulation-0.0.49 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_event-0.1.9 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_event-0.0.22 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_circulation-0.0.48 spec/dummy/db/migrate/20081025083323_create_countries.rb