Skip to content

Instantly share code, notes, and snippets.

@rickenharp
Created January 13, 2011 14:48
Show Gist options
  • Save rickenharp/777963 to your computer and use it in GitHub Desktop.
Save rickenharp/777963 to your computer and use it in GitHub Desktop.
class CreateCheckins < ActiveRecord::Migration
def self.up
create_table :checkins do |t|
t.string :name
t.point :latlon, :srid => 4326
t.timestamps
end
add_index :checkins, :latlon, :spatial => true
end
def self.down
remove_index :checkins, :latlon
drop_table :checkins
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment