class CreateZipCodes < ActiveRecord::Migration def self.up # Leave this uncommented to use the default free data which comes with # this plugin, but is also available via: http://www.cfdynamics.com/zipbase/ # If you don't want to use this data, then comment the following section out. # ========================================================================= create_table "zip_codes", :force => true do |t| t.column :zip, :string t.column :city, :string t.column :state, :string, :limit => 2 t.column :latitude, :string t.column :longitude, :string t.column :zip_class, :string end add_index :zip_codes, :zip add_index :zip_codes, [:city, :state] end def self.down drop_table 'zip_codes' end end