diff options
| author | mo khan <mo@mokhan.ca> | 2014-02-21 22:40:59 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-02-21 22:40:59 -0700 |
| commit | bf5c3435155c0ee9c2172bea6b6b3c5dec2c2463 (patch) | |
| tree | 3f26241dd6bdcaa25d7b4c85d984230cd360e5b2 /db | |
| parent | e7902a5ecf47391c50290c06c2df06732a5c6fd0 (diff) | |
use a uuid as the primary key for locations.
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrate/20140222053352_create_locations.rb | 2 | ||||
| -rw-r--r-- | db/schema.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/db/migrate/20140222053352_create_locations.rb b/db/migrate/20140222053352_create_locations.rb index c5faa93..fb2bca2 100644 --- a/db/migrate/20140222053352_create_locations.rb +++ b/db/migrate/20140222053352_create_locations.rb @@ -1,6 +1,6 @@ class CreateLocations < ActiveRecord::Migration def change - create_table :locations do |t| + create_table :locations, id: :uuid do |t| t.uuid :license_id t.float :latitude t.float :longitude diff --git a/db/schema.rb b/db/schema.rb index f34633a..c9d8190 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -33,7 +33,7 @@ ActiveRecord::Schema.define(version: 20140222053352) do t.integer "well_type_id" end - create_table "locations", force: true do |t| + create_table "locations", id: :uuid, default: "uuid_generate_v4()", force: true do |t| t.uuid "license_id" t.float "latitude" t.float "longitude" |
