Class: CreateGeonamesCountries

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/geonames_dump/templates/db/migrate/create_geonames_countries.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/generators/geonames_dump/templates/db/migrate/create_geonames_countries.rb', line 3

def change
  create_table :geonames_countries do |t|
    t.string :iso
    t.string :iso3
    t.string :iso_numeric
    t.string :fips
    t.string :country
    t.string :capital
    t.integer :area # in sq. km
    t.integer :population
    t.string :continent
    t.string :tld
    t.string :currency_code
    t.string :currency_name
    t.string :phone
    t.string :postal_code_format
    t.string :postal_code_regex
    t.string :languages
    t.integer :geonameid
    t.string :neighbours
    t.string :equivalent_fips_code

    t.timestamps
  end

  add_index :geonames_countries, :geonameid
end