master
1class CreateLocations < ActiveRecord::Migration
2 def change
3 create_table :locations, id: :uuid do |t|
4 t.uuid :locatable_id
5 t.string :locatable_type
6 t.decimal :latitude, precision: 10, scale: 6
7 t.decimal :longitude, precision: 10, scale: 6
8 t.string :address
9 t.string :city
10 t.string :region
11 t.string :country
12 t.string :postal_code
13
14 t.timestamps null: false
15 end
16
17 add_index :locations, [:locatable_id, :locatable_type]
18 end
19end