Sha256: cdd44f1da703998ad54dc1b0f73b92f3469b7e12357197e6fd2108c0acd53f6c

Contents?: true

Size: 1.11 KB

Versions: 28

Compression:

Stored size: 1.11 KB

Contents

class GeocoderMaxmindGeoliteCity < ActiveRecord::Migration<%= migration_version %>
  def self.up
    create_table :maxmind_geolite_city_blocks, id: false do |t|
      t.column :start_ip_num, :bigint, null: false
      t.column :end_ip_num, :bigint, null: false
      t.column :loc_id, :bigint, null: false
    end
    add_index :maxmind_geolite_city_blocks, :loc_id
    add_index :maxmind_geolite_city_blocks, :start_ip_num, unique: true
    add_index :maxmind_geolite_city_blocks, [:end_ip_num, :start_ip_num], unique: true, name: 'index_maxmind_geolite_city_blocks_on_end_ip_num_range'

    create_table :maxmind_geolite_city_location, id: false do |t|
      t.column :loc_id, :bigint, null: false
      t.string :country, null: false
      t.string :region, null: false
      t.string :city
      t.string :postal_code, null: false
      t.float :latitude
      t.float :longitude
      t.integer :metro_code
      t.integer :area_code
    end
    add_index :maxmind_geolite_city_location, :loc_id, unique: true
  end

  def self.down
    drop_table :maxmind_geolite_city_location
    drop_table :maxmind_geolite_city_blocks
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
geocoder-1.8.3 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
geocoder-1.8.2 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
geocoder-1.8.1 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
geocoder-1.8.0 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
geocoder-1.7.5 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
geocoder-1.7.4 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
geocoder-1.7.3 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
geocoder-1.7.2 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
geocoder-1.7.1 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
geocoder-1.7.0 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
geocoder-1.6.7 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
geocoder-1.6.6 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
geocoder-1.6.5 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
geocoder-1.6.4 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
geocoder-1.6.3 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
geocoder-1.6.2 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
geocoder-1.6.1 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
geocoder-1.6.0 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
geocoder-1.5.2 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
really-broken-geocoder-2.0.0 lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb