Data Dictionary for Your Foundation Server

by dbaldwin

This is a high level data dictionary for your Foundation server. Please keep in mind that we’re continuously improving our product so there may be scenarios where fields have either been added or removed. We’ll do our best to keep this document up to date and if you have any questions please feel free to visit the applications forum. Be sure to review the article titled Overview of the Developer Foundation Schema.

Accounts Table

Accounts are the highest level entity in the system and loaded based on subdomain (see subdomain below). Users and devices are associated with accounts.

company: varchar(75)
Company name that displays on login page

address: varchar(50)
Company address

city: varchar(50)
Company city

state: varchar(25)
Company state

zip: varchar(15)
Company zip code

subdomain: varchar(100)
Subdomain for this account. Account information is dynamically loaded based on subdomain. For example, joeplumber.acmetracking.com will load account information matching “joeplumber”.

created_at/updated_at: datetime
Built-in Rails timestamps for when accounts are created or updated

is_verified: boolean
An account is will not be active unless this is flagged true

is_deleted: boolean
Deleting the account would also require the removal of users, devices, readings, and geofences. Since this could be an expensive transaction we flag the account as deleted and allow from some background process to do cleanup.

show_statistics: boolean
Turns on the Statistics view for this account on the Overview screen. The statistics view is used for applications that support runtime and idling.

show_maintenance: boolean
Turns on the Maintenance view for this account on the Overview screen. The maintenance view is used for applications that support runtime and allows you to receive notification based on a runtime threshold exception or scheduled date.

max_speed: integer
Notifications and reports will be created based on this threshold being exceeded by any device in the account.

Device Profiles Table

Device Profiles provide a mechanism for classifying devices based on certain criteria. For example, some devices may be configured to report location only and other may report location and I/O. A profile can limit what types of reports are displayed in the application.

name: varchar(255)
User defined name for profile such as Basic Fleet or Mobile Generator.

speeds: boolean
Toggles displaying speed reports for a device

stops: boolean
Toggles displaying stop reports for a device

idles: boolean
Toggles displaying idle reports for a device

runs: boolean
Toggles displaying runtime reports for a device

watch_gpio1: boolean
Toggles notifications for general purpose I/O #1

watch_gpio2: boolean
Toggles notifications for general purpose I/O #2

gpio1_labels: varchar(255)
Labels that represent high/low values for I/O #1

gpio2_labels: varchar(255)
Labels that represent high/low values for I/O #2

trips: boolean
Toggles displaying trip reports for a device

Devices Table

Devices are generally attached to a remote vehicle or piece of equipment. They are associated with accounts and device profiles.

name: varchar(75)
User defined name for device such as Vehicle #17 or Mobile Generator #33

imei: varchar(30)
Device unique identifier

phone_number: varchar(20)
SIM phone number or general purpose field

recent_reading_id: integer(11)
The ID of the most recent reading from the device

created_at/updated_at: datetime
Built-in Rails timestamps for when accounts are created or updated

provision_status_id: integer(2)
Stores the current device status. 0 means device is unprovisioned. 1 means device is provisioned. 2 means device is deleted. Devices aren’t purged from the system by the Rails application and this should be managed by a background process.

account_id: integer(11)
The ID of the account this device is associated with

last_online_time: datetime
The time the device last communicated with the server

online_threshold: integer(11)
The threshold in minutes that is used to send device offline notifications. Defaults to 90. If the device has not communicated in 90 minutes then an offline notification is sent.

icon_id: integer(11)
The ID of the google map marker. IDs represent different marker colors where 1 = blue, 2 = red, 3 = green, 4 = yellow, 5 = purple, 6 = dark blue, 7 = grey, 8 = orange.

group_id: integer(11)
The ID of the group this device belongs to

is_public: boolean
Flag that allows a device’s location to be shared with other systems through a GeoRSS feed. Defaults to false.

profile_id: integer(11)
The ID of the profile this device belongs to

last_gpio1: boolean
Flag that enables notifications to be sent for general purpose I/O #1

last_gpio2: boolean
Flag that enables notifications to be sent for general purpose I/O #2

gateway_name: varchar(255)
Name of the gateway this device currently reports to (e.g. xirgo, enfora, simcom)

speeding_at: datetime
The date/time the device exceeded a speed threshold