adopt-a-hydrant/db/migrate/00000000000003_create_thing...

15 lines
365 B
Ruby
Raw Normal View History

class CreateThings < ActiveRecord::Migration
2011-05-22 14:35:46 +00:00
def change
create_table :things do |t|
2011-02-23 20:50:59 +00:00
t.timestamps
2011-03-06 05:21:52 +00:00
t.string :name
2012-06-18 17:49:28 +00:00
t.decimal :lat, null: false, precision: 16, scale: 14
t.decimal :lng, null: false, precision: 17, scale: 14
2011-02-23 20:50:59 +00:00
t.integer :city_id
t.integer :user_id
end
2012-06-18 17:49:28 +00:00
add_index :things, :city_id, unique: true
2011-02-23 20:50:59 +00:00
end
end