class GenerateSchema < ActiveRecord::Migration
  def up
    create_table "clusters", :id => true, :force => true do |t|
      t.string   "uuid", :limit => 36, :null => false
      t.integer  "zoom_level"
      t.column "latitude", :numeric
      t.column "longitude", :numeric
      t.column "latitude_min", :numeric
      t.column "latitude_max", :numeric
      t.column "longitude_min", :numeric
      t.column "longitude_max", :numeric
      t.integer  "version"
      t.datetime "created_at"
      t.datetime "updated_at"
    end
    add_index "clusters", :uuid, :unique => true
    add_index "clusters", [:latitude,:longitude]
    add_index "clusters", :zoom_level
    add_index "clusters", :version

    create_table "clusters_locations", :id => true, :force => true do |t|
      t.string "cluster_id",  :null => false
      t.string "location_id", :null => false
    end
    add_index "clusters_locations", [:cluster_id, :location_id], :unique => true
    add_index "clusters_locations", :cluster_id
    add_index "clusters_locations", :location_id
    

    create_table "locations", :id => true, :force => true do |t|
      t.string   "uuid", :limit => 36, :null => false
      t.column "latitude", :numeric
      t.column "longitude", :numeric
      t.string   "label1"
      t.string   "label2"
      t.string   "label3"
      t.integer  "version"
      t.datetime "created_at"
      t.datetime "updated_at"
    end
    add_index "locations", :uuid, :unique => true
    add_index "locations", [:latitude,:longitude]
    
    create_table "zoom_levels", :id => true, :force => true do |t|
      t.integer  "zoom_level_id",    :null => false
      t.integer  "cluster_distance"
      t.datetime "created_at"
      t.datetime "updated_at"
    end
  end

  def down
  end
end
