adopt-a-hydrant/db/migrate/20110223180521_create_hydra...

18 lines
376 B
Ruby
Raw Normal View History

2011-02-23 20:50:59 +00:00
class CreateHydrants < ActiveRecord::Migration
def self.up
create_table :hydrants do |t|
t.timestamps
2011-03-06 05:21:52 +00:00
t.string :name
t.decimal :lat, :null => false
t.decimal :lng, :null => false
2011-02-23 20:50:59 +00:00
t.integer :city_id
t.integer :user_id
end
add_index :hydrants, :city_id, :unique => true
end
def self.down
drop_table :hydrants
end
end