Class: CreateZipMetaTable

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/templates/create_zip_meta_table.rb

Class Method Summary collapse

Class Method Details

.downObject



18
19
20
# File 'lib/generators/templates/create_zip_meta_table.rb', line 18

def self.down
  drop_table :zip_meta
end

.upObject



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

def self.up
  create_table :zip_meta, :force => true do |t|
    t.string :zip
    t.string :city
    t.string :state
    t.float :latitude
    t.float :longitude
    t.integer :timezone
  end
  add_index :zip_meta, :zip
  add_index :zip_meta, :timezone
  
  # finally, load the data...
  ZipMeta::MigrationUtil.load_zipcode_data
end