mirror of
http://ghproxy.cn/https://github.com/multunus/onemdm-server
synced 2025-12-06 10:14:59 +00:00
Change the app_usages API to accept array of data
- Add foreignkey to device for AppUsage - Rename the route to app_usage from app_usage/create
This commit is contained in:
@@ -4,7 +4,8 @@ class CreateAppUsages < ActiveRecord::Migration
|
||||
t.string :package_name, null: false, index: false
|
||||
t.integer :usage_duration_in_seconds, null: false, index: false
|
||||
t.date :used_on, null: false, index: false
|
||||
|
||||
t.belongs_to :device, foreign_key: true, index: true
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
|
||||
@@ -53,10 +53,13 @@ ActiveRecord::Schema.define(version: 20160204094618) do
|
||||
t.string "package_name", null: false
|
||||
t.integer "usage_duration_in_seconds", null: false
|
||||
t.date "used_on", null: false
|
||||
t.integer "device_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
add_index "app_usages", ["device_id"], name: "index_app_usages_on_device_id", using: :btree
|
||||
|
||||
create_table "apps", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.string "package_name"
|
||||
@@ -105,6 +108,7 @@ ActiveRecord::Schema.define(version: 20160204094618) do
|
||||
add_index "installations", ["batch_installation_id"], name: "index_installations_on_batch_installation_id", using: :btree
|
||||
add_index "installations", ["device_id"], name: "index_installations_on_device_id", using: :btree
|
||||
|
||||
add_foreign_key "app_usages", "devices"
|
||||
add_foreign_key "batch_installations", "apps"
|
||||
add_foreign_key "heartbeats", "devices"
|
||||
add_foreign_key "installations", "batch_installations"
|
||||
|
||||
Reference in New Issue
Block a user