Files
onemdm-server/db/migrate/20160204094618_create_app_usages.rb
Leena abe0b6c083 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
2016-02-05 08:24:39 +05:30

13 lines
387 B
Ruby

class CreateAppUsages < ActiveRecord::Migration
def change
create_table :app_usages do |t|
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
end