Durable reference to an activity.
An activity represents the problem or action that our customers need to get done. It can have many templates associated with it that are filled out to achieve this. It is the interface for permissions and visibility.
This has a 1-to-1 correspondence to a form template. Each new activity will have a form template to be it's stand in for the foreign key references our system uses against FormTemplate.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
Identifier
name
mediumtext
NO
Name of activity, automatically created from form template name.
date_created
datetime
YES
Date activity was created.
date_modified
datetime
YES
Most recent modification date (defaults to created date).
is_active
tinyint(1)
NO
Is the form active (1) or archived (0).
is_secure
tinyint(1)
NO
Is the checkbox “Make this form private” selected in permission on form’s configure tab.
company_id
int
NO
FOREIGN KEY
users_company(id)
What company is the user associated with.
created_user_id
int
NO
FOREIGN KEY
auth_user(id)
Who created the activity record.
form_template_id
int
NO
FOREIGN KEY
forms_formtemplate(id)
What form template is associated with this activity.
template_category_id
int
NO
FOREIGN KEY
forms_formtemplatecategory(id)
Default is uncategorized, associates an activity with a template category.
permit_brandwide_submission_access
tinyint(1)
NO
True if activity permissions allow for brand wide submissions and form is configured to allow users to view submission data from all franchisees.
activities_activityfield
Store what fields are used on what activities' templates. As fields are removed from an activity template they are marked as inactive on here.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
is_active
tinyint(1)
NO
Is the activity active (1) or archived (0)
activity_id
int unsigned
NO
FOREIGN KEY, UNIQUE
activities_activity(id)
What is the activity id associated with this activity field. Unique_together with field_id.
field_id
int unsigned
NO
FOREIGN KEY, UNIQUE
fields_field(id)
What is the field id associated with this activity field. Unique_together with activity_id.
activities_activitytemplate
An activity template represents one set of questions and fields that are filled out to help complete or answer an activity. Saved changes to the form builder result in an update to the activity template and the new version upgraded to the primary activity template.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
Identifier (saved changes to the builder results in an update to the activity template and the new version being upgraded to the primary activity template).
name
mediumtext
NO
Comes from the name of the form.
date_created
datetime
YES
When was the activity template created.
date_modified
datetime
YES
When was the activity template last modified.
is_active
tinyint(1)
NO
If this has been deleted, then is_active is set to False.
is_primary
tinyint(1)
NO
Is this the primary version that is in use now – most recent version desired to be filled out by customers.
data
json
NO
json of all fields including how fields should be shown and how they interact with each other.
activity_id
int unsigned
NO
FOREIGN KEY
activities_activity(id)
The activity is associated with this template.
activities_locationfieldorder
Admins can enable custom question ordering for forms on the web app. When this feature is active and a location is selected, a user can rearrange the questions on that form. This ordering is stored in this table.
On mobile, if custom ordering is enabled and a location is pre-selected, the app fetches the latest field order from this table.
Note: Users cannot change the question order on private forms, regardless of admin settings.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
date_created
datetime
YES
Date it was created.
date_modified
datetime
YES
Date it was last modified.
field_order
json
NO
json with the order of the fields. List of activity field ids.
location_id
int
NO
FOREIGN KEY, UNIQUE
locations_location(id)
modified_user_id
int
NO
FOREIGN KEY
auth_user(id)
activity_template_id
int unsigned
NO
FOREIGN KEY, UNIQUE
activities_activitytemplate(id)
activities_sharedactivity
Keeps track of the shared activity between one company and another, along with some extra information relevant to sharing.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
date_created
datetime
YES
Date it was created.
date_modified
datetime
YES
Date it was last modified.
date_copied
datetime
YES
Date it was copied.
copying_user_id
int
NO
FOREIGN KEY
auth_user(id)
Who shared the form.
source_activity_id
int unsigned
NO
FOREIGN KEY, UNIQUE
activities_activity(id)
What is the activity id associated with the original activity. Unique_together with target_company_id.
target_activity_id
int unsigned
NO
FOREIGN KEY
activities_activity(id)
What is the id associated with the newly created activity.
target_company_id
int
YES
FOREIGN KEY, UNIQUE
users_company(id)
What is the id of the company the activity was shared with. Unique_together with source_activity_id.
activity_submissions
Information for each unique submission. Contains submission date information as well as field inputs.
Column
Type
Description
_id
ObjectId(String)
The Mongo id of the object
activity_template
{"id": "int"}
Id of the associated activities_activity
answers
{ "id as string": { "field_version": { "id": int }, "value": "", "visible": true } }
An response to each field on the form. Field versions are updated when a field is changed on a form, but submissions are not updated to match. The value is the answer that was entered. It can be different types based on the field. The key is a reference to fields_field id associated to the answer.
smetadata
yamlcreated_by: # Submitting user
id: int # Id of the submitting user
display_name: 'First Last'
company:
id: int
user_role: # Submitting user's role
id: int
name: 'Example Role'
distribute_groups: # List of associated teams
- id: int
user_distribute_groups: # List of associated user teams
[] # Empty list
account_distribute_groups: # List of associated locations
[] # Empty list
time_zone: 'America/New_York' # Submitted time zone
client_time_zone: 'Pacific/Rarotonga' # Location's time zone
user_agent: 'string' # Info about the submitting device
platform: 'unknown' # web, ios, android, etc
guid: 'string' # A GUID for the submission
environment: 'web' # web, app, etc
date_created: !!str ISODate("date string") # Server time
date_completed: !!str ISODate("date string")
date_submitted: !!str ISODate("date string")
date_modified: !!str ISODate("date string")
date_created_local: !!str ISODate("date string") # Device time
date_completed_local: !!str ISODate("date string")
date_submitted_local: !!str ISODate("date string")
time_to_complete: int # ms from start to completion
distance_to_account: null # distance from location to submission
lat: null # latitude of submission
lon: null # longitude of submission
task:
id: int # Id of the task
title: 'Example title'
account_id: int # Location id
project:
id: int
title: 'Example Project Name'
account: # Location
id: int
name: 'Example location name'
tags: # List of location attributes
- id: int
name: 'example attribute'
Metadata properties of the submission. Contains useful data that is not actually part of the submission form answers.
legacy_submission_id
String
Used to associate a submission to a form_submission.
deleted
Boolean
Indicates if the submission has been deleted.
announcements_announcement
The table that lists announcements.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
title
mediumtext
YES
message
mediumtext
YES
date_created
datetime
YES
date_modified
datetime
YES
company_id
int
NO
FOREIGN KEY
users_company(id)
created_user_id
int
NO
FOREIGN KEY
auth_user(id)
attachments
json
YES
date_scheduled
datetime
YES
is_active
tinyint(1)
NO
is_editable
tinyint(1)
NO
Is this announcement editable, true only while the announcement is not yet live.
queue_item_id
int unsigned
YES
FOREIGN KEY
schedules_queue(id)
location_attributes
json
YES
scope
varchar(255)
NO
Brand or Company
announcements_announcement_teams
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
announcement_id
int unsigned
NO
FOREIGN KEY, UNIQUE
announcements_announcement(id)
team_id
int
NO
FOREIGN KEY, UNIQUE
users_team(id)
announcements_announcement_user_roles
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
announcement_id
int unsigned
NO
FOREIGN KEY, UNIQUE
announcements_announcement(id)
userrole_id
int
NO
FOREIGN KEY, UNIQUE
users_userrole(id)
announcements_announcement_users
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
announcement_id
int unsigned
NO
FOREIGN KEY, UNIQUE
announcements_announcement(id)
user_id
int
NO
FOREIGN KEY, UNIQUE
auth_user(id)
announcements_bannerannouncement
Announcements which show up in the mobile banner.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
status
varchar(50)
NO
Options: Scheduled, Live, Ended, Stopped, Deleted
date_end
datetime
NO
date_stopped
datetime
YES
announcement_id
int unsigned
NO
FOREIGN KEY, UNIQUE
announcements_announcement(id)
stopped_user_id
int
YES
FOREIGN KEY
auth_user(id)
auth_group
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
name
varchar(150)
NO
UNIQUE
auth_user
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
last_login
datetime
YES
username
varchar(150)
NO
UNIQUE
first_name
varchar(150)
NO
last_name
varchar(150)
NO
email
varchar(100)
NO
is_active
tinyint(1)
NO
date_joined
datetime
NO
auth_user_groups
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
user_id
int
NO
FOREIGN KEY, UNIQUE
auth_user(id)
group_id
int
NO
FOREIGN KEY, UNIQUE
auth_group(id)
comments_comment
Describes the list of comments. Comments can be made on submissions and tasks.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
date_created
datetime
NO
date_modified
datetime
NO
is_active
tinyint(1)
NO
message
varchar(3000)
YES
created_user_id
int
NO
FOREIGN KEY
auth_user(id)
topic_id
int unsigned
NO
FOREIGN KEY
comments_topic(id)
comments_submission
Table that connects comments and form submissions.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
is_attribute
tinyint(1)
NO
comment_id
int unsigned
NO
FOREIGN KEY
comments_comment(id)
submission_id
char(24)
NO
FOREIGN KEY
forms_submission(id)
Submission Id in MongoDB.
comments_task
Table that connects comments and tasks.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
is_attribute
tinyint(1)
NO
comment_id
int unsigned
NO
FOREIGN KEY
comments_comment(id)
task_id
int unsigned
NO
FOREIGN KEY
tasks_task(id)
comments_topic
Table that connects comments and topics. Used for connecting comments and triggers.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
trigger_subtype_id
smallint unsigned
NO
FOREIGN KEY
rules_triggersubtype(id)
trigger_type_id
tinyint unsigned
NO
FOREIGN KEY
rules_triggertype(id)
comments_topicsubscriber
Table that connects comments and topics per user.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
date_last_read
datetime
NO
date_created
datetime
NO
topic_id
int unsigned
NO
FOREIGN KEY, UNIQUE
comments_topic(id)
user_id
int
NO
FOREIGN KEY, UNIQUE
auth_user(id)
date_subscribed
datetime
NO
comments_user
Table that connects comments and user.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
is_attribute
tinyint(1)
NO
comment_id
int unsigned
NO
FOREIGN KEY
comments_comment(id)
user_id
int
NO
FOREIGN KEY
auth_user(id)
companies_companyfranchisortos
Lists out users that accepted the terms of service.
This is mainly used for RBI.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
date_accepted
datetime
NO
accepted_user_id
int
NO
FOREIGN KEY, UNIQUE
auth_user(id)
company_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
companies_companyhierarchy
Hierarchical company association using nested set pattern.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
date_created
datetime
NO
date_modified
datetime
NO
lft
int unsigned
NO
rgt
int unsigned
NO
tree_id
int unsigned
NO
UNIQUE
level
int unsigned
NO
company_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
parent_company_hierarchy_id
int
YES
FOREIGN KEY
companies_companyhierarchy(id)
dashboards_dashboard
Table that lists the dashboards.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
title
varchar(50)
NO
date_created
datetime
NO
date_modified
datetime
NO
created_user_id
int
NO
FOREIGN KEY
auth_user(id)
dashboards_dashboardsavedsearch
Table that lists the dashboards saved search.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
order
smallint unsigned
NO
dashboard_id
int unsigned
NO
FOREIGN KEY
dashboards_dashboard(id)
saved_search_id
int unsigned
NO
FOREIGN KEY
users_savedsearch(id)
equipment_equipment
Table that lists the equipment.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
date_created
datetime
NO
date_modified
datetime
NO
external_key
varchar(50)
YES
UNIQUE
model_name
varchar(100)
NO
manufacturer
varchar(100)
NO
company_id
int
YES
FOREIGN KEY, UNIQUE
users_company(id)
is_active
tinyint(1)
NO
created_user_id
int
YES
FOREIGN KEY
auth_user(id)
description
mediumtext
YES
equipment_equipment_categories
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
equipment_id
int
NO
FOREIGN KEY, UNIQUE
equipment_equipment(id)
equipmentcategory_id
int
NO
FOREIGN KEY, UNIQUE
equipment_equipmentcategory(id)
equipment_equipmentcategory
Table that lists the equipment categories.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
date_created
datetime
NO
external_key
varchar(50)
YES
UNIQUE
is_active
tinyint(1)
NO
company_id
int
YES
FOREIGN KEY, UNIQUE
users_company(id)
created_user_id
int
YES
FOREIGN KEY
auth_user(id)
equipment_equipmentcategory_translation
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
language_code
varchar(15)
NO
UNIQUE
name
varchar(100)
NO
master_id
int
YES
FOREIGN KEY, UNIQUE
equipment_equipmentcategory(id)
equipment_equipmentlocation
Assignment of equipment to a location with location specific information for that piece of equipment.
Column
Type
Nullable
Constraint
References
Comment
id
bigint
NO
PRIMARY KEY
location_zone
varchar(255)
YES
A text description of where this equipment exists within the specific location.
identifier
varchar(255)
YES
A unique description to help uniquely identify this equipment instance.
The table lists out events regarding follow-up actions.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
date_created
datetime
NO
message
varchar(255)
YES
data
longtext
NO
JSON data containing the details regarding follow up actions.
rule_id
int unsigned
YES
FOREIGN KEY
rules_rule(id)
trigger_subtype_id
smallint unsigned
NO
FOREIGN KEY
rules_triggersubtype(id)
trigger_type_id
tinyint unsigned
NO
FOREIGN KEY
rules_triggertype(id)
events_event_action_subtypes
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
event_id
int unsigned
NO
FOREIGN KEY, UNIQUE
events_event(id)
actionsubtype_id
smallint unsigned
NO
FOREIGN KEY, UNIQUE
rules_actionsubtype(id)
events_event_gateways
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
event_id
int unsigned
NO
FOREIGN KEY, UNIQUE
events_event(id)
gateway_id
int
NO
FOREIGN KEY, UNIQUE
sensors_gateway(id)
events_event_sensors
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
event_id
int unsigned
NO
FOREIGN KEY, UNIQUE
events_event(id)
sensor_id
int
NO
FOREIGN KEY, UNIQUE
sensors_sensor(id)
events_formsubmission
Through table for forms submission and events table.
Column
Type
Nullable
Constraint
References
Comment
form_submission_id
char(24)
NO
FOREIGN KEY, PRIMARY KEY
forms_submission(id)
event_id
int unsigned
NO
FOREIGN KEY, PRIMARY KEY
events_event(id)
events_formtemplate
Through table for form templates and events.
Column
Type
Nullable
Constraint
References
Comment
event_id
int unsigned
NO
FOREIGN KEY, PRIMARY KEY
events_event(id)
form_template_id
int
NO
FOREIGN KEY, PRIMARY KEY
forms_formtemplate(id)
events_integration
Many-to-many table for integrations types and events.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
event_id
int unsigned
NO
FOREIGN KEY
events_event(id)
integration_type_id
int
NO
FOREIGN KEY
integrations_integrationtype(id)
events_location
Through table for locations and events.
Column
Type
Nullable
Constraint
References
Comment
location_id
int
NO
FOREIGN KEY, PRIMARY KEY
locations_location(id)
event_id
int unsigned
NO
FOREIGN KEY, PRIMARY KEY
events_event(id)
events_notification
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
event_id
int unsigned
NO
FOREIGN KEY, UNIQUE
events_event(id)
notification_id
int unsigned
YES
FOREIGN KEY, UNIQUE
notifications_notification_new(id)
events_project
Many-to-many table for projects and events.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
event_id
int unsigned
NO
FOREIGN KEY
events_event(id)
project_id
int unsigned
NO
FOREIGN KEY
projects_project(id)
events_sensorformsubmission
Many to many table for sensor form submissions and events.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
sensor_form_submission_id
char(32)
NO
event_id
int unsigned
NO
FOREIGN KEY
events_event(id)
events_task
Through table for tasks and events.
Column
Type
Nullable
Constraint
References
Comment
task_id
int unsigned
NO
FOREIGN KEY, PRIMARY KEY
tasks_task(id)
event_id
int unsigned
NO
FOREIGN KEY, PRIMARY KEY
events_event(id)
events_team
Through table for teams and events.
Column
Type
Nullable
Constraint
References
Comment
event_id
int unsigned
NO
FOREIGN KEY, PRIMARY KEY
events_event(id)
team_id
int
NO
FOREIGN KEY, PRIMARY KEY
users_team(id)
events_user
Through table for users and events.
Column
Type
Nullable
Constraint
References
Comment
event_id
int unsigned
NO
FOREIGN KEY, PRIMARY KEY
events_event(id)
user_id
int
NO
FOREIGN KEY, PRIMARY KEY
auth_user(id)
events_userrole
Through table for user roles and events.
Column
Type
Nullable
Constraint
References
Comment
event_id
int unsigned
NO
FOREIGN KEY, PRIMARY KEY
events_event(id)
user_role_id
int
NO
FOREIGN KEY, PRIMARY KEY
users_userrole(id)
fbc_audit
Table of submissions where managing companies can share or not share audits with their reporting companies.
Column
Type
Nullable
Constraint
References
Comment
id
bigint
NO
PRIMARY KEY
date_submitted
datetime
NO
legacy_submission_id
varchar(25)
NO
UNIQUE
Mongo legacy id of the submission.
activity_submission_id
varchar(25)
NO
UNIQUE
Mongo id of the related activity submission.
form_template_id
int
NO
FOREIGN KEY
forms_formtemplate(id)
location_id
int
NO
FOREIGN KEY
locations_location(id)
parent_company_hierarchy_id
int
NO
FOREIGN KEY
users_company(id)
reporting_company_id
int
NO
FOREIGN KEY
users_company(id)
submitted_user_id
int
NO
FOREIGN KEY
auth_user(id)
fields_field
Records fields used in forms.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
date_created
datetime
YES
is_active
tinyint(1)
NO
Is the form active (1) or archived (0).
company_id
int
NO
FOREIGN KEY
users_company(id)
fields_fieldtype
Types of form fields. Used to enforce constraint at the database level for field type options. (See fields_fieldversion for example)
Column
Type
Nullable
Constraint
References
Comment
type
char(255)
NO
PRIMARY KEY
fields_fieldversion
Version tracking for form fields.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
title
mediumtext
NO
data
json
NO
is_primary
tinyint(1)
NO
field_id
int unsigned
NO
FOREIGN KEY
fields_field(id)
date_created
datetime
YES
field_type
char(255)
NO
FOREIGN KEY
fields_fieldtype(type)
company_id
int
NO
FOREIGN KEY
users_company(id)
forms_formactivitycategory
Relational table between form templates and form categories. This is currently functioning as a 1:1 relationship.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
form_category_id
int
NO
FOREIGN KEY
forms_formcategory(id)
form_template_id
int
NO
FOREIGN KEY, UNIQUE
forms_formtemplate(id)
forms_formcategory
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
company_id
int
NO
FOREIGN KEY
users_company(id)
is_sharable
tinyint(1)
NO
Indicates that the category should be shared with any associated reporting companies if the associated company has reporting companies.
title
varchar(50)
NO
forms_formcategory_translation
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
language_code
varchar(15)
NO
UNIQUE
name
varchar(50)
NO
master_id
int
YES
FOREIGN KEY, UNIQUE
forms_formcategory(id)
forms_formpermissionrole
Permissions applied to a private form based on a user’s role. This only applies if the form is currently private.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
form_template_id
int
NO
FOREIGN KEY, UNIQUE
forms_formtemplate(id)
permission_id
int
NO
FOREIGN KEY, UNIQUE
forms_permission(id)
Permission id. Defaults to 1 (view own submissions).
user_role_id
int
NO
FOREIGN KEY, UNIQUE
users_userrole(id)
forms_formteam
Permissions applied to a private form base on a user’s team. This only applies if the form is currently private.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
team_id
int
NO
FOREIGN KEY, UNIQUE
users_team(id)
form_template_id
int
NO
FOREIGN KEY, UNIQUE
forms_formtemplate(id)
from_parent_team_id
int
YES
FOREIGN KEY, UNIQUE
users_team(id)
All child teams are granted permission as well. This indicates that permission is granted due to a parent team having permission.
permission_id
int
NO
FOREIGN KEY, UNIQUE
forms_permission(id)
Permission id. Defaults to 1 (view own submissions)
forms_formpermissionuser
Private form permissions based on user id. This only applies if the form is currently private.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
form_template_id
int
NO
FOREIGN KEY, UNIQUE
forms_formtemplate(id)
permission_id
int
NO
FOREIGN KEY, UNIQUE
forms_permission(id)
Permission id. Defaults to 1 (view own submissions).
user_id
int
NO
FOREIGN KEY, UNIQUE
auth_user(id)
forms_formtemplate
The base record for form templates.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
title
varchar(255)
NO
data
longtext
NO
A JSON dictionary defining various form values and all the form’s fields' specifics.
date_created
datetime
YES
date_updated
datetime
YES
date_last_submitted
datetime
YES
num_submissions
int
NO
Number of submissions made with this form
deleted
tinyint(1)
NO
is_creator_lock
tinyint(1)
NO
Do not allow admins in my company to edit this template.
show_in_brandhub
tinyint(1)
NO
Indicates if the form has been included in BrandHub.
is_secure
tinyint(1)
NO
If true a form has been configured to be private.
company_id
int
NO
FOREIGN KEY
users_company(id)
parent_form_template_id
int
YES
FOREIGN KEY
forms_formtemplate(id)
This is the source form template if the form template has been copied from one company to another such as when a brand form has been published through the brand.
rule_id
int unsigned
YES
FOREIGN KEY
rules_rule(id)
Id for associated the rules_rule table. Used in managing triggers.
user_id
int
NO
FOREIGN KEY
auth_user(id)
form_template_type_id
smallint unsigned
NO
FOREIGN KEY
forms_formtemplatetype(id)
is_fbc_audit
tinyint(1)
NO
Whether to show submissions made on this form on the FBC Audits page
forms_formtemplate_saved_searches_to_reactivate
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
formtemplate_id
int
NO
FOREIGN KEY, UNIQUE
forms_formtemplate(id)
savedsearch_id
int unsigned
NO
FOREIGN KEY, UNIQUE
users_savedsearch(id)
forms_formtemplatetype
Form template type. Currently only user_generated, sensor, zenprint_print_job are options. This is used by saved searches.
Column
Type
Nullable
Constraint
References
Comment
id
smallint unsigned
NO
PRIMARY KEY
name
varchar(50)
NO
UNIQUE
forms_permission
Private form permission levels.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
name
varchar(40)
NO
forms_savedsearch_formtemplate
Relational table between form templates and saved searches.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
form_template_id
int
NO
FOREIGN KEY
forms_formtemplate(id)
saved_search_id
int unsigned
NO
FOREIGN KEY, UNIQUE
users_savedsearch(id)
forms_submission
Record of form submissions.
Column
Type
Nullable
Constraint
References
Comment
id
char(24)
NO
PRIMARY KEY
Id is the ObjectID in MongoDb for the submission.
is_active
tinyint(1)
NO
Is submission deleted or not.
date_submitted
datetime
NO
lat
double
YES
Device latitude at time of hitting submit.
lon
double
YES
Device longitude at time of hitting submit.
num_images
int
NO
questions_answered
int
NO
time_to_complete
int
YES
Milliseconds delta between date_created and date_completed.
distance_to_location
double
YES
Miles between the submission lat/lon and the location lat/lon.
company_id
int
YES
FOREIGN KEY
users_company(id)
form_template_id
int
NO
FOREIGN KEY
forms_formtemplate(id)
submitted_user_id
int
NO
FOREIGN KEY
auth_user(id)
date_submitted_local
datetime
YES
Local datetime when submitted.
time_zone
varchar(40)
YES
Submission timezone.
num_failures
int
YES
The number questions with acceptance_value = -1.
forms_zenprint_print_job
The contents of each print job generated by a Zenput Labels installation.
Column
Type
Description
_id
ObjectId(String)
The Mongo id of the object
fields
[]
Not used
metadata
title: '' # Not used
deleted: boolean
company:
id: int
form_template_type: 'zenprint_print_job'
date_created: !!str ISODate("date string")
version:
id: int
created_by:
display_name: string
id: int
rdbms_id: int
is_secure: boolean
is_creator_lock: boolean
is_copy_enabled: boolean
order: []
The metadata for the form template, which is how print jobs are implemented. This information only changes when the form template gets updated or when a new one is used. It contains information on: -Type of form template: zenprint_print_job -The user that created the form template. -The company that the user belongs to -When the form template was created. -The database ID for the form template.
smetadata
title: '' # Not used
deleted: boolean
company:
id: int
form_template_type: 'zenprint_print_job'
date_created: !!str ISODate("date string")
version:
id: int
created_by:
display_name: string
id: int
rdbms_id: int
is_secure: boolean
is_creator_lock: boolean
is_copy_enabled: boolean
order: []
The definition for the print job. There is one print job per ingredient, even in bulk print scenarios. This will also contain printer information for debugging purposes. The information collected varies between manufacturers (Zebra and Bixolon).
deleted
Boolean
Indicates if the print job has been deleted.
ingredients_allergenlabel
Allergens in ingredients.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
date_created
datetime
NO
date_modified
datetime
NO
ingredient_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_ingredient(id)
ingredients_allergenlabel_translation
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
language_code
varchar(15)
NO
UNIQUE
allergen_label
varchar(2000)
NO
master_id
int
YES
FOREIGN KEY, UNIQUE
ingredients_allergenlabel(id)
ingredients_catalog
Table that lists the ingredient catalogs owned by some managing companies.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
name
varchar(200)
NO
date_created
datetime
NO
date_modified
datetime
NO
company_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
is_active
tinyint(1)
NO
ingredients_catalogsubscription
Table that points to which ingredient catalog a reporting company is using.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
ingredient_catalog_subscriber_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
ingredient_catalog_id
int
YES
FOREIGN KEY
ingredients_catalog(id)
ingredients_category
Table that lists ingredient categories.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
color
varchar(6)
NO
Hex color value for displaying the category color.
date_created
datetime
NO
date_modified
datetime
NO
is_active
tinyint(1)
NO
company_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
created_user_id
int
NO
FOREIGN KEY
auth_user(id)
external_key
varchar(100)
YES
UNIQUE
Key used to link the Crunchtime value to the customer’s internal systems.
activities_support
tinyint(1)
NO
Whether or not this category is used by the Activities feature. If true, the category will appear in the Ingredient Catelog's drop-down menu for the Ingredient Temperature field on form
labels_support
tinyint(1)
NO
Whether or not this category is used by the Zenput Labels application.
production_sheets_support
tinyint(1)
NO
Whether or not this category is used by the Production Sheets application.
ingredients_category_translation
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
language_code
varchar(15)
NO
UNIQUE
name
varchar(100)
NO
master_id
int
YES
FOREIGN KEY, UNIQUE
ingredients_category(id)
ingredients_categorydisable
Table that lists categories that are disabled for specific companies.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
category_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_category(id)
company_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
ingredients_companypreference
Table that contains settings per company that are specific to Zenput Labels. Currently only contains the label types that a company can order from the app.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
label_type
varchar(75)
NO
The type of label to order (low-adhesive or dissolvable), Default is Low-Adhesive.
company_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
ingredients_expirationdatetype
What the expiration on the printed label means (best by, expires on, use by).
Column
Type
Nullable
Constraint
References
Comment
id
smallint unsigned
NO
PRIMARY KEY
name
varchar(20)
NO
UNIQUE
ingredients_expirationtype
The type of expiration that is printed on the labels. This affects how the calculation is done and how it is printed.
Column
Type
Nullable
Constraint
References
Comment
id
smallint unsigned
NO
PRIMARY KEY
name
varchar(55)
NO
UNIQUE
The type of expiration: calculated, end of day, package, two step.
ingredients_ingredient
Table that lists ingredients.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
date_created
datetime
NO
date_modified
datetime
NO
is_active
tinyint(1)
NO
company_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
created_user_id
int
NO
FOREIGN KEY
auth_user(id)
has_expiration
tinyint(1)
NO
template_group_id
int
YES
FOREIGN KEY
ingredients_templategroup(id)
external_key
varchar(100)
YES
UNIQUE
Key used to link the Crunchtime value to the customer’s internal systems.
parent_id
int
YES
FOREIGN KEY
ingredients_ingredient(id)
Id of the same table: ingredients_ingredient Example: a regular donut is the parent ingredient of a glazed donut
activities_support
tinyint(1)
NO
Whether or not this ingredient is used by the Activities feature.
labels_support
tinyint(1)
NO
Whether or not this ingredient is used by the Zenput Labels application.
production_sheets_support
tinyint(1)
NO
Whether or not this ingredient is used by the Production Sheets application.
ingredients_ingredient_categories
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
ingredient_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_ingredient(id)
category_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_category(id)
ingredients_ingredient_translation
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
language_code
varchar(15)
NO
UNIQUE
name
varchar(100)
NO
master_id
int
YES
FOREIGN KEY, UNIQUE
ingredients_ingredient(id)
ingredients_ingredientclearview
Table that lists the ClearView external key for ingredients. Used only by Production Sheets for tracking waste.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
clearview_external_key
varchar(100)
NO
ingredient_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_ingredient(id)
ingredients_ingredientdisable
Table that lists ingredients that are disabled for specific companies.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
company_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
ingredient_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_ingredient(id)
ingredients_ingredientlocation
Table that lists which ingredients are available in which locations.
Table that contains expiration information for ingredient locations.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
date_created
datetime
NO
date_modified
datetime
NO
expiration_unit
varchar(11)
YES
Days, weeks, months, etc.
expiration_value
int
YES
How many units.
is_active
tinyint(1)
NO
expiration_date_type_id
smallint unsigned
YES
FOREIGN KEY
ingredients_expirationdatetype(id)
expiration_type_id
smallint unsigned
NO
FOREIGN KEY
ingredients_expirationtype(id)
phase_type_id
int
YES
FOREIGN KEY, UNIQUE
ingredients_phasetype(id)
ingredient_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_ingredient(id)
location_id
int
NO
FOREIGN KEY, UNIQUE
locations_location(id)
ingredients_labelorder
Table that contains information on where to send ordered labels.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
label_type
varchar(75)
YES
The label size (1x1, 2x1, 2x2).
quantity
int
YES
How many items where ordered.
address
varchar(75)
NO
Recipient address.
address2
varchar(75)
YES
Recipient address 2.
city
varchar(75)
NO
Recipient city.
state
varchar(75)
NO
Recipient state.
zipcode
varchar(10)
NO
Recipient zipcode.
phone
varchar(75)
NO
Recipient phone.
email
varchar(75)
NO
Recipient email.
date_created
datetime
NO
date_modified
datetime
NO
location_id
int
YES
FOREIGN KEY
locations_location(id)
brand_id
int
YES
FOREIGN KEY
users_companybrand(id)
company_id
int
NO
FOREIGN KEY
users_company(id)
country_id
varchar(2)
YES
FOREIGN KEY
users_country(alpha_2)
The two-leter country identifier.
created_user_id
int
NO
FOREIGN KEY
auth_user(id)
media
varchar(50)
NO
The type of label (low-adhesive, dissolvable).
ingredients_phase
Table contains information on an ingredient phase.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
duration_type
varchar(11)
YES
Days, weeks, months, etc.
duration_value
int
YES
How many units.
company_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
expiration_date_type_id
smallint unsigned
YES
FOREIGN KEY
ingredients_expirationdatetype(id)
expiration_type_id
smallint unsigned
NO
FOREIGN KEY
ingredients_expirationtype(id)
ingredient_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_ingredient(id)
phase_type_id
int
YES
FOREIGN KEY, UNIQUE
ingredients_phasetype(id)
date_label
varchar(24)
YES
The name for the type of date that is printed on the label
date_created
datetime
NO
date_modified
datetime
NO
is_active
tinyint(1)
NO
template_group_id
int
YES
FOREIGN KEY
ingredients_templategroup(id)
duration_type_step_two
varchar(11)
YES
Days, weeks, months, etc., for the second step in a two-step expiration ingredient phase.
duration_value_step_two
int
YES
How many units for the second step in a two-step expiration phase.
step_one_name
varchar(50)
YES
The name for the first step in a two-step expiration ingredient phase.
step_two_name
varchar(50)
YES
The name for the second step in a two-step expiration ingredient phase.
ingredients_phaseattribute
Table that lists the [optional] phase attributes.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
name
varchar(50)
NO
UNIQUE
is_required
tinyint(1)
NO
phase_type_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_phasetype(id)
is_active
tinyint(1)
NO
ingredients_phaseattributeoption
Table that lists the phase attribute options.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
name
varchar(50)
NO
UNIQUE
phase_attribute_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_phaseattribute(id)
is_active
tinyint(1)
NO
ingredients_phaseattributeoptionsselect
Table that lists the selected attribute option.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
phase_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_phase(id)
phase_attribute_option_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_phaseattributeoption(id)
ingredients_phasetype
Table that lists the phase types (Received, Use By, etc.)
Each company can have up to 5 phases.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
name
varchar(50)
NO
Value that the user sets when creating the phase.
is_active
tinyint(1)
NO
date_created
datetime
NO
date_modified
datetime
NO
order
smallint unsigned
YES
UNIQUE
The order in which to display this phase type.
company_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
Company who created the phase. Phase cannot be overwritten by a child company.
created_user_id
int
NO
FOREIGN KEY
auth_user(id)
display_name
varchar(50)
NO
template_group_id
int
YES
FOREIGN KEY
ingredients_templategroup(id)
ingredients_template
Table that lists the label templates for an ingredient.
A tokenized ZPL template that will be formatted at printing time by the Zenput Labels app.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
data
varchar(1024)
NO
The ZPL for the template. This includes tokens for the template fields.
date_created
datetime
NO
date_modified
datetime
NO
is_active
tinyint(1)
NO
size
varchar(64)
NO
UNIQUE
The label size for the template (1x1, 2x1, 2x2).
template_group_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_templategroup(id)
ingredients_templatefield
Table that lists the label template fields.
A field that represents a token in a template.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
description
varchar(1024)
NO
The ZPL for the template. This includes tokens for the template fields.
line_break
int
YES
Size of line break.
name
varchar(128)
NO
UNIQUE
one_line_zpl
varchar(512)
YES
The ZPL for when only one line will be printed.
token
varchar(128)
YES
The token in the template that will be replaced by the contents of this field.
truncate_length
int
YES
String length at which the content of the field should be broken.
two_line_zpl
varchar(512)
YES
The ZPL for when we need to print two lines.
field_type
int
NO
FOREIGN KEY
ingredients_templatefieldtype(id)
break_twice
tinyint(1)
NO
ingredients_templatefield_templates
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
templatefield_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_templatefield(id)
template_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_template(id)
ingredients_templatefieldtype
Table that lists the types of template fields.
The template field's type: client_determined, phase_type, phase_type_attribute
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
description
varchar(1024)
NO
name
varchar(128)
NO
UNIQUE
ingredients_templategroup
Table that lists the template groups (Name Prominent, Date Prominent, etc.) used for printing labels.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
date_created
datetime
NO
date_modified
datetime
NO
description
varchar(1024)
NO
name
varchar(128)
NO
UNIQUE
is_active
tinyint(1)
NO
ingredients_templategroup_companies
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
templategroup_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_templategroup(id)
company_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
ingredients_templategroupphasetypeoverride
Table that has the template group override at the phase type level for a catalog subscriber.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
ingredient_catalog_subscriber_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
phase_type_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_phasetype(id)
template_group_id
int
NO
FOREIGN KEY
ingredients_templategroup(id)
ingredients_unitofmeasure
Table that lists the units of measure for an ingredient.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
date_created
datetime
NO
date_modified
datetime
NO
external_key
varchar(50)
NO
Key used to link the Crunchtime value to the customer’s internal systems.
is_active
tinyint(1)
NO
company_id
int
NO
FOREIGN KEY
users_company(id)
ingredients_unitofmeasure_translation
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
language_code
varchar(15)
NO
UNIQUE
name
varchar(500)
NO
master_id
int
YES
FOREIGN KEY, UNIQUE
ingredients_unitofmeasure(id)
locations_attribute
Attributes are keywords or terms that end users can assign to a location.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
name
varchar(100)
NO
UNIQUE
is_editable
tinyint(1)
NO
Dictates whether or not locations can be removed/added from this attribute.
is_active
tinyint(1)
NO
Describes if the attribute has been deleted by a user or not.
company_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
external_key
varchar(50)
YES
UNIQUE
locations_location
Lists all relevant information pertaining to locations.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
name
varchar(100)
NO
address
varchar(100)
NO
city
varchar(100)
NO
state
varchar(50)
NO
zipcode
varchar(40)
YES
country_id
varchar(2)
YES
FOREIGN KEY
users_country(alpha_2)
email
varchar(500)
YES
phone
varchar(20)
YES
external_key
varchar(100)
YES
UNIQUE
lat
double
YES
lon
double
YES
date_modified
datetime
YES
date_created
datetime
YES
date_deactivated
datetime
YES
is_active
tinyint(1)
NO
full_text_search
varchar(1000)
NO
Allows searching of location based on email, location name, state, country and etc.
time_zone
varchar(40)
YES
company_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
region
varchar(50)
YES
temperature_unit
varchar(1)
YES
locations_locationattribute
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
location_id
int
NO
FOREIGN KEY, UNIQUE
locations_location(id)
attribute_id
int
NO
FOREIGN KEY, UNIQUE
locations_attribute(id)
locations_locationcalendardayevent
An event that occurs over a full day, relative to a single day of the week.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
day_of_week
int
NO
UNIQUE
Day of the week(0-6), 0 = Monday, things that apply every day will have 7 entries in the DB.
calendar_event_type_id
int
NO
FOREIGN KEY, UNIQUE
locations_locationcalendareventtype(id)
location_id
int
NO
FOREIGN KEY, UNIQUE
locations_location(id)
locations_locationcalendarevent
Point in time events relative to a single day of the week. Ranges, things like shifts or dayparts are represented as two calendar events, start and stop.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
time_offset_minutes
int
NO
Time offset minutes represents the event time relative to 00:00 at the start of the day at the location. Negative numbers means the day prior, and anything after 24*60 meaning the next day.
day_of_week
int
NO
UNIQUE
What day of the week does this apply for(0-6), 0 = Monday, things that apply every day will have 7 entries in the DB.
calendar_event_type_id
int
NO
FOREIGN KEY, UNIQUE
locations_locationcalendareventtype(id)
location_id
int
NO
FOREIGN KEY, UNIQUE
locations_location(id)
locations_locationcalendareventtype
This class represents different reference types for a locations calendar.
This stores if a location has disabled random ingredient temperature feature.
Column
Type
Nullable
Constraint
References
Comment
location_id
int
NO
FOREIGN KEY, PRIMARY KEY
locations_location(id)
locations_locationfbc
Table that attaches FBC users to locations.
Column
Type
Nullable
Constraint
References
Comment
id
bigint
NO
PRIMARY KEY
location_id
int
NO
FOREIGN KEY, UNIQUE
locations_location(id)
user_id
int
NO
FOREIGN KEY, UNIQUE
auth_user(id)
locations_locationowneruser
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
location_id
int
NO
FOREIGN KEY, UNIQUE
locations_location(id)
user_id
int
NO
FOREIGN KEY, UNIQUE
auth_user(id)
notifications_message
Where we store information about when a User has read an Announcement or Comment. In this table we store a separate record for each recipient of the same Announcement
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
target_type
varchar(255)
NO
Is this an Announcement, Task, or Submission?
date_seen
datetime
YES
is_active
tinyint(1)
NO
is_active is currently used for marking announcements as resent.
date_created
datetime
YES
date_modified
datetime
YES
announcement_id
int unsigned
YES
FOREIGN KEY
announcements_announcement(id)
comment_id
int unsigned
YES
FOREIGN KEY
comments_comment(id)
created_user_id
int
NO
FOREIGN KEY
auth_user(id)
recipient_user_id
int
NO
FOREIGN KEY
auth_user(id)
notifications_notifier
Who the notification is notifying.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
notification_type
varchar(50)
NO
Internal OR external.
email
varchar(75)
YES
delivery_type_id
smallint unsigned
NO
FOREIGN KEY
users_usernotificationsettingdeliverytype(id)
notification_id
int unsigned
NO
FOREIGN KEY
notifications_notification_new(id)
user_id
int
YES
FOREIGN KEY
auth_user(id)
Who is it getting sent to, if anyone.
production_sheets_sheet
A production sheet record represents a production sheet for a specific timeframe in a location. There is only one production sheet per day per location.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
approved_local_username
varchar(20)
YES
date
date
NO
UNIQUE
What date is the sheet for.
date_approved
datetime
YES
date_created
datetime
NO
date_modified
datetime
NO
is_active
tinyint(1)
NO
modified_local_username
varchar(20)
NO
approved_user_id
int
YES
FOREIGN KEY
auth_user(id)
location_id
int
NO
FOREIGN KEY, UNIQUE
locations_location(id)
modified_user_id
int
NO
FOREIGN KEY
auth_user(id)
production_sheets_sheetentry
A single record that stores how much of an ingredient was made or wasted and optionally its temperature as well.
The slice of time that any entry represents is an hour, which is represented by how many minutes have passed since the start date of a production sheet at 00:00 to mark the start of the slice.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
amount_made
double
YES
amount_wasted
double
YES
modified_local_username
varchar(20)
NO
date_created
datetime
NO
entry_time_offset_start
int
NO
How many minutes away it is from the production sheet's date at 00:00. It could be negative if needed.
temperature
double
YES
type
int unsigned
NO
1 = Regular, 2 = Special Count.
modified_user_id
int
NO
FOREIGN KEY
auth_user(id)
sheet_ingredient_id
int
NO
FOREIGN KEY
production_sheets_sheetingredient(id)
date_modified_local
datetime
NO
date_modified
datetime
NO
parent_entry_id
int
YES
FOREIGN KEY
production_sheets_sheetentry(id)
Id of the same table.
production_sheets_sheetingredient
Represents an ingredient row in a production sheet.
The same ingredient can't be associated twice to the same production sheet.
When a new production sheet gets created via a POST call, sheet templates that are applicable for that day will end up being copied over into sheet ingredients.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
date_created
datetime
NO
date_modified
datetime
NO
modified_local_username
varchar(20)
NO
recommended_amount_to_make
double
YES
modified_user_id
int
NO
FOREIGN KEY
auth_user(id)
parent_sheet_ingredient_id
int
YES
FOREIGN KEY
production_sheets_sheetingredient(id)
sheet_id
int
NO
FOREIGN KEY, UNIQUE
production_sheets_sheet(id)
unit_of_measure_id
int
NO
FOREIGN KEY
ingredients_unitofmeasure(id)
expiration_unit
varchar(11)
YES
expiration_value
int
YES
ingredient_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_ingredient(id)
production_sheets_sheettemplate
A production sheet template ingredient.
When a production sheet is created, its ingredients' units of measure and recommended makes are defined by this blueprint, which is unique per location and can create subsequent production sheet ingredients using the same template ingredient.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
date_created
datetime
NO
date_modified
datetime
NO
day_of_week
int
NO
UNIQUE
Day of the week(0 - 6), 0 = Monday
is_active
tinyint(1)
NO
modified_local_username
varchar(20)
NO
recommended_amount_to_make
double
YES
modified_user_id
int
NO
FOREIGN KEY
auth_user(id)
unit_of_measure_id
int
NO
FOREIGN KEY
ingredients_unitofmeasure(id)
ingredient_id
int
NO
FOREIGN KEY, UNIQUE
ingredients_ingredient(id)
location_id
int
NO
FOREIGN KEY, UNIQUE
locations_location(id)
projects_crosscompanyproject
Table that lists brand-wide projects. These projects are shared to a company based on hierarchy and can be distributed based on additional criteria.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
title
varchar(255)
NO
description
mediumtext
YES
date_created
datetime
NO
date_modified
datetime
NO
is_active
tinyint(1)
NO
States whether the project is active/has not been archived.
create_tasks_data
mediumtext
YES
frequency
int
YES
Yearly, Monthly, Weekly, Daily.
is_auto_archive
tinyint(1)
NO
Archive this project, if true, when date_due has passed. Does nothing for recurring project, its ending date is handled by the recurring.
date_start_local
datetime
YES
Only included on project instance with tasks (one-off or child instance) Datetime of when the tasks should start regardless of timezone.raw sql will need to reference date_due_utc.
date_due_local
datetime
YES
Only included on project instance with tasks (one-off or child instance) Datetime of when the tasks should be due regardless of timezone.raw sql will need to reference date_due_utc.
allow_any_user_fulfill
tinyint(1)
NO
deleted
tinyint(1)
NO
date_deleted
datetime
YES
date_archived
datetime
YES
archived_user_id
int
YES
FOREIGN KEY
auth_user(id)
company_id
int
NO
FOREIGN KEY
users_company(id)
create_tasks_form_template_id
int
YES
FOREIGN KEY
forms_formtemplate(id)
create_tasks_reply_type_id
smallint unsigned
YES
FOREIGN KEY
tasks_replytype(id)
Task reply type is used to create bulk tasks for recurring child.
create_tasks_user_role_id
int
YES
FOREIGN KEY
users_userrole(id)
This is the user role to create bulk tasks for recurring child.
created_user_id
int
NO
FOREIGN KEY
auth_user(id)
deleted_user_id
int
YES
FOREIGN KEY
auth_user(id)
recurring_data
json
YES
create_tasks_location_attributes
json
YES
Holds data for how to filter project locations based on location attributes.
create_tasks_location_calendar_events
json
YES
Stores the data to set project's tasks start and due dates using location calendar events.
project_type
varchar(255)
NO
The project type, it can be Location or User.
is_propagated
tinyint(1)
NO
projects_follower
Table that lists the users that are subscribed as report recipients for a specific project.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
project_id
int unsigned
NO
FOREIGN KEY, UNIQUE
projects_project(id)
user_id
int
NO
FOREIGN KEY, UNIQUE
auth_user(id)
The user who is added to receive a report on the project.
projects_project
Table that lists projects within a single company.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
title
varchar(255)
NO
description
mediumtext
YES
date_created
datetime
NO
date_modified
datetime
NO
date_due
datetime
YES
Only included on project instance with tasks (one-off or child instance), the max(tasks.date_due) for tasks generated by the project.
is_active
tinyint(1)
NO
States whether the project is active or archived. An archived project will have is_active=0. If a project has been deleted, the project's is_active field will still be 1. is_active=1 and deleted=1 are perfectly valid in our system.
create_tasks_data
mediumtext
YES
This is json representation of how to create the child projects (if recurring), or how this project was created.
is_auto_archive
tinyint(1)
NO
Archive this project, if true, when date_due has passed. Does nothing for recurring project, its ending date is handled by the recurring.
date_start_utc
datetime
YES
date_due_utc
datetime
YES
date_start
datetime
YES
Only included on project instance with tasks (one-off or child instance)Datetime of when the tasks should start regardless of timezone.raw sql will need to reference date_due_utc.
allow_any_user_fulfill
tinyint(1)
NO
company_id
int
NO
FOREIGN KEY
users_company(id)
create_tasks_team_id
int
YES
FOREIGN KEY
users_team(id)
This is the team to assign created tasks to.
create_tasks_user_role_id
int
YES
FOREIGN KEY
users_userrole(id)
This is the user role to assign created tasks to.
created_user_id
int
NO
FOREIGN KEY
auth_user(id)
parent_project_id
int unsigned
YES
FOREIGN KEY
projects_project(id)
Id of the same table.
recurring_id
int unsigned
YES
FOREIGN KEY, UNIQUE
schedules_recurring(id)
Link to the schedule recurring item for this project. This holds how often to create a new project.
is_future_project
tinyint(1)
NO
This states that the project was setup to run in the future.
archived_user_id
int
YES
FOREIGN KEY
auth_user(id)
date_archived
datetime
YES
date_deleted
datetime
YES
deleted
tinyint(1)
NO
If True then the project was deleted do not show it, report on it, etc. Unlike archived projects, deleted projects are not recoverable from the UI.
deleted_user_id
int
YES
FOREIGN KEY
auth_user(id)
create_tasks_form_template_id
int
YES
FOREIGN KEY
forms_formtemplate(id)
create_tasks_reply_type_id
smallint unsigned
YES
FOREIGN KEY
tasks_replytype(id)
Task reply type is used to create bulk tasks for recurring child.
frequency
int
YES
0 - YEARLY, 1 - MONTHLY, 2 - WEEKLY, 3 - DAILY
project_type
varchar(255)
NO
The project type, it can be Location or User.
create_tasks_location_attributes
json
YES
Holds data for how to filter project locations based on location attributes.
create_tasks_location_calendar_events
json
YES
Stores the data to set project's tasks start and due dates using location calendar events.
projects_project_create_tasks_location_attributes
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
project_id
int unsigned
NO
FOREIGN KEY, UNIQUE
projects_project(id)
attribute_id
int
NO
FOREIGN KEY, UNIQUE
locations_attribute(id)
projects_project_create_tasks_locations
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
project_id
int unsigned
NO
FOREIGN KEY, UNIQUE
projects_project(id)
location_id
int
NO
FOREIGN KEY, UNIQUE
locations_location(id)
projects_project_create_tasks_users
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
project_id
int unsigned
NO
FOREIGN KEY, UNIQUE
projects_project(id)
user_id
int
NO
FOREIGN KEY, UNIQUE
auth_user(id)
projects_sharedproject
Many-to-many table that lists the who, what, where and when details of a shared project.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
date_created
datetime
YES
date_modified
datetime
YES
date_copied
datetime
YES
copying_user_id
int
NO
FOREIGN KEY
auth_user(id)
crosscompany_project_id
int
NO
FOREIGN KEY, UNIQUE
projects_crosscompanyproject(id)
ID of the cross company project that is being shared.
target_project_id
int unsigned
NO
FOREIGN KEY
projects_project(id)
ID of the shared project.
target_company_id
int
YES
FOREIGN KEY, UNIQUE
users_company(id)
ID of the target company.
reports_savedreport
Table that lists saved reports. This will eventually replace saved search and migration from saved search to saved report is ongoing.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
title
varchar(255)
NO
is_active
tinyint(1)
NO
report_type
varchar(255)
NO
Choices are User Project Completion Recap and User Project with Failures.
configuration
json
NO
recipients_criteria
json
NO
is_brandwide
tinyint(1)
NO
send_to_franchisee
tinyint(1)
NO
use_recipient_visibility
tinyint(1)
NO
date_created
datetime
YES
date_updated
datetime
YES
company_id
int
NO
FOREIGN KEY
users_company(id)
created_user_id
int
NO
FOREIGN KEY
auth_user(id)
recurring_id
int unsigned
YES
FOREIGN KEY, UNIQUE
schedules_recurring(id)
updated_user_id
int
YES
FOREIGN KEY
auth_user(id)
rules_action
What should occur after a rule matches. Saves denormalized information about action configuration in data. This data should be normalized in the associated action tables.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
order
smallint unsigned
YES
Sequence of actions.
is_active
tinyint(1)
NO
data
longtext
NO
action_subtype_id
smallint unsigned
NO
FOREIGN KEY
rules_actionsubtype(id)
action_type_id
tinyint unsigned
NO
FOREIGN KEY
rules_actiontype(id)
rule_id
int unsigned
NO
FOREIGN KEY
rules_rule(id)
rules_actionnotificationuser
Tables that connect actions and users.
Column
Type
Nullable
Constraint
References
Comment
action_id
int unsigned
NO
FOREIGN KEY, PRIMARY KEY
rules_action(id)
user_id
int
NO
FOREIGN KEY
auth_user(id)
rules_actionnotificationuserrolelocation
Tables that connect actions and user roles.
Column
Type
Nullable
Constraint
References
Comment
action_id
int unsigned
NO
FOREIGN KEY, PRIMARY KEY
rules_action(id)
user_role_id
int
NO
FOREIGN KEY
users_userrole(id)
rules_actionsubtype
Tables that list action subtypes.
Column
Type
Nullable
Constraint
References
Comment
id
smallint unsigned
NO
PRIMARY KEY
name
varchar(50)
NO
UNIQUE
action_type_id
tinyint unsigned
NO
FOREIGN KEY, UNIQUE
rules_actiontype(id)
rules_actiontaskassigneeuser
Tables that connect action tasks and assignee users.
Column
Type
Nullable
Constraint
References
Comment
action_id
int unsigned
NO
FOREIGN KEY, PRIMARY KEY
rules_action(id)
user_id
int
NO
FOREIGN KEY
auth_user(id)
rules_actiontaskassigneeuserrole
Tables that connect action tasks and a user role id.
Column
Type
Nullable
Constraint
References
Comment
action_id
int unsigned
NO
FOREIGN KEY, PRIMARY KEY
rules_action(id)
user_role_id
int
NO
FOREIGN KEY
users_userrole(id)
rules_actiontaskdurationdue
Tables that list action tasks, duration due.
Column
Type
Nullable
Constraint
References
Comment
action_id
int unsigned
NO
FOREIGN KEY, PRIMARY KEY
rules_action(id)
duration_type
varchar(6)
NO
duration_value
smallint unsigned
NO
rules_actiontaskreplyformtemplate
Tables that connect action tasks replies and form templates.
Column
Type
Nullable
Constraint
References
Comment
action_id
int unsigned
NO
FOREIGN KEY, PRIMARY KEY
rules_action(id)
form_template_id
int
NO
FOREIGN KEY
forms_formtemplate(id)
rules_actiontaskreplytype
Tables that connect action tasks replies and task reply types.
Column
Type
Nullable
Constraint
References
Comment
action_id
int unsigned
NO
FOREIGN KEY, PRIMARY KEY
rules_action(id)
task_reply_type_id
smallint unsigned
YES
FOREIGN KEY
tasks_replytype(id)
rules_actiontaskreporteruser
Tables that connect action tasks and report users.
Column
Type
Nullable
Constraint
References
Comment
action_id
int unsigned
NO
FOREIGN KEY, PRIMARY KEY
rules_action(id)
user_id
int
NO
FOREIGN KEY
auth_user(id)
rules_actiontype
Table that lists rules action types.
Column
Type
Nullable
Constraint
References
Comment
id
tinyint unsigned
NO
PRIMARY KEY
name
varchar(50)
NO
UNIQUE
rules_condition
Holds a reference to the saved search in the data, not doing much.
Condition_type for form submissions is always the same. Sensors has 2 other condition types.
Sensor conditions can have multiple conditions. All form template conditions have order 1 (not multiple).
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
order
smallint unsigned
YES
data
longtext
NO
A reference to the saved search.
condition_type_id
smallint unsigned
NO
FOREIGN KEY
rules_conditiontype(id)
rule_id
int unsigned
NO
FOREIGN KEY
rules_rule(id)
rules_conditiontype
Table that lists rules condition types.
Column
Type
Nullable
Constraint
References
Comment
id
smallint unsigned
NO
PRIMARY KEY
name
varchar(50)
NO
UNIQUE
rules_formtemplate
Table that connects rules and form templates.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
form_template_id
int
NO
FOREIGN KEY, UNIQUE
forms_formtemplate(id)
rule_id
int unsigned
NO
FOREIGN KEY, UNIQUE
rules_rule(id)
rules_priority
Table that lists rule priorities.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
name
varchar(55)
NO
UNIQUE
rules_rule
Main coordinating model for our product level triggers.
When X (almost always submission creation) occurs, do Y (Action).
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
title
varchar(255)
NO
is_system
tinyint(1)
NO
System rules are not visible to end user and/or knowingly created to the user.
is_active
tinyint(1)
NO
date_created
datetime
NO
date_updated
datetime
NO
data
longtext
NO
last_event_datetime
datetime
YES
company_id
int
YES
FOREIGN KEY
users_company(id)
created_user_id
int
NO
FOREIGN KEY
auth_user(id)
is_enabled
tinyint(1)
NO
rules_rulepriority
Table that connects rules and priorities.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
priority_id
int unsigned
NO
FOREIGN KEY
rules_priority(id)
rule_id
int unsigned
NO
FOREIGN KEY
rules_rule(id)
rules_savedsearch
Table that connects rules saved search.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
condition_id
int unsigned
YES
FOREIGN KEY, UNIQUE
rules_condition(id)
rule_id
int unsigned
NO
FOREIGN KEY, UNIQUE
rules_rule(id)
saved_search_id
int unsigned
NO
FOREIGN KEY, UNIQUE
users_savedsearch(id)
rules_trigger
Stores the type of triggering input or model creation that the rule runs on. This table is almost entirely submission creation.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
rule_id
int unsigned
NO
FOREIGN KEY, UNIQUE
rules_rule(id)
trigger_subtype_id
smallint unsigned
NO
FOREIGN KEY, UNIQUE
rules_triggersubtype(id)
trigger_type_id
tinyint unsigned
NO
FOREIGN KEY, UNIQUE
rules_triggertype(id)
rules_triggersubtype
Table that lists trigger subtypes.
Column
Type
Nullable
Constraint
References
Comment
id
smallint unsigned
NO
PRIMARY KEY
name
varchar(50)
NO
UNIQUE
trigger_type_id
tinyint unsigned
NO
FOREIGN KEY, UNIQUE
rules_triggertype(id)
rules_triggertype
Table that lists trigger types.
Column
Type
Nullable
Constraint
References
Comment
id
tinyint unsigned
NO
PRIMARY KEY
name
varchar(50)
NO
UNIQUE
sensors_cooldown
Represents the cooldown object.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
is_active
tinyint(1)
NO
status
varchar(100)
NO
field for the current state of the cool down process, values are: in_progress, failed, success
is_archived
tinyint(1)
NO
date_modified
datetime
YES
date_created
datetime
YES
date_started
datetime
YES
date_ended
datetime
YES
name
varchar(100)
NO
food
varchar(100)
NO
location_id
int
NO
FOREIGN KEY
locations_location(id)
company_id
int
NO
FOREIGN KEY
users_company(id)
created_user_id
int
NO
FOREIGN KEY
auth_user(id)
rule_id
int unsigned
NO
FOREIGN KEY
rules_rule(id)
sensor_id
int
NO
FOREIGN KEY
sensors_sensor(id)
task_id
int unsigned
YES
FOREIGN KEY, UNIQUE
tasks_task(id)
sensors_cooldownsattributee
Represents the cooldown stage.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
status
varchar(100)
YES
field for the current state of the cool down stage.
date_processed
datetime
YES
date_reading
datetime
YES
is_active
tinyint(1)
NO
reading_ending
double
NO
sensor_reading
double
YES
operator_id
varchar(100)
NO
Less than or less than or equal
cooldown_id
int
NO
FOREIGN KEY
sensors_cooldown(id)
reading_starting
double
NO
seconds_from_start
int
NO
sattributee_identifier
varchar(100)
YES
Initial, middle, final.
reading_method
varchar(100)
YES
Field to identify the origin of the sensor reading, manual, probe, sensor.
sensors_critical_notification_setting
Class to hold sensor critical notification settings.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
delivery_type_id
smallint unsigned
NO
FOREIGN KEY
users_usernotificationsettingdeliverytype(id)
Delivery type id, email, push, SMS, etc.
user_id
int
NO
FOREIGN KEY, UNIQUE
auth_user(id)
sensors_devicestatus
This model is used to track the current status of a sensor or gateway and the time when its status changed the most current record represents the current state of the device.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
date_created
datetime
NO
is_online
tinyint(1)
NO
gateway_id
int
YES
FOREIGN KEY
sensors_gateway(id)
sensor_id
int
YES
FOREIGN KEY
sensors_sensor(id)
sensors_gateway
Represents the gateway object.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
external_key
varchar(100)
NO
When an user registers a new sensor using the mobile app we ask for an id that usually is in a label in the device.
secondary_key
varchar(100)
NO
For Monnit sensors, the ID and SC number are saved using the fields external_key and secondary_key. These two columns together identify whether a sensor already exists in the database
name
varchar(100)
NO
A descriptive name for this gateway.
battery_level
int
YES
The approximate battery level, [0, 100].
is_online
tinyint(1)
NO
is_active
tinyint(1)
NO
date_modified
datetime
YES
date_created
datetime
YES
gateway_type
varchar(100)
NO
An english product name string representing the type of gateway.
location_id
int
YES
FOREIGN KEY
locations_location(id)
company_id
int
YES
FOREIGN KEY
users_company(id)
created_user_id
int
YES
FOREIGN KEY
auth_user(id)
integration_id
int
YES
FOREIGN KEY
sensors_integration(id)
is_enabled
tinyint(1)
NO
manufacturer
varchar(100)
YES
The manufacturer name to use. For example: "monnit", "laird"
last_active_date
datetime
YES
sensors_gatewaybreach
Represents table gateway breach model.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
date_created
datetime
NO
date_updated
datetime
NO
date_closed
datetime
YES
company_id
int
NO
FOREIGN KEY
users_company(id)
gateway_id
int
NO
FOREIGN KEY
sensors_gateway(id)
rule_id
int unsigned
NO
FOREIGN KEY
rules_rule(id)
trigger_subtype_id
smallint unsigned
NO
FOREIGN KEY
rules_triggersubtype(id)
date_opened
datetime
NO
sensors_gatewaybreach_notifications
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
gatewaybreach_id
int unsigned
NO
FOREIGN KEY, UNIQUE
sensors_gatewaybreach(id)
notification_id
int unsigned
NO
FOREIGN KEY, UNIQUE
notifications_notification_new(id)
sensors_gatewaybreach_tasks
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
gatewaybreach_id
int unsigned
NO
FOREIGN KEY, UNIQUE
sensors_gatewaybreach(id)
task_id
int unsigned
NO
FOREIGN KEY, UNIQUE
tasks_task(id)
sensors_integration
A single integration between a company and an integration provider.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
integration_type
varchar(50)
NO
TempAlert, Monnit, BluV2, The Things Industries, Senet Digi, MachineQ.
client_id
varchar(75)
YES
client_secret
varchar(75)
YES
is_active
tinyint(1)
NO
date_modified
datetime
YES
date_created
datetime
YES
company_id
int
NO
FOREIGN KEY
users_company(id)
client_location_id
varchar(75)
YES
UNIQUE
sensors_integration_locations
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
integration_id
int
NO
FOREIGN KEY, UNIQUE
sensors_integration(id)
location_id
int
NO
FOREIGN KEY, UNIQUE
locations_location(id)
sensors_rulemetadata
Table that lists sensor rule metadata.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
is_default
tinyint(1)
NO
rule_id
int unsigned
NO
FOREIGN KEY
rules_rule(id)
sensors_sensor
Represents a single physical sensor. This sensor may be part of a larger device like with multiple reading ports on a TempAlert device.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
external_key
varchar(100)
NO
secondary_key
varchar(100)
NO
name
varchar(100)
NO
is_active
tinyint(1)
NO
date_modified
datetime
YES
date_created
datetime
YES
location_id
int
YES
FOREIGN KEY
locations_location(id)
company_id
int
NO
FOREIGN KEY
users_company(id)
integration_id
int
NO
FOREIGN KEY
sensors_integration(id)
last_reading_value
double
YES
last_reading_date
datetime
YES
placement_id
int
NO
FOREIGN KEY
sensors_sensorplacement(id)
battery
int
YES
is_online
tinyint(1)
NO
is_enabled
tinyint(1)
NO
join_key
varchar(100)
NO
created_user_id
int
YES
FOREIGN KEY
auth_user(id)
manufacturer
varchar(100)
YES
equipment_location_id
bigint
YES
FOREIGN KEY
equipment_equipmentlocation(id)
is_configured
tinyint(1)
NO
sensors_sensorbreach
This model represents a sensor breaching a trigger rule. It tracks the tasks and notifications created during a breach.
A breach will be close when a sensor returns to an acceptable state which can be a normal temperature, online status or normal battery level.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
date_created
datetime
NO
date_updated
datetime
NO
date_closed
datetime
YES
company_id
int
NO
FOREIGN KEY
users_company(id)
rule_id
int unsigned
NO
FOREIGN KEY
rules_rule(id)
sensor_id
int
NO
FOREIGN KEY
sensors_sensor(id)
trigger_subtype_id
smallint unsigned
NO
FOREIGN KEY
rules_triggersubtype(id)
date_opened
datetime
NO
sensors_sensorbreach_notifications
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
sensorbreach_id
int unsigned
NO
FOREIGN KEY, UNIQUE
sensors_sensorbreach(id)
notification_id
int unsigned
NO
FOREIGN KEY, UNIQUE
notifications_notification_new(id)
sensors_sensorbreach_tasks
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
sensorbreach_id
int unsigned
NO
FOREIGN KEY, UNIQUE
sensors_sensorbreach(id)
task_id
int unsigned
NO
FOREIGN KEY, UNIQUE
tasks_task(id)
sensors_sensorplacement
The various generalized places a sensor might be placed at a physical location.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
name
varchar(50)
NO
UNIQUE
A generalized location some hardware sensor might be placed within the physical location. For example, "Walk-in Cooler"
company_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
date_created
datetime
YES
date_modified
datetime
YES
uses_simulated_temperature
tinyint(1)
NO
sensors_sensorplacementnickname
Nicknames that can be used by a placement to automatically name sensors.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
name
varchar(50)
NO
UNIQUE
Assigning nicknames change the naming system for new sensors in this placement. Existing sensors retain their custom names set by end users.
date_modified
datetime
YES
date_created
datetime
YES
placement_id
int
NO
FOREIGN KEY, UNIQUE
sensors_sensorplacement(id)
tasks_follower
Table that connects tasks and users.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
task_id
int unsigned
NO
FOREIGN KEY, UNIQUE
tasks_task(id)
user_id
int
NO
FOREIGN KEY, UNIQUE
auth_user(id)
tasks_replyformtemplate
Many-to-many table that connects tasks and form_templates.
Id of the location attribute that has all locations for the company.
all_team_id
int
YES
FOREIGN KEY
users_team(id)
A system-created team that includes all user-created teams under it.
brand_id
int
YES
FOREIGN KEY
users_companybrand(id)
industry_id
int
YES
FOREIGN KEY
users_companyindustry(id)
Id of the associated users_companyindustry.
date_format
varchar(50)
YES
distance_unit
varchar(50)
YES
temperature_unit
varchar(50)
YES
time_format
varchar(50)
YES
users_country
Available country codes.
Column
Type
Nullable
Constraint
References
Comment
alpha_2
varchar(2)
NO
PRIMARY KEY
name
varchar(255)
NO
UNIQUE
alpha_3
varchar(3)
NO
users_team
This table holds the different groupings of users for distributing form templates to. This table also tracks how the teams relate to each other in a hierarchy.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
name
varchar(60)
NO
description
varchar(255)
NO
is_private
tinyint(1)
NO
is_active
tinyint(1)
NO
is_editable
tinyint(1)
NO
parent_team_id
int
YES
FOREIGN KEY
users_team(id)
lft
int unsigned
YES
Left tree level.
rgt
int
YES
Right tree level.
external_key
varchar(255)
YES
UNIQUE
company_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
created_user_id
int
YES
FOREIGN KEY
auth_user(id)
users_team_locations
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
team_id
int
NO
FOREIGN KEY, UNIQUE
users_team(id)
location_id
int
NO
FOREIGN KEY, UNIQUE
locations_location(id)
users_teamuser
Many to many through table relating users_distributegroup to auth_user.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
team_id
int
NO
FOREIGN KEY, UNIQUE
users_team(id)
user_id
int
NO
FOREIGN KEY, UNIQUE
auth_user(id)
users_savedsearch
A saved search which can be used to create reports.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
name
varchar(255)
NO
data
longtext
NO
is_active
tinyint(1)
NO
date_created
datetime
NO
date_modified
datetime
NO
company_id
int
NO
FOREIGN KEY
users_company(id)
created_user_id
int
NO
FOREIGN KEY
auth_user(id)
modified_user_id
int
NO
FOREIGN KEY
auth_user(id)
recurring_id
int unsigned
YES
FOREIGN KEY
schedules_recurring(id)
rule_id
int unsigned
YES
FOREIGN KEY
rules_rule(id)
saved_search_type_id
smallint unsigned
NO
FOREIGN KEY
users_savedsearchtype(id)
users_savedsearchtype
The saved search type of that Zenput creates, ie. form_template_submissions.
Column
Type
Nullable
Constraint
References
Comment
id
smallint unsigned
NO
PRIMARY KEY
title
varchar(50)
NO
UNIQUE
abbreviation
varchar(5)
NO
UNIQUE
users_savedsearchusage
Many to many through table relating saved searches and search usage types.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
saved_search_id
int unsigned
NO
FOREIGN KEY, UNIQUE
users_savedsearch(id)
search_usage_type_id
smallint unsigned
NO
FOREIGN KEY, UNIQUE
users_searchusagetype(id)
users_searchusagetype
Search usage types.
Column
Type
Nullable
Constraint
References
Comment
id
smallint unsigned
NO
PRIMARY KEY
name
varchar(50)
NO
users_sharedsavedsearch
Saved searches that are shared with reporting companies.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
date_created
datetime
YES
date_modified
datetime
YES
date_copied
datetime
YES
copying_user_id
int
NO
FOREIGN KEY
auth_user(id)
source_saved_search_id
int unsigned
NO
FOREIGN KEY, UNIQUE
users_savedsearch(id)
target_saved_search_id
int unsigned
NO
FOREIGN KEY
users_savedsearch(id)
target_company_id
int
YES
FOREIGN KEY, UNIQUE
users_company(id)
users_usernotificationsetting
Holds user notification settings.
Column
Type
Nullable
Constraint
References
Comment
id
int unsigned
NO
PRIMARY KEY
delivery_type_id
smallint unsigned
NO
FOREIGN KEY
users_usernotificationsettingdeliverytype(id)
trigger_subtype_id
smallint unsigned
NO
FOREIGN KEY, UNIQUE
rules_triggersubtype(id)
trigger_type_id
tinyint unsigned
NO
FOREIGN KEY, UNIQUE
rules_triggertype(id)
user_id
int
NO
FOREIGN KEY, UNIQUE
auth_user(id)
users_usernotificationsettingdeliverytype
The methods available for sending a notification to someone. Includes email, push, SMS, etc.
Column
Type
Nullable
Constraint
References
Comment
id
smallint unsigned
NO
PRIMARY KEY
name
varchar(50)
NO
UNIQUE
users_userprofile
Additional user information. 1 to 1 with the users_user table.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
display_name
varchar(60)
YES
date_invited
datetime
YES
date_redeemed
datetime
YES
date_deactivated
datetime
YES
time_zone
varchar(40)
NO
locale
varchar(5)
NO
The users preferred locale for the UI display in `ISO-639 Language Codes_ISO-3166 Country Codes', defaults en-US.
company_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
default_dashboard_id
int unsigned
YES
FOREIGN KEY
dashboards_dashboard(id)
If set, this is the default dashboard the user will see when going to the dashboard page.
default_team_id
int
YES
FOREIGN KEY
users_team(id)
Default team for the user when displaying pages.
user_id
int
NO
FOREIGN KEY, UNIQUE
auth_user(id)
user_role_id
int
YES
FOREIGN KEY
users_userrole(id)
external_key
varchar(50)
YES
UNIQUE
temperature_unit
varchar(1)
YES
users_userrole
Custom user roles.
Column
Type
Nullable
Constraint
References
Comment
id
int
NO
PRIMARY KEY
name
varchar(255)
NO
UNIQUE
is_active
tinyint(1)
NO
company_id
int
NO
FOREIGN KEY, UNIQUE
users_company(id)
default_permission_id
int
NO
FOREIGN KEY
auth_group(id)
users_userrolehierarchy
Hierarchical company user roles using nested set pattern.