diff options
| author | mo khan <mo@mokhan.ca> | 2014-09-08 21:28:21 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-09-08 21:28:21 -0600 |
| commit | 878c7e323ede3d694efacab426fad9f9546972a9 (patch) | |
| tree | beeadc621e2d2b57c270896a021cfbfe72b614e5 /db | |
| parent | 5db0dd2f6d041ec3967b568d0d84b124ccaf6173 (diff) | |
add geolocation info to user session.
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrate/20140909030826_add_geo_location_to_user_sessions.rb | 8 | ||||
| -rw-r--r-- | db/schema.rb | 8 |
2 files changed, 13 insertions, 3 deletions
diff --git a/db/migrate/20140909030826_add_geo_location_to_user_sessions.rb b/db/migrate/20140909030826_add_geo_location_to_user_sessions.rb new file mode 100644 index 00000000..7dc17a83 --- /dev/null +++ b/db/migrate/20140909030826_add_geo_location_to_user_sessions.rb @@ -0,0 +1,8 @@ +class AddGeoLocationToUserSessions < ActiveRecord::Migration + def change + add_column :user_sessions, :latitude, :float + add_column :user_sessions, :longitude, :float + add_column :user_sessions, :city, :string + add_column :user_sessions, :country, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 5015beca..1db9130b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140822032550) do +ActiveRecord::Schema.define(version: 20140909030826) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -145,8 +145,6 @@ ActiveRecord::Schema.define(version: 20140822032550) do t.integer "taggings_count", default: 0 end - add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree - create_table "tutorials", force: true do |t| t.string "heading" t.text "description" @@ -170,6 +168,10 @@ ActiveRecord::Schema.define(version: 20140822032550) do t.string "user_agent" t.datetime "accessed_at" t.datetime "revoked_at" + t.float "latitude" + t.float "longitude" + t.string "city" + t.string "country" end add_index "user_sessions", ["accessed_at"], name: "index_user_sessions_on_accessed_at", using: :btree |
