Sha256: 59c5057107a82088e720367fbc062c98b62dca54000adb4bc97696142c9194f5

Contents?: true

Size: 1.18 KB

Versions: 20

Compression:

Stored size: 1.18 KB

Contents

class CreateCountries < ActiveRecord::Migration[4.2]
  # 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

20 entries across 20 versions & 3 rubygems

Version Path
enju_leaf-1.3.6 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_leaf-1.3.5 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_leaf-1.3.4 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_leaf-1.3.4.rc.2 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_leaf-1.3.4.rc.1 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_leaf-1.3.3.1 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_leaf-1.3.3 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_manifestation_viewer-0.3.3 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_question-0.3.1 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_leaf-1.3.2 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_manifestation_viewer-0.3.2 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_question-0.3.0 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_leaf-1.3.1 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_manifestation_viewer-0.3.1 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_leaf-1.3.0 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_manifestation_viewer-0.3.0 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_leaf-1.3.0.rc.1 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_manifestation_viewer-0.3.0.rc.1 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_question-0.3.0.beta.1 spec/dummy/db/migrate/20081025083323_create_countries.rb
enju_manifestation_viewer-0.3.0.beta.2 spec/dummy/db/migrate/20081025083323_create_countries.rb