Add heartbeat model, next_heartbeat_time and update_heartbeat_time on device registration

This commit is contained in:
leenasn
2015-11-09 13:43:21 +05:30
parent 185b10d8e7
commit 0e8b403142
11 changed files with 89 additions and 4 deletions

View File

@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20151016122334) do
ActiveRecord::Schema.define(version: 20151109072450) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -54,8 +54,19 @@ ActiveRecord::Schema.define(version: 20151016122334) do
t.string "unique_id"
t.string "imei_number"
t.string "access_token"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "heartbeats_count", default: 0
t.datetime "last_heartbeat_recd_time"
end
create_table "heartbeats", force: :cascade do |t|
t.integer "device_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
add_index "heartbeats", ["device_id"], name: "index_heartbeats_on_device_id", using: :btree
add_foreign_key "heartbeats", "devices"
end