Class: CreateGeonamesCountries

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

Overview

Class Method Summary collapse

Class Method Details

.downObject



35
36
37
# File 'lib/generators/geonames_dump/templates/db/migrate/create_geonames_countries.rb', line 35

def self.down
  drop_table :geonames_countries
end

.upObject



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

def self.up
  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
  add_index :geonames_countries, :country
end