Class: CreatePostalCode

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/db/create_postal_codes_table.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/generators/db/create_postal_codes_table.rb', line 2

def change
  create_table :postal_codes do |t|
    t.string :name
    t.string :city
    t.string :region
    t.string :region_code
    t.string :country_code
    t.float :latitude
    t.float :longitude
    t.boolean :geocoded
    t.string :time_zone
    t.integer :country_id
    t.timestamps
  end
  add_index :postal_codes, :country_code
  add_index :postal_codes, :name
end