Data Dictionary: 2026-01-15

Data Dictionary: 2026-01-15 19:16:06

activities_activity

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.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEYusers_company(id)What company is the user associated with.
created_user_idintNOFOREIGN KEYauth_user(id)Who created the activity record.
date_createddatetimeYESDate activity was created.
date_modifieddatetimeYESMost recent modification date (defaults to created date).
form_template_idintNOFOREIGN KEYforms_formtemplate(id)What form template is associated with this activity.
idint unsignedNOPRIMARY KEYIdentifier
is_activetinyint(1)NOIs the form active (1) or archived (0).
is_securetinyint(1)NOIs the checkbox “Make this form private” selected in permission on form’s configure tab.
namemediumtextNOName of activity, automatically created from form template name.
permit_brandwide_submission_accesstinyint(1)NOTrue if activity permissions allow for brand wide submissions and form is configured to allow users to view submission data from all franchisees.
template_category_idintNOFOREIGN KEYforms_formtemplatecategory(id)Default is uncategorized, associates an activity with a template category.

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.

ColumnTypeNullableConstraintReferencesComment
activity_idint unsignedNOFOREIGN KEY, UNIQUEactivities_activity(id)What is the activity id associated with this activity field. Unique_together with field_id.
field_idint unsignedNOFOREIGN KEY, UNIQUEfields_field(id)What is the field id associated with this activity field. Unique_together with activity_id.
idint unsignedNOPRIMARY KEY
is_activetinyint(1)NOIs the activity active (1) or archived (0)

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.

ColumnTypeNullableConstraintReferencesComment
activity_idint unsignedNOFOREIGN KEYactivities_activity(id)The activity is associated with this template.
datajsonNOjson of all fields including how fields should be shown and how they interact with each other.
date_createddatetimeYESWhen was the activity template created.
date_modifieddatetimeYESWhen was the activity template last modified.
idint unsignedNOPRIMARY KEYIdentifier (saved changes to the builder results in an update to the activity template and the new version being upgraded to the primary activity template).
is_activetinyint(1)NOIf this has been deleted, then is_active is set to False.
is_primarytinyint(1)NOIs this the primary version that is in use now – most recent version desired to be filled out by customers.
namemediumtextNOComes from the name of the form.

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.

ColumnTypeNullableConstraintReferencesComment
activity_template_idint unsignedNOFOREIGN KEY, UNIQUEactivities_activitytemplate(id)
date_createddatetimeYESDate it was created.
date_modifieddatetimeYESDate it was last modified.
field_orderjsonNOjson with the order of the fields. List of activity field ids.
idint unsignedNOPRIMARY KEY
location_idintNOFOREIGN KEY, UNIQUElocations_location(id)
modified_user_idintNOFOREIGN KEYauth_user(id)

activities_sharedactivity

Keeps track of the shared activity between one company and another, along with some extra information relevant to sharing.

ColumnTypeNullableConstraintReferencesComment
copying_user_idintNOFOREIGN KEYauth_user(id)Who shared the form.
date_copieddatetimeYESDate it was copied.
date_createddatetimeYESDate it was created.
date_modifieddatetimeYESDate it was last modified.
idint unsignedNOPRIMARY KEY
source_activity_idint unsignedNOFOREIGN KEY, UNIQUEactivities_activity(id)What is the activity id associated with the original activity. Unique_together with target_company_id.
target_activity_idint unsignedNOFOREIGN KEYactivities_activity(id)What is the id associated with the newly created activity.
target_company_idintYESFOREIGN KEY, UNIQUEusers_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.

ColumnTypeDescription
_idObjectId(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{'created_by': {'id': 'int', 'display_name': 'First Last'}, 'company': {'id': 'int'}, 'user_role': {'id': 'int', 'name': 'Example Role'}, 'distribute_groups': [{'id': 'int'}], 'user_distribute_groups': [], 'account_distribute_groups': [], 'time_zone': 'America/New_York', 'client_time_zone': 'Pacific/Rarotonga', 'user_agent': 'string', 'platform': 'unknown', 'guid': 'string', 'environment': 'web', 'date_created': 'ISODate("date string")', 'date_completed': 'ISODate("date string")', 'date_submitted': 'ISODate("date string")', 'date_modified': 'ISODate("date string")', 'date_created_local': 'ISODate("date string")', 'date_completed_local': 'ISODate("date string")', 'date_submitted_local': 'ISODate("date string")', 'time_to_complete': 'int', 'distance_to_account': None, 'lat': None, 'lon': None, 'is_audit': <class 'bool'>, 'task': {'id': 'int', 'title': 'Example title', 'account_id': 'int'}, 'project': {'id': 'int', 'title': 'Example Project Name'}, 'account': {'id': 'int', 'name': 'Example location name', 'tags': [{'id': 'int', 'name': 'example attribute'}]}, 'follow_up_actions': 'List'}Metadata properties of the submission. Contains useful data that is not actually part of the submission form answers.
legacy_submission_idStringUsed to associate a submission to a form_submission.
deletedBooleanIndicates if the submission has been deleted.

announcements_announcement

The table that lists announcements.

ColumnTypeNullableConstraintReferencesComment
attachmentsjsonYES
company_idintNOFOREIGN KEYusers_company(id)
created_user_idintNOFOREIGN KEYauth_user(id)
date_createddatetimeYES
date_modifieddatetimeYES
date_scheduleddatetimeYES
idint unsignedNOPRIMARY KEY
is_activetinyint(1)NO
is_editabletinyint(1)NOIs this announcement editable, true only while the announcement is not yet live.
location_attributesjsonYES
messagemediumtextYES
queue_item_idint unsignedYESFOREIGN KEYschedules_queue(id)
scopevarchar(255)NOBrand or Company
titlemediumtextYES

announcements_announcement_teams

ColumnTypeNullableConstraintReferencesComment
announcement_idint unsignedNOFOREIGN KEY, UNIQUEannouncements_announcement(id)
team_idintNOFOREIGN KEY, UNIQUEusers_teams(id)
idintNOPRIMARY KEY

announcements_announcement_user_roles

Table that connects announcements and user roles.

ColumnTypeNullableConstraintReferencesComment
announcement_idint unsignedNOFOREIGN KEY, UNIQUEannouncements_announcement(id)Announcement id
idintNOPRIMARY KEYIdentifier
userrole_idintNOFOREIGN KEY, UNIQUEusers_userrole(id)User role id

announcements_announcement_users

Table that connects announcements and users.

ColumnTypeNullableConstraintReferencesComment
announcement_idint unsignedNOFOREIGN KEY, UNIQUEannouncements_announcement(id)Announcement id
idintNOPRIMARY KEYIdentifier
user_idintNOFOREIGN KEY, UNIQUEauth_user(id)User id

announcements_bannerannouncement

Announcements which show up in the mobile banner.

ColumnTypeNullableConstraintReferencesComment
announcement_idint unsignedNOFOREIGN KEY, UNIQUEannouncements_announcement(id)
date_enddatetimeNO
date_stoppeddatetimeYES
idint unsignedNOPRIMARY KEY
statusvarchar(50)NOOptions: Scheduled, Live, Ended, Stopped, Deleted
stopped_user_idintYESFOREIGN KEYauth_user(id)

auth_permissiongroup

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEY
namevarchar(150)NOUNIQUE

auth_user

Basic user information

ColumnTypeNullableConstraintReferencesComment
date_joineddatetimeNODate created
emailvarchar(100)NOEmail
first_namevarchar(150)NOFirst name
idintNOPRIMARY KEYIdentifier
is_activetinyint(1)NOWhether the user is deleted or not
last_logindatetimeYESDate of last login
last_namevarchar(150)NOFirst name
usernamevarchar(150)NOUNIQUEUsername

auth_user_groups

Relates users to an auth_group.

ColumnTypeNullableConstraintReferencesComment
group_idintNOFOREIGN KEY, UNIQUEauth_permissiongroup(id)associated user group id
idintNOPRIMARY KEYIdentifier
user_idintNOFOREIGN KEY, UNIQUEauth_user(id)Associated user id

comments_comment

Describes the list of comments. Comments can be made on submissions and tasks.

ColumnTypeNullableConstraintReferencesComment
created_user_idintNOFOREIGN KEYauth_user(id)
date_createddatetimeNO
date_modifieddatetimeNO
idint unsignedNOPRIMARY KEY
is_activetinyint(1)NO
messagevarchar(3000)YES
topic_idint unsignedNOFOREIGN KEYcomments_topic(id)

comments_submission

Table that connects comments and form submissions.

ColumnTypeNullableConstraintReferencesComment
comment_idint unsignedNOFOREIGN KEYcomments_comment(id)
idint unsignedNOPRIMARY KEY
is_tagtinyint(1)NO
submission_idchar(24)NOFOREIGN KEYforms_submission(id)Submission Id in MongoDB.

comments_task

Table that connects comments and tasks.

ColumnTypeNullableConstraintReferencesComment
comment_idint unsignedNOFOREIGN KEYcomments_comment(id)
idint unsignedNOPRIMARY KEY
is_tagtinyint(1)NO
task_idint unsignedNOFOREIGN KEYtasks_task(id)

comments_topic

Table that connects comments and topics. Used for connecting comments and triggers.

ColumnTypeNullableConstraintReferencesComment
idint unsignedNOPRIMARY KEY
trigger_subtype_idsmallint unsignedNOFOREIGN KEYrules_triggersubtype(id)
trigger_type_idtinyint unsignedNOFOREIGN KEYrules_triggertype(id)

comments_topicsubscriber

Table that connects comments and topics per user.

ColumnTypeNullableConstraintReferencesComment
date_createddatetimeNO
date_last_readdatetimeNO
date_subscribeddatetimeNO
idint unsignedNOPRIMARY KEY
topic_idint unsignedNOFOREIGN KEY, UNIQUEcomments_topic(id)
user_idintNOFOREIGN KEY, UNIQUEauth_user(id)

comments_user

Table that connects comments and user.

ColumnTypeNullableConstraintReferencesComment
comment_idint unsignedNOFOREIGN KEYcomments_comment(id)
idint unsignedNOPRIMARY KEY
is_tagtinyint(1)NO
user_idintNOFOREIGN KEYauth_user(id)

companies_companyfranchisortos

Lists out users that accepted the terms of service. This is mainly used for RBI.

ColumnTypeNullableConstraintReferencesComment
accepted_user_idintNOFOREIGN KEY, UNIQUEauth_user(id)
company_idintNOFOREIGN KEY, UNIQUEusers_company(id)
date_accepteddatetimeNO
idintNOPRIMARY KEY

companies_companyhierarchy

Hierarchical company association using nested set pattern.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEY, UNIQUEusers_company(id)
date_createddatetimeNO
date_modifieddatetimeNO
idintNOPRIMARY KEY
levelint unsignedNO
lftint unsignedNO
parent_companyhierarchy_idintYESFOREIGN KEYcompanies_companyhierarchy(id)
rgtint unsignedNO
tree_idint unsignedNOUNIQUE

dashboards_dashboard

Table that lists the dashboards.

ColumnTypeNullableConstraintReferencesComment
created_user_idintNOFOREIGN KEYauth_user(id)
date_createddatetimeNO
date_modifieddatetimeNO
idint unsignedNOPRIMARY KEY
titlevarchar(50)NO

dashboards_dashboardsavedsearch

Table that lists the dashboards saved search.

ColumnTypeNullableConstraintReferencesComment
dashboard_idint unsignedNOFOREIGN KEYdashboards_dashboard(id)
idint unsignedNOPRIMARY KEY
ordersmallint unsignedNO
saved_search_idint unsignedNOFOREIGN KEYusers_savedsearch(id)

equipment_equipment

Table that lists the equipment.

ColumnTypeNullableConstraintReferencesComment
company_idintYESFOREIGN KEY, UNIQUEusers_company(id)
created_user_idintYESFOREIGN KEYauth_user(id)
date_createddatetimeNO
date_modifieddatetimeNO
descriptionmediumtextYES
external_keyvarchar(50)YESUNIQUE
idintNOPRIMARY KEY
is_activetinyint(1)NO
manufacturervarchar(100)NO
model_namevarchar(100)NO

equipment_equipment_categories

Table that connects an equipment with a category.

ColumnTypeNullableConstraintReferencesComment
equipment_idintNOFOREIGN KEY, UNIQUEequipment_equipment(id)Equipment id
equipmentcategory_idintNOFOREIGN KEY, UNIQUEequipment_equipmentcategory(id)Category id
idintNOPRIMARY KEYIdentifier

equipment_equipmentcategory

Table that lists the equipment categories.

ColumnTypeNullableConstraintReferencesComment
company_idintYESFOREIGN KEY, UNIQUEusers_company(id)
created_user_idintYESFOREIGN KEYauth_user(id)
date_createddatetimeNO
external_keyvarchar(50)YESUNIQUE
idintNOPRIMARY KEY
is_activetinyint(1)NO

equipment_equipmentcategory_translation

Table that lists the equipment category translations.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEYIdentifier
language_codevarchar(15)NOUNIQUELanguage code.
master_idintYESFOREIGN KEY, UNIQUEequipment_equipmentcategory(id)Master id
namevarchar(100)NOTranslated name

equipment_equipmentlocation

Assignment of equipment to a location with location specific information for that piece of equipment.

ColumnTypeNullableConstraintReferencesComment
company_idintYESFOREIGN KEY, UNIQUEusers_company(id)
equipment_idintNOFOREIGN KEYequipment_equipment(id)
external_keyvarchar(50)YESUNIQUE
idbigintNOPRIMARY KEY
identifiervarchar(255)YESA unique description to help uniquely identify this equipment instance.
is_activetinyint(1)NO
location_idintNOFOREIGN KEYlocations_location(id)
location_zonevarchar(255)YESA text description of where this equipment exists within the specific location.

equipment_equipmentlocation_equipment_temperature_profiles

Table that connects equipment locations with temperature profiles.

ColumnTypeNullableConstraintReferencesComment
equipmentlocation_idbigintNOFOREIGN KEY, UNIQUEequipment_equipmentlocation(id)Equipment location id.
idbigintNOPRIMARY KEYIdentifier
temperatureprofile_idintNOFOREIGN KEY, UNIQUEtemperature_profiles_temperatureprofile(id)Temperature profile id

events_company

Through table for company and events.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEY, PRIMARY KEYusers_company(id)
event_idint unsignedNOFOREIGN KEY, PRIMARY KEYevents_event(id)

events_cooldown

Through table for cooldown sensors and events.

ColumnTypeNullableConstraintReferencesComment
cooldown_idintNOFOREIGN KEYsensors_cooldown(id)
event_idint unsignedNOFOREIGN KEYevents_event(id)
idintNOPRIMARY KEY

events_event

The table lists out events regarding follow-up actions.

ColumnTypeNullableConstraintReferencesComment
datalongtextNOJSON data containing the details regarding follow up actions.
date_createddatetimeNO
idint unsignedNOPRIMARY KEY
messagevarchar(255)YES
rule_idint unsignedYESFOREIGN KEYrules_rule(id)
trigger_subtype_idsmallint unsignedNOFOREIGN KEYrules_triggersubtype(id)
trigger_type_idtinyint unsignedNOFOREIGN KEYrules_triggertype(id)

events_event_action_subtypes

Many to many table for event actions subtypes and events table

ColumnTypeNullableConstraintReferencesComment
actionsubtype_idsmallint unsignedNOFOREIGN KEY, UNIQUErules_actionsubtype(id)References event action subtypes.
event_idint unsignedNOFOREIGN KEY, UNIQUEevents_event(id)References events.
idintNOPRIMARY KEYIdentifier

events_event_gateways

Many to many table between the sensors_gateway and events_event table.

ColumnTypeNullableConstraintReferencesComment
event_idint unsignedNOFOREIGN KEY, UNIQUEevents_event(id)References events.
gateway_idintNOFOREIGN KEY, UNIQUEsensors_gateway(id)References sensors gateway.
idintNOPRIMARY KEYIdentifier

events_event_sensors

Many to many table between the sensors_sensor and events_event table.

ColumnTypeNullableConstraintReferencesComment
event_idint unsignedNOFOREIGN KEY, UNIQUEevents_event(id)References events.
idintNOPRIMARY KEYIdentifier
sensor_idintNOFOREIGN KEY, UNIQUEsensors_sensor(id)References sensor.

events_formsubmission

Through table for forms submission and events table.

ColumnTypeNullableConstraintReferencesComment
event_idint unsignedNOFOREIGN KEY, PRIMARY KEYevents_event(id)
form_submission_idchar(24)NOFOREIGN KEY, PRIMARY KEYforms_submission(id)This is the Object id of the submission

events_formtemplate

Through table for form templates and events.

ColumnTypeNullableConstraintReferencesComment
event_idint unsignedNOFOREIGN KEY, PRIMARY KEYevents_event(id)
form_template_idintNOFOREIGN KEY, PRIMARY KEYforms_formtemplate(id)

events_integration

Many-to-many table for integrations types and events.

ColumnTypeNullableConstraintReferencesComment
event_idint unsignedNOFOREIGN KEYevents_event(id)
idint unsignedNOPRIMARY KEY
integration_type_idintNOFOREIGN KEYintegrations_integrationtype(id)

events_locations

Through table for locations and events.

ColumnTypeNullableConstraintReferencesComment
location_idintNOFOREIGN KEY, PRIMARY KEYlocations_location(id)
event_idint unsignedNOFOREIGN KEY, PRIMARY KEYevents_event(id)

events_notification

ColumnTypeNullableConstraintReferencesComment
event_idint unsignedNOFOREIGN KEY, UNIQUEevents_event(id)
idint unsignedNOPRIMARY KEY
notification_idint unsignedYESFOREIGN KEY, UNIQUEnotifications_notification_new(id)

events_project

Many-to-many table for projects and events.

ColumnTypeNullableConstraintReferencesComment
event_idint unsignedNOFOREIGN KEYevents_event(id)
idint unsignedNOPRIMARY KEY
project_idint unsignedNOFOREIGN KEYprojects_project(id)

events_sensorformsubmission

Many to many table for sensor form submissions and events.

ColumnTypeNullableConstraintReferencesComment
event_idint unsignedNOFOREIGN KEYevents_event(id)
idintNOPRIMARY KEY
sensor_form_submission_idchar(32)NO

events_task

Through table for tasks and events.

ColumnTypeNullableConstraintReferencesComment
event_idint unsignedNOFOREIGN KEY, PRIMARY KEYevents_event(id)
task_idint unsignedNOFOREIGN KEY, PRIMARY KEYtasks_task(id)

events_team

Through table for teams and events.

ColumnTypeNullableConstraintReferencesComment
team_idintNOFOREIGN KEY, PRIMARY KEYusers_teams(id)
event_idint unsignedNOFOREIGN KEY, PRIMARY KEYevents_event(id)

events_user

Through table for users and events.

ColumnTypeNullableConstraintReferencesComment
event_idint unsignedNOFOREIGN KEY, PRIMARY KEYevents_event(id)
user_idintNOFOREIGN KEY, PRIMARY KEYauth_user(id)

events_userrole

Through table for user roles and events.

ColumnTypeNullableConstraintReferencesComment
event_idint unsignedNOFOREIGN KEY, PRIMARY KEYevents_event(id)
user_role_idintNOFOREIGN KEY, PRIMARY KEYusers_userrole(id)

fbc_audit

Table of submissions where managing companies can share or not share audits with their reporting companies.

ColumnTypeNullableConstraintReferencesComment
activity_submission_idvarchar(25)NOUNIQUEMongo id of the related activity submission.
date_submitteddatetimeNO
form_template_idintNOFOREIGN KEYforms_formtemplate(id)
idbigintNOPRIMARY KEY
legacy_submission_idvarchar(25)NOUNIQUEMongo legacy id of the submission.
location_idintNOFOREIGN KEYlocations_location(id)
parent_companyhierarchy_idintNOFOREIGN KEYusers_company(id)
reporting_company_idintNOFOREIGN KEYusers_company(id)
submitted_user_idintNOFOREIGN KEYauth_user(id)

fields_field

Records fields used in forms.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEYusers_company(id)
date_createddatetimeYES
idint unsignedNOPRIMARY KEY
is_activetinyint(1)NOIs the form active (1) or archived (0).

fields_fieldtype

Types of form fields. Used to enforce constraint at the database level for field type options. (See fields_fieldversion for example)

ColumnTypeNullableConstraintReferencesComment
typechar(255)NOPRIMARY KEY

fields_fieldversion

Version tracking for form fields.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEYusers_company(id)
datajsonNO
date_createddatetimeYES
field_idint unsignedNOFOREIGN KEYfields_field(id)
field_typechar(255)NOFOREIGN KEYfields_fieldtype(type)
idint unsignedNOPRIMARY KEY
is_primarytinyint(1)NO
titlemediumtextNO

forms_formactivitycategory

Relational table between form templates and form categories. This is currently functioning as a 1:1 relationship.

ColumnTypeNullableConstraintReferencesComment
form_category_idintNOFOREIGN KEYforms_formcategory(id)
form_template_idintNOFOREIGN KEY, UNIQUEforms_formtemplate(id)
idintNOPRIMARY KEY

forms_formcategory

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEYusers_company(id)
idintNOPRIMARY KEY
is_sharabletinyint(1)NOIndicates that the category should be shared with any associated reporting companies if the associated company has reporting companies.
titlevarchar(50)NO

forms_formcategory_translation

Translation records for form categories. This is used to store form category names.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEYIdentifier
language_codevarchar(15)NOUNIQUELanguage code. Currently only in en-us as of 4/29/25
master_idintYESFOREIGN KEY, UNIQUEforms_formcategory(id)Id of the related table: forms_formcategory
namevarchar(50)NOTranslation string

forms_formpermissionrole

Permissions applied to a private form based on a user’s role. This only applies if the form is currently private.

ColumnTypeNullableConstraintReferencesComment
form_template_idintNOFOREIGN KEY, UNIQUEforms_formtemplate(id)
idintNOPRIMARY KEY
permission_idintNOFOREIGN KEY, UNIQUEforms_permission(id)Permission id. Defaults to 1 (view own submissions).
user_role_idintNOFOREIGN KEY, UNIQUEusers_userrole(id)

forms_formpermissionteam

Permissions applied to a private form base on a user’s team. This only applies if the form is currently private.

ColumnTypeNullableConstraintReferencesComment
team_idintNOFOREIGN KEY, UNIQUEusers_teams(id)
form_template_idintNOFOREIGN KEY, UNIQUEforms_formtemplate(id)
form_parent_team_idintYESFOREIGN KEY, UNIQUEusers_teams(id)All child teams are granted permission as well. This indicates that permission is granted due to a parent team having permission.
idintNOPRIMARY KEY
permission_idintNOFOREIGN KEY, UNIQUEforms_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.

ColumnTypeNullableConstraintReferencesComment
form_template_idintNOFOREIGN KEY, UNIQUEforms_formtemplate(id)
idintNOPRIMARY KEY
permission_idintNOFOREIGN KEY, UNIQUEforms_permission(id)Permission id. Defaults to 1 (view own submissions).
user_idintNOFOREIGN KEY, UNIQUEauth_user(id)

forms_formtemplate

The base record for form templates.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEYusers_company(id)
datalongtextNOA JSON dictionary defining various form values and all the form’s fields' specifics.
date_createddatetimeYES
date_last_submitteddatetimeYES
date_updateddatetimeYES
deletedtinyint(1)NO
form_template_type_idsmallint unsignedNOFOREIGN KEYforms_formtemplatetype(id)
idintNOPRIMARY KEY
is_creator_locktinyint(1)NODo not allow admins in my company to edit this template.
show_in_brandhubtinyint(1)NOIndicates if the form has been included in BrandHub.
is_securetinyint(1)NOIf true a form has been configured to be private.
num_submissionsintNONumber of submissions made with this form
parent_form_template_idintYESFOREIGN KEYforms_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_idint unsignedYESFOREIGN KEYrules_rule(id)Id for associated the rules_rule table. Used in managing triggers.
is_fbc_audittinyint(1)NOWhether to show submissions made on this form on the FBC Audits page
titlevarchar(255)NO
user_idintNOFOREIGN KEYauth_user(id)

forms_formtemplate_saved_searches_to_reactivate

Used for which saved searches (reports) to reactivate when the associated forms_formtemplate is reactivated.

ColumnTypeNullableConstraintReferencesComment
formtemplate_idintNOFOREIGN KEY, UNIQUEforms_formtemplate(id)Form template id
idintNOPRIMARY KEYIdentifier
savedsearch_idint unsignedNOFOREIGN KEY, UNIQUEusers_savedsearch(id)Saved search id

forms_formtemplatetype

Form template type. Currently only user_generated, sensor, zenprint_print_job are options. This is used by saved searches.

ColumnTypeNullableConstraintReferencesComment
idsmallint unsignedNOPRIMARY KEY
namevarchar(50)NOUNIQUE

forms_permission

Private form permission levels.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEY
namevarchar(40)NO

forms_savedsearch_formtemplate

Relational table between form templates and saved searches.

ColumnTypeNullableConstraintReferencesComment
form_template_idintNOFOREIGN KEYforms_formtemplate(id)
idint unsignedNOPRIMARY KEY
saved_search_idint unsignedNOFOREIGN KEY, UNIQUEusers_savedsearch(id)

forms_submission

Record of form submissions.

ColumnTypeNullableConstraintReferencesComment
company_idintYESFOREIGN KEYusers_company(id)
date_submitteddatetimeNO
date_submitted_localdatetimeYESLocal datetime when submitted.
distance_to_locationdoubleYESMiles between the submission lat/lon and the location lat/lon.
form_template_idintNOFOREIGN KEYforms_formtemplate(id)
idchar(24)NOPRIMARY KEYId is the ObjectID in MongoDb for the submission.
is_activetinyint(1)NOIs submission deleted or not.
latdoubleYESDevice latitude at time of hitting submit.
londoubleYESDevice longitude at time of hitting submit.
num_failuresintYESThe number questions with acceptance_value = -1.
num_imagesintNO
questions_answeredintNO
submitted_user_idintNOFOREIGN KEYauth_user(id)
time_to_completeintYESMilliseconds delta between date_created and date_completed.
time_zonevarchar(40)YESSubmission timezone.

forms_zenprint_print_job

The contents of each print job generated by a Zenput Labels installation.

ColumnTypeDescription
_idObjectId(String)The Mongo id of the object
fields[]Not used
metadata{'title': '', 'deleted': 'boolean', 'company': {'id': 'int'}, 'form_template_type': 'zenprint_print_job', 'date_created': '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{'ingredient': {'id': 'int', 'name': 'string', 'template_group_id': 'int', 'phase': {'id': 'int', 'phase_type': {'id': 'int', 'name': 'string', 'display_name': 'string'}, 'expiration_date_type': {'id': 'int', 'name': 'expirationdate'}, 'expiration_type': {'id': 'int', 'name': 'calculated'}, 'duration_type': 'days', 'duration_value': 'int', 'selected_options': []}, 'count': 'int', 'expiration_date': 'ISODate("date string")', 'date_overridden': 'boolean', 'category': {'id': 'int'}}, 'print_type': 'single', 'app_online': 'boolean', 'print_job_username': 'username', 'user_agent_data': 'unknown zenput-labels (app_version=23.3.0;platform_type=iPadOS;platform_version=16.2)', 'company': {'id': 1}, 'date_submitted': 'ISODate("date string")', 'date_submitted_local': 'ISODate("date string")', 'date_created': 'ISODate("date string")', 'date_created_local': 'ISODate("date string")', 'created_by': {'id': 'int', 'display_name': 'First Name'}, 'account': {'id': 'int', 'name': 'Location Name', 'tags': [{'id': 'int'}, {'id': 'int'}]}, 'distribute_groups': [{'id': 'int'}, {'id': 'int'}], 'time_zone': 'America/Los_Angeles', 'printer_info': {'device': {'id': '1111-2222-BBBB-CCCC-123456789', 'rssi': 'int', 'advertising': {'k_cb_adv_data_rx_primary_phy': 129, 'k_cb_adv_data_rx_secondary_phy': 0, 'manufacturer_data': {'cdv_type': 'ArrayBuffer', 'data': 'QBkgWzcDNS4w', 'bytes': [64, 25, 32, 91, 55, 3, 53, 46, 48]}, 'local_name': 'ABC-222222_7777', 'k_cb_adv_data_timestamp': 'float', 'is_connectable': 'boolean', 'service_uuids': [], 'tx_power_level': 'int'}, 'name': 'SLP-DX220B_0702'}, 'firmware_revision': 'V02.10 STD_BT 001122', 'from_printer_characteristic_uuid': '555-5555-5555-555-55555', 'hardware_revision': 'N/A', 'id': '1234-5555-9999-9999-ABCDEFH', 'manufacturer_name': 'Bixolon', 'model_name': 'SLP-DX220', 'parser_service_uuid': '5555-5555-5555-5555-5555', 'rssi': 'int', 'serial_number': 'SERIAL1234', 'software_revision': 'N/A', 'to_printer_characteristic_uuid': '555-555-5555-5555-55555555', 'type': 'TYPE', 'is_selected': 'boolean'}, 'title': 'Print Job - Zenputy Zenput - None', 'client_time_zone': 'America/Los_Angeles', 'date_completed_local': None, 'user_distribute_groups': [{'id': 'int'}], 'account_distribute_groups': [{'id': 'int'}], 'hour_submitted': 'int', 'hour_submitted_local': 'int', 'label_size': 'TWOBYONE', 'date_overridden': 'boolean', 'value': None}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).
deletedBooleanIndicates if the print job has been deleted.

ingredients_allergenlabel

Allergens in ingredients.

ColumnTypeNullableConstraintReferencesComment
date_createddatetimeNO
date_modifieddatetimeNO
idintNOPRIMARY KEY
ingredient_idintNOFOREIGN KEY, UNIQUEingredients_ingredient(id)

ingredients_allergenlabel_translation

Table that lists the allergen translations.

ColumnTypeNullableConstraintReferencesComment
allergen_labelvarchar(2000)NOTranslation string
idintNOPRIMARY KEYIdentifier
language_codevarchar(15)NOUNIQUELanguage code.
master_idintYESFOREIGN KEY, UNIQUEingredients_allergenlabel(id)Id of the related table: ingredients_allergenlabel

ingredients_catalog

Table that lists the ingredient catalogs owned by some managing companies.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEY, UNIQUEusers_company(id)
date_createddatetimeNO
date_modifieddatetimeNO
idintNOPRIMARY KEY
is_activetinyint(1)NO
namevarchar(200)NO

ingredients_catalogsubscription

Table that points to which ingredient catalog a reporting company is using.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEY
ingredient_catalog_idintYESFOREIGN KEYingredients_catalog(id)
ingredient_catalog_subscriber_idintNOFOREIGN KEY, UNIQUEusers_company(id)

ingredients_category

Table that lists ingredient categories.

ColumnTypeNullableConstraintReferencesComment
activities_supporttinyint(1)NOWhether 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
colorvarchar(6)NOHex color value for displaying the category color.
company_idintNOFOREIGN KEY, UNIQUEusers_company(id)
created_user_idintNOFOREIGN KEYauth_user(id)
date_createddatetimeNO
date_modifieddatetimeNO
external_keyvarchar(100)YESUNIQUEKey used to link the Crunchtime value to the customer’s internal systems.
idintNOPRIMARY KEY
is_activetinyint(1)NO
labels_supporttinyint(1)NOWhether or not this category is used by the Zenput Labels application.
production_sheets_supporttinyint(1)NOWhether or not this category is used by the Production Sheets application.

ingredients_category_translation

Table that lists the category translations.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEYIdentifier
language_codevarchar(15)NOUNIQUELanguage code.
master_idintYESFOREIGN KEY, UNIQUEingredients_category(id)Master id
namevarchar(100)NOTranslation string

ingredients_categorydisable

Table that lists categories that are disabled for specific companies.

ColumnTypeNullableConstraintReferencesComment
category_idintNOFOREIGN KEY, UNIQUEingredients_category(id)
company_idintNOFOREIGN KEY, UNIQUEusers_company(id)
idintNOPRIMARY KEY

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.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEY, UNIQUEusers_company(id)
idintNOPRIMARY KEY
label_typevarchar(75)NOThe type of label to order (low-adhesive or dissolvable), Default is Low-Adhesive.

ingredients_expirationdatetype

What the expiration on the printed label means (best by, expires on, use by).

ColumnTypeNullableConstraintReferencesComment
idsmallint unsignedNOPRIMARY KEY
namevarchar(20)NOUNIQUE

ingredients_expirationtype

The type of expiration that is printed on the labels. This affects how the calculation is done and how it is printed.

ColumnTypeNullableConstraintReferencesComment
idsmallint unsignedNOPRIMARY KEY
namevarchar(55)NOUNIQUEThe type of expiration: calculated, end of day, package, two step.

ingredients_ingredient

Table that lists ingredients.

ColumnTypeNullableConstraintReferencesComment
activities_supporttinyint(1)NOWhether or not this ingredient is used by the Activities feature.
company_idintNOFOREIGN KEY, UNIQUEusers_company(id)
created_user_idintNOFOREIGN KEYauth_user(id)
date_createddatetimeNO
date_modifieddatetimeNO
external_keyvarchar(100)YESUNIQUEKey used to link the Crunchtime value to the customer’s internal systems.
has_expirationtinyint(1)NO
idintNOPRIMARY KEY
is_activetinyint(1)NO
labels_supporttinyint(1)NOWhether or not this ingredient is used by the Zenput Labels application.
parent_idintYESFOREIGN KEYingredients_ingredient(id)Id of the same table: ingredients_ingredient Example: a regular donut is the parent ingredient of a glazed donut
production_sheets_supporttinyint(1)NOWhether or not this ingredient is used by the Production Sheets application.
template_group_idintYESFOREIGN KEYingredients_templategroup(id)

ingredients_ingredient_categories

Many-to-many table that joins ingredients to categories.

ColumnTypeNullableConstraintReferencesComment
category_idintNOFOREIGN KEY, UNIQUEingredients_category(id)Id of the ingredient category
idintNOPRIMARY KEYIdentifier
ingredient_idintNOFOREIGN KEY, UNIQUEingredients_ingredient(id)Id of the ingredient

ingredients_ingredient_translation

Table that lists the ingredient translations.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEYIdentifier
language_codevarchar(15)NOUNIQUELanguage code.
master_idintYESFOREIGN KEY, UNIQUEingredients_ingredient(id)Id of the related table: ingredients_ingredient
namevarchar(100)NOTranslation string

ingredients_ingredientclearview

Table that lists the ClearView external key for ingredients. Used only by Production Sheets for tracking waste.

ColumnTypeNullableConstraintReferencesComment
clearview_external_keyvarchar(100)NO
idintNOPRIMARY KEY
ingredient_idintNOFOREIGN KEY, UNIQUEingredients_ingredient(id)

ingredients_ingredientdisable

Table that lists ingredients that are disabled for specific companies.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEY, UNIQUEusers_company(id)
idintNOPRIMARY KEY
ingredient_idintNOFOREIGN KEY, UNIQUEingredients_ingredient(id)

ingredients_ingredientlocation

Table that lists which ingredients are available in which locations.

ColumnTypeNullableConstraintReferencesComment
default_unit_of_measure_idintYESFOREIGN KEYingredients_unitofmeasure(id)
idintNOPRIMARY KEY
ingredient_idintNOFOREIGN KEY, UNIQUEingredients_ingredient(id)
is_activetinyint(1)NO
location_idintNOFOREIGN KEY, UNIQUElocations_location(id)

ingredients_ingredientlocation_ingredient_temperature_profiles

Table that maps ingredient locations to temperature profiles.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEYIdentifier
ingredientlocation_idintNOFOREIGN KEY, UNIQUEingredients_ingredientlocation(id)Id of the related table: ingredients_ingredientlocation.
temperatureprofile_idintNOFOREIGN KEY, UNIQUEtemperature_profiles_temperatureprofile(id)Id of the related table: temperature_profiles_temperatureprofile.

ingredients_ingredientlocation_units_of_measure

Table that maps ingredient locations to units of measure.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEYIdentifier
ingredientlocation_idintNOFOREIGN KEY, UNIQUEingredients_ingredientlocation(id)Id of the related table: ingredients_ingredientlocation.
unitofmeasure_idintNOFOREIGN KEY, UNIQUEingredients_unitofmeasure(id)Id of the related table: ingredients_unitofmeasure.

ingredients_ingredientlocationphaseexpiration

Table that contains expiration information for ingredient locations.

ColumnTypeNullableConstraintReferencesComment
date_createddatetimeNO
date_modifieddatetimeNO
expiration_date_type_idsmallint unsignedYESFOREIGN KEYingredients_expirationdatetype(id)
expiration_type_idsmallint unsignedNOFOREIGN KEYingredients_expirationtype(id)
expiration_unitvarchar(11)YESDays, weeks, months, etc.
expiration_valueintYESHow many units.
idintNOPRIMARY KEY
ingredient_idintNOFOREIGN KEY, UNIQUEingredients_ingredient(id)
is_activetinyint(1)NO
location_idintNOFOREIGN KEY, UNIQUElocations_location(id)
phase_type_idintYESFOREIGN KEY, UNIQUEingredients_phasetype(id)

ingredients_labelorder

Table that contains information on where to send ordered labels.

ColumnTypeNullableConstraintReferencesComment
location_idintYESFOREIGN KEYlocations_location(id)
addressvarchar(75)NORecipient address.
address2varchar(75)YESRecipient address 2.
brand_idintYESFOREIGN KEYusers_companybrand(id)
cityvarchar(75)NORecipient city.
company_idintNOFOREIGN KEYusers_company(id)
country_idvarchar(2)YESFOREIGN KEYusers_country(alpha_2)The two-leter country identifier.
created_user_idintNOFOREIGN KEYauth_user(id)
date_createddatetimeNO
date_modifieddatetimeNO
emailvarchar(75)NORecipient email.
idintNOPRIMARY KEY
label_typevarchar(75)YESThe label size (1x1, 2x1, 2x2).
mediavarchar(50)NOThe type of label (low-adhesive, dissolvable).
phonevarchar(75)NORecipient phone.
quantityintYESHow many items where ordered.
statevarchar(75)NORecipient state.
zipcodevarchar(10)NORecipient zipcode.

ingredients_phase

Table contains information on an ingredient phase.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEY, UNIQUEusers_company(id)
date_createddatetimeNO
date_labelvarchar(24)YESThe name for the type of date that is printed on the label
date_modifieddatetimeNO
duration_typevarchar(11)YESDays, weeks, months, etc.
duration_type_step_twovarchar(11)YESDays, weeks, months, etc., for the second step in a two-step expiration ingredient phase.
duration_valueintYESHow many units.
duration_value_step_twointYESHow many units for the second step in a two-step expiration phase.
expiration_date_type_idsmallint unsignedYESFOREIGN KEYingredients_expirationdatetype(id)
expiration_type_idsmallint unsignedNOFOREIGN KEYingredients_expirationtype(id)
idintNOPRIMARY KEY
ingredient_idintNOFOREIGN KEY, UNIQUEingredients_ingredient(id)
is_activetinyint(1)NO
phase_type_idintYESFOREIGN KEY, UNIQUEingredients_phasetype(id)
step_one_namevarchar(50)YESThe name for the first step in a two-step expiration ingredient phase.
step_two_namevarchar(50)YESThe name for the second step in a two-step expiration ingredient phase.
template_group_idintYESFOREIGN KEYingredients_templategroup(id)

ingredients_phaseattribute

Table that lists the [optional] phase attributes.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEY
is_activetinyint(1)NO
is_requiredtinyint(1)NO
namevarchar(50)NOUNIQUE
phase_type_idintNOFOREIGN KEY, UNIQUEingredients_phasetype(id)

ingredients_phaseattributeoption

Table that lists the phase attribute options.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEY
is_activetinyint(1)NO
namevarchar(50)NOUNIQUE
phase_attribute_idintNOFOREIGN KEY, UNIQUEingredients_phaseattribute(id)

ingredients_phaseattributeoptionsselect

Table that lists the selected attribute option.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEY
phase_attribute_option_idintNOFOREIGN KEY, UNIQUEingredients_phaseattributeoption(id)
phase_idintNOFOREIGN KEY, UNIQUEingredients_phase(id)

ingredients_phasetype

Table that lists the phase types (Received, Use By, etc.) Each company can have up to 5 phases.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEY, UNIQUEusers_company(id)Company who created the phase. Phase cannot be overwritten by a child company.
created_user_idintNOFOREIGN KEYauth_user(id)
date_createddatetimeNO
date_modifieddatetimeNO
display_namevarchar(50)NO
idintNOPRIMARY KEY
is_activetinyint(1)NO
namevarchar(50)NOValue that the user sets when creating the phase.
ordersmallint unsignedYESUNIQUEThe order in which to display this phase type.
template_group_idintYESFOREIGN KEYingredients_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.

ColumnTypeNullableConstraintReferencesComment
datavarchar(1024)NOThe ZPL for the template. This includes tokens for the template fields.
date_createddatetimeNO
date_modifieddatetimeNO
idintNOPRIMARY KEY
is_activetinyint(1)NO
sizevarchar(64)NOUNIQUEThe label size for the template (1x1, 2x1, 2x2).
template_group_idintNOFOREIGN KEY, UNIQUEingredients_templategroup(id)

ingredients_templatefield

Table that lists the label template fields. A field that represents a token in a template.

ColumnTypeNullableConstraintReferencesComment
break_twicetinyint(1)NO
descriptionvarchar(1024)NOThe ZPL for the template. This includes tokens for the template fields.
field_typeintNOFOREIGN KEYingredients_templatefieldtype(id)
idintNOPRIMARY KEY
line_breakintYESSize of line break.
namevarchar(128)NOUNIQUE
one_line_zplvarchar(512)YESThe ZPL for when only one line will be printed.
tokenvarchar(128)YESThe token in the template that will be replaced by the contents of this field.
truncate_lengthintYESString length at which the content of the field should be broken.
two_line_zplvarchar(512)YESThe ZPL for when we need to print two lines.

ingredients_templatefield_templates

Table maps template fields to templates.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEYIdentifier
template_idintNOFOREIGN KEY, UNIQUEingredients_template(id)Ingredient template Id
templatefield_idintNOFOREIGN KEY, UNIQUEingredients_templatefield(id)Ingreadient template field Id

ingredients_templatefieldtype

Table that lists the types of template fields. The template field's type: client_determined, phase_type, phase_type_attribute

ColumnTypeNullableConstraintReferencesComment
descriptionvarchar(1024)NO
idintNOPRIMARY KEY
namevarchar(128)NOUNIQUE

ingredients_templategroup

Table that lists the template groups (Name Prominent, Date Prominent, etc.) used for printing labels.

ColumnTypeNullableConstraintReferencesComment
date_createddatetimeNO
date_modifieddatetimeNO
descriptionvarchar(1024)NO
idintNOPRIMARY KEY
is_activetinyint(1)NO
namevarchar(128)NOUNIQUE

ingredients_templategroup_companies

Table that maps ingredient template groups to companies.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEY, UNIQUEusers_company(id)Company Id
idintNOPRIMARY KEYIdentifier
templategroup_idintNOFOREIGN KEY, UNIQUEingredients_templategroup(id)Template group Id

ingredients_templategroupphasetypeoverride

Table that has the template group override at the phase type level for a catalog subscriber.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEY
ingredient_catalog_subscriber_idintNOFOREIGN KEY, UNIQUEusers_company(id)
phase_type_idintNOFOREIGN KEY, UNIQUEingredients_phasetype(id)
template_group_idintNOFOREIGN KEYingredients_templategroup(id)

ingredients_unitofmeasure

Table that lists the units of measure for an ingredient.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEYusers_company(id)
date_createddatetimeNO
date_modifieddatetimeNO
external_keyvarchar(50)NOKey used to link the Crunchtime value to the customer’s internal systems.
idintNOPRIMARY KEY
is_activetinyint(1)NO

ingredients_unitofmeasure_translation

Table that lists the unit of measure translations.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEYIdentifier
language_codevarchar(15)NOUNIQUELanguage code
master_idintYESFOREIGN KEY, UNIQUEingredients_unitofmeasure(id)Id of the related table: ingredients_unitofmeasure
namevarchar(500)NOTranslation string

locations_attribute

Attributes are keywords or terms that end users can assign to a location.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEY, UNIQUEusers_company(id)
external_keyvarchar(50)YESUNIQUE
idintNOPRIMARY KEY
is_activetinyint(1)NODescribes if the attribute has been deleted by a user or not.
is_editabletinyint(1)NODictates whether or not locations can be removed/added from this attribute.
namevarchar(100)NOUNIQUE

locations_location

Lists all relevant information pertaining to locations.

ColumnTypeNullableConstraintReferencesComment
addressvarchar(100)NO
cityvarchar(100)NO
company_idintNOFOREIGN KEY, UNIQUEusers_company(id)
country_idvarchar(2)YESFOREIGN KEYusers_country(alpha_2)
date_createddatetimeYES
date_deactivateddatetimeYES
date_modifieddatetimeYES
emailvarchar(500)YES
external_keyvarchar(100)YESUNIQUE
full_text_searchvarchar(1000)NOAllows searching of location based on email, location name, state, country and etc.
idintNOPRIMARY KEY
is_activetinyint(1)NO
latdoubleYES
londoubleYES
namevarchar(100)NO
phonevarchar(20)YES
regionvarchar(50)YES
statevarchar(50)NO
temperature_unitvarchar(1)YES
time_zonevarchar(40)YES
zipcodevarchar(40)YES

locations_locationattribute

ColumnTypeNullableConstraintReferencesComment
location_idintNOFOREIGN KEY, UNIQUElocations_location(id)
idintNOPRIMARY KEY
attribute_idintNOFOREIGN KEY, UNIQUElocations_attribute(id)

locations_locationcalendardayevent

An event that occurs over a full day, relative to a single day of the week.

ColumnTypeNullableConstraintReferencesComment
calendar_event_type_idintNOFOREIGN KEY, UNIQUElocations_locationcalendareventtype(id)
day_of_weekintNOUNIQUEDay of the week(0-6), 0 = Monday, things that apply every day will have 7 entries in the DB.
idintNOPRIMARY KEY
location_idintNOFOREIGN KEY, UNIQUElocations_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.

ColumnTypeNullableConstraintReferencesComment
calendar_event_type_idintNOFOREIGN KEY, UNIQUElocations_locationcalendareventtype(id)
day_of_weekintNOUNIQUEWhat day of the week does this apply for(0-6), 0 = Monday, things that apply every day will have 7 entries in the DB.
idintNOPRIMARY KEY
location_idintNOFOREIGN KEY, UNIQUElocations_location(id)
time_offset_minutesintNOTime 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.

locations_locationcalendareventtype

This class represents different reference types for a locations calendar.

ColumnTypeNullableConstraintReferencesComment
company_idintYESFOREIGN KEY, UNIQUEusers_company(id)
idintNOPRIMARY KEY
is_activetinyint(1)NO
keyvarchar(50)NOUNIQUE

locations_locationcalendareventtype_translation

Table that lists Location calendar event type translations.

ColumnTypeNullableConstraintReferencesComment
descriptionvarchar(500)NODescription
idintNOPRIMARY KEYIdentifier
language_codevarchar(15)NOUNIQUELanguage Code
master_idintYESFOREIGN KEY, UNIQUElocations_locationcalendareventtype(id)Master id

locations_locationdisablerandomingredienttemperature

This stores if a location has disabled random ingredient temperature feature.

ColumnTypeNullableConstraintReferencesComment
location_idintNOFOREIGN KEY, PRIMARY KEYlocations_location(id)

locations_locationfbc

Table that attaches FBC users to locations.

ColumnTypeNullableConstraintReferencesComment
idbigintNOPRIMARY KEY
location_idintNOFOREIGN KEY, UNIQUElocations_location(id)
user_idintNOFOREIGN KEY, UNIQUEauth_user(id)

locations_locationowneruser

ColumnTypeNullableConstraintReferencesComment
location_idintNOFOREIGN KEY, UNIQUElocations_location(id)
idintNOPRIMARY KEY
user_idintNOFOREIGN KEY, UNIQUEauth_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

ColumnTypeNullableConstraintReferencesComment
announcement_idint unsignedYESFOREIGN KEYannouncements_announcement(id)
comment_idint unsignedYESFOREIGN KEYcomments_comment(id)
created_user_idintNOFOREIGN KEYauth_user(id)
date_createddatetimeYES
date_modifieddatetimeYES
date_seendatetimeYES
idintNOPRIMARY KEY
is_activetinyint(1)NOis_active is currently used for marking announcements as resent.
recipient_user_idintNOFOREIGN KEYauth_user(id)
target_typevarchar(255)NOIs this an Announcement, Task, or Submission?

notifications_notifier

Who the notification is notifying.

ColumnTypeNullableConstraintReferencesComment
delivery_type_idsmallint unsignedNOFOREIGN KEYusers_usernotificationsettingdeliverytype(id)
emailvarchar(75)YES
idint unsignedNOPRIMARY KEY
notification_idint unsignedNOFOREIGN KEYnotifications_notification_new(id)
notification_typevarchar(50)NOInternal OR external.
user_idintYESFOREIGN KEYauth_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.

ColumnTypeNullableConstraintReferencesComment
approved_local_usernamevarchar(20)YES
approved_user_idintYESFOREIGN KEYauth_user(id)
datedateNOUNIQUEWhat date is the sheet for.
date_approveddatetimeYES
date_createddatetimeNO
date_modifieddatetimeNO
idintNOPRIMARY KEY
is_activetinyint(1)NO
location_idintNOFOREIGN KEY, UNIQUElocations_location(id)
modified_local_usernamevarchar(20)NO
modified_user_idintNOFOREIGN KEYauth_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.

ColumnTypeNullableConstraintReferencesComment
amount_madedoubleYES
amount_wasteddoubleYES
date_createddatetimeNO
date_modifieddatetimeNO
date_modified_localdatetimeNO
entry_time_offset_startintNOHow many minutes away it is from the production sheet's date at 00:00. It could be negative if needed.
idintNOPRIMARY KEY
modified_local_usernamevarchar(20)NO
modified_user_idintNOFOREIGN KEYauth_user(id)
parent_entry_idintYESFOREIGN KEYproduction_sheets_sheetentry(id)Id of the same table.
sheet_ingredient_idintNOFOREIGN KEYproduction_sheets_sheetingredient(id)
temperaturedoubleYES
typeint unsignedNO1 = Regular, 2 = Special Count.

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.

ColumnTypeNullableConstraintReferencesComment
date_createddatetimeNO
date_modifieddatetimeNO
expiration_unitvarchar(11)YES
expiration_valueintYES
idintNOPRIMARY KEY
ingredient_idintNOFOREIGN KEY, UNIQUEingredients_ingredient(id)
modified_local_usernamevarchar(20)NO
modified_user_idintNOFOREIGN KEYauth_user(id)
parent_sheet_ingredient_idintYESFOREIGN KEYproduction_sheets_sheetingredient(id)
recommended_amount_to_makedoubleYES
sheet_idintNOFOREIGN KEY, UNIQUEproduction_sheets_sheet(id)
unit_of_measure_idintNOFOREIGN KEYingredients_unitofmeasure(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.

ColumnTypeNullableConstraintReferencesComment
date_createddatetimeNO
date_modifieddatetimeNO
day_of_weekintNOUNIQUEDay of the week(0 - 6), 0 = Monday
idintNOPRIMARY KEY
ingredient_idintNOFOREIGN KEY, UNIQUEingredients_ingredient(id)
is_activetinyint(1)NO
location_idintNOFOREIGN KEY, UNIQUElocations_location(id)
modified_local_usernamevarchar(20)NO
modified_user_idintNOFOREIGN KEYauth_user(id)
recommended_amount_to_makedoubleYES
unit_of_measure_idintNOFOREIGN KEYingredients_unitofmeasure(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.

ColumnTypeNullableConstraintReferencesComment
allow_any_user_fulfilltinyint(1)NO
archived_user_idintYESFOREIGN KEYauth_user(id)
company_idintNOFOREIGN KEYusers_company(id)
create_tasks_datamediumtextYES
create_tasks_form_template_idintYESFOREIGN KEYforms_formtemplate(id)
create_tasks_location_attributesjsonYESHolds data for how to filter project locations based on location attributes.
create_tasks_location_calendar_eventsjsonYESStores the data to set project's tasks start and due dates using location calendar events.
create_tasks_reply_type_idsmallint unsignedYESFOREIGN KEYtasks_replytype(id)Task reply type is used to create bulk tasks for recurring child.
create_tasks_user_role_idintYESFOREIGN KEYusers_userrole(id)This is the user role to create bulk tasks for recurring child.
created_user_idintNOFOREIGN KEYauth_user(id)
date_archiveddatetimeYES
date_createddatetimeNO
date_deleteddatetimeYES
date_due_localdatetimeYESOnly 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.
date_modifieddatetimeNO
date_start_localdatetimeYESOnly 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.
deletedtinyint(1)NO
deleted_user_idintYESFOREIGN KEYauth_user(id)
descriptionmediumtextYES
frequencyintYESYearly, Monthly, Weekly, Daily.
idintNOPRIMARY KEY
is_activetinyint(1)NOStates whether the project is active/has not been archived.
is_auto_archivetinyint(1)NOArchive this project, if true, when date_due has passed. Does nothing for recurring project, its ending date is handled by the recurring.
is_propagatedtinyint(1)NO
project_typevarchar(255)NOThe project type, it can be Location or User.
recurring_datajsonYES
titlevarchar(255)NO

projects_follower

Table that lists the users that are subscribed as report recipients for a specific project.

ColumnTypeNullableConstraintReferencesComment
idint unsignedNOPRIMARY KEY
project_idint unsignedNOFOREIGN KEY, UNIQUEprojects_project(id)
user_idintNOFOREIGN KEY, UNIQUEauth_user(id)The user who is added to receive a report on the project.

projects_project

Table that lists projects within a single company.

ColumnTypeNullableConstraintReferencesComment
allow_any_user_fulfilltinyint(1)NO
archived_user_idintYESFOREIGN KEYauth_user(id)
company_idintNOFOREIGN KEYusers_company(id)
create_tasks_datamediumtextYESThis is json representation of how to create the child projects (if recurring), or how this project was created.
create_tasks_team_idintYESFOREIGN KEYusers_teams(id)This is the team to assign created tasks to.
create_tasks_form_template_idintYESFOREIGN KEYforms_formtemplate(id)
create_tasks_location_attributesjsonYESHolds data for how to filter project locations based on location attributes.
create_tasks_location_calendar_eventsjsonYESStores the data to set project's tasks start and due dates using location calendar events.
create_tasks_reply_type_idsmallint unsignedYESFOREIGN KEYtasks_replytype(id)Task reply type is used to create bulk tasks for recurring child.
create_tasks_user_role_idintYESFOREIGN KEYusers_userrole(id)This is the user role to assign created tasks to.
created_user_idintNOFOREIGN KEYauth_user(id)
date_archiveddatetimeYES
date_createddatetimeNO
date_deleteddatetimeYES
date_duedatetimeYESOnly included on project instance with tasks (one-off or child instance), the max(tasks.date_due) for tasks generated by the project.
date_due_utcdatetimeYES
date_modifieddatetimeNO
date_startdatetimeYESOnly 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_start_utcdatetimeYES
deletedtinyint(1)NOIf 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_idintYESFOREIGN KEYauth_user(id)
descriptionmediumtextYES
frequencyintYES0 - YEARLY, 1 - MONTHLY, 2 - WEEKLY, 3 - DAILY
idint unsignedNOPRIMARY KEY
is_activetinyint(1)NOStates 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.
is_auto_archivetinyint(1)NOArchive this project, if true, when date_due has passed. Does nothing for recurring project, its ending date is handled by the recurring.
is_future_projecttinyint(1)NOThis states that the project was setup to run in the future.
parent_project_idint unsignedYESFOREIGN KEYprojects_project(id)Id of the same table.
project_typevarchar(255)NOThe project type, it can be Location or User.
recurring_idint unsignedYESFOREIGN KEY, UNIQUEschedules_recurring(id)Link to the schedule recurring item for this project. This holds how often to create a new project.
titlevarchar(255)NO

projects_project_create_tasks_account_tags

Many-to-many table that connects projects and location attributes.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEYIdentifier
project_idint unsignedNOFOREIGN KEY, UNIQUEprojects_project(id)Project id
attribute_idintNOFOREIGN KEY, UNIQUElocations_attribute(id)Attribute id

projects_project_create_tasks_accounts

Many-to-many table that lists locations that tasks will be generated for when task generation begins.

ColumnTypeNullableConstraintReferencesComment
location_idintNOFOREIGN KEY, UNIQUElocations_location(id)Location id
idintNOPRIMARY KEYIdentifier
project_idint unsignedNOFOREIGN KEY, UNIQUEprojects_project(id)Project id

projects_project_create_tasks_users

Table that connects projects and users.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEYIdentifier
project_idint unsignedNOFOREIGN KEY, UNIQUEprojects_project(id)Project id
user_idintNOFOREIGN KEY, UNIQUEauth_user(id)User id

projects_sharedproject

Many-to-many table that lists the who, what, where and when details of a shared project.

ColumnTypeNullableConstraintReferencesComment
copying_user_idintNOFOREIGN KEYauth_user(id)
date_copieddatetimeYES
date_createddatetimeYES
date_modifieddatetimeYES
idint unsignedNOPRIMARY KEY
crosscompany_project_idintNOFOREIGN KEY, UNIQUEprojects_crosscompanyproject(id)ID of the cross company project that is being shared.
target_company_idintYESFOREIGN KEY, UNIQUEusers_company(id)ID of the target company.
target_project_idint unsignedNOFOREIGN KEYprojects_project(id)ID of the shared project.

reports_savedreport

Table that lists saved reports. This will eventually replace saved search and migration from saved search to saved report is ongoing.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEYusers_company(id)
configurationjsonNO
created_user_idintNOFOREIGN KEYauth_user(id)
date_createddatetimeYES
date_updateddatetimeYES
idintNOPRIMARY KEY
is_activetinyint(1)NO
is_brandwidetinyint(1)NO
recipients_criteriajsonNO
recurring_idint unsignedYESFOREIGN KEY, UNIQUEschedules_recurring(id)
report_typevarchar(255)NOChoices are User Project Completion Recap and User Project with Failures.
send_to_franchiseetinyint(1)NO
titlevarchar(255)NO
updated_user_idintYESFOREIGN KEYauth_user(id)
use_recipient_visibilitytinyint(1)NO

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.

ColumnTypeNullableConstraintReferencesComment
action_subtype_idsmallint unsignedNOFOREIGN KEYrules_actionsubtype(id)
action_type_idtinyint unsignedNOFOREIGN KEYrules_actiontype(id)
datalongtextNOJSON representation of the data for this action. This is for quick retrieving of the information. The information here can or cannot be represented in additional tables, ie. events_action_notify_user.
idint unsignedNOPRIMARY KEY
is_activetinyint(1)NO
ordersmallint unsignedYESSequence of actions.
rule_idint unsignedNOFOREIGN KEYrules_rule(id)

rules_actionnotificationuser

Tables that connect actions and users.

ColumnTypeNullableConstraintReferencesComment
action_idint unsignedNOFOREIGN KEY, PRIMARY KEYrules_action(id)
user_idintNOFOREIGN KEYauth_user(id)

rules_actionnotificationuserroleaccount

Tables that connect actions and user roles.

ColumnTypeNullableConstraintReferencesComment
action_idint unsignedNOFOREIGN KEY, PRIMARY KEYrules_action(id)
user_role_idintNOFOREIGN KEYusers_userrole(id)

rules_actionsubtype

Tables that list action subtypes.

ColumnTypeNullableConstraintReferencesComment
action_type_idtinyint unsignedNOFOREIGN KEY, UNIQUErules_actiontype(id)
idsmallint unsignedNOPRIMARY KEY
namevarchar(50)NOUNIQUE

rules_actiontaskassigneeuser

Tables that connect action tasks and assignee users.

ColumnTypeNullableConstraintReferencesComment
action_idint unsignedNOFOREIGN KEY, PRIMARY KEYrules_action(id)
user_idintNOFOREIGN KEYauth_user(id)

rules_actiontaskassigneeuserrole

Tables that connect action tasks and a user role id.

ColumnTypeNullableConstraintReferencesComment
action_idint unsignedNOFOREIGN KEY, PRIMARY KEYrules_action(id)
user_role_idintNOFOREIGN KEYusers_userrole(id)

rules_actiontaskdurationdue

Tables that list action tasks, duration due.

ColumnTypeNullableConstraintReferencesComment
action_idint unsignedNOFOREIGN KEY, PRIMARY KEYrules_action(id)
duration_typevarchar(6)NO
duration_valuesmallint unsignedNO

rules_actiontaskreplyformtemplate

Tables that connect action tasks replies and form templates.

ColumnTypeNullableConstraintReferencesComment
action_idint unsignedNOFOREIGN KEY, PRIMARY KEYrules_action(id)
form_template_idintNOFOREIGN KEYforms_formtemplate(id)

rules_actiontaskreplytype

Tables that connect action tasks replies and task reply types.

ColumnTypeNullableConstraintReferencesComment
action_idint unsignedNOFOREIGN KEY, PRIMARY KEYrules_action(id)
task_reply_type_idsmallint unsignedYESFOREIGN KEYtasks_replytype(id)

rules_actiontaskreporteruser

Tables that connect action tasks and report users.

ColumnTypeNullableConstraintReferencesComment
action_idint unsignedNOFOREIGN KEY, PRIMARY KEYrules_action(id)
user_idintNOFOREIGN KEYauth_user(id)

rules_actiontype

Table that lists rules action types.

ColumnTypeNullableConstraintReferencesComment
idtinyint unsignedNOPRIMARY KEY
namevarchar(50)NO

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).

ColumnTypeNullableConstraintReferencesComment
condition_type_idsmallint unsignedNOFOREIGN KEYrules_conditiontype(id)
datalongtextNOA reference to the saved search.
idint unsignedNOPRIMARY KEY
ordersmallint unsignedYESShould only been NULL when updating for a rule.
rule_idint unsignedNOFOREIGN KEYrules_rule(id)

rules_conditiontype

Table that lists rules condition types.

ColumnTypeNullableConstraintReferencesComment
idsmallint unsignedNOPRIMARY KEY
namevarchar(50)NOUNIQUE

rules_formtemplate

Table that connects rules and form templates.

ColumnTypeNullableConstraintReferencesComment
form_template_idintNOFOREIGN KEY, UNIQUEforms_formtemplate(id)
idintNOPRIMARY KEY
rule_idint unsignedNOFOREIGN KEY, UNIQUErules_rule(id)

rules_priority

Table that lists rule priorities.

ColumnTypeNullableConstraintReferencesComment
idint unsignedNOPRIMARY KEY
namevarchar(55)NOUNIQUE

rules_rule

Main coordinating model for our product level triggers. When X (almost always submission creation) occurs, do Y (Action).

ColumnTypeNullableConstraintReferencesComment
company_idintYESFOREIGN KEYusers_company(id)
created_user_idintNOFOREIGN KEYauth_user(id)
datalongtextNOJSON representation of the data in this table. That is ONLY the columns in this table. This is for quick retrieving of the information.
date_createddatetimeNO
date_updateddatetimeNO
idint unsignedNOPRIMARY KEY
is_activetinyint(1)NO
is_enabledtinyint(1)NO
is_systemtinyint(1)NOSystem rules are not visible to end user and/or knowingly created to the user.
last_event_datetimedatetimeYES
titlevarchar(255)NO

rules_rulepriority

Table that connects rules and priorities.

ColumnTypeNullableConstraintReferencesComment
idint unsignedNOPRIMARY KEY
priority_idint unsignedNOFOREIGN KEYrules_priority(id)
rule_idint unsignedNOFOREIGN KEYrules_rule(id)

rules_savedsearch

Table that connects rules saved search.

ColumnTypeNullableConstraintReferencesComment
condition_idint unsignedYESFOREIGN KEY, UNIQUErules_condition(id)
idint unsignedNOPRIMARY KEY
rule_idint unsignedNOFOREIGN KEY, UNIQUErules_rule(id)This is denormalized, but will allow quicker way to get what rules use what saved searches.
saved_search_idint unsignedNOFOREIGN KEY, UNIQUEusers_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.

ColumnTypeNullableConstraintReferencesComment
idint unsignedNOPRIMARY KEY
rule_idint unsignedNOFOREIGN KEY, UNIQUErules_rule(id)
trigger_subtype_idsmallint unsignedNOFOREIGN KEY, UNIQUErules_triggersubtype(id)
trigger_type_idtinyint unsignedNOFOREIGN KEY, UNIQUErules_triggertype(id)

rules_triggersubtype

Table that lists trigger subtypes.

ColumnTypeNullableConstraintReferencesComment
idsmallint unsignedNOPRIMARY KEY
namevarchar(50)NOUNIQUE
trigger_type_idtinyint unsignedNOFOREIGN KEY, UNIQUErules_triggertype(id)

rules_triggertype

Table that lists trigger types.

ColumnTypeNullableConstraintReferencesComment
idtinyint unsignedNOPRIMARY KEY
namevarchar(50)YESUNIQUE

sensors_cooldown

Represents the cooldown object.

ColumnTypeNullableConstraintReferencesComment
location_idintNOFOREIGN KEYlocations_location(id)
company_idintNOFOREIGN KEYusers_company(id)
created_user_idintNOFOREIGN KEYauth_user(id)
date_createddatetimeYES
date_endeddatetimeYES
date_modifieddatetimeYES
date_starteddatetimeYES
foodvarchar(100)NO
idintNOPRIMARY KEY
is_activetinyint(1)NO
is_archivedtinyint(1)NO
namevarchar(100)NO
rule_idint unsignedNOFOREIGN KEYrules_rule(id)
sensor_idintNOFOREIGN KEYsensors_sensor(id)
statusvarchar(100)NOfield for the current state of the cool down process, values are: in_progress, failed, success
task_idint unsignedYESFOREIGN KEY, UNIQUEtasks_task(id)

sensors_cooldownstage

Represents the cooldown stage.

ColumnTypeNullableConstraintReferencesComment
cooldown_idintNOFOREIGN KEYsensors_cooldown(id)
date_processeddatetimeYES
date_readingdatetimeYES
idintNOPRIMARY KEY
is_activetinyint(1)NO
operator_idvarchar(100)NOLess than or less than or equal
reading_endingdoubleNO
reading_methodvarchar(100)YESField to identify the origin of the sensor reading, manual, probe, sensor.
reading_startingdoubleNO
seconds_from_startintNO
sensor_readingdoubleYES
stage_identifiervarchar(100)YESInitial, middle, final.
statusvarchar(100)YESfield for the current state of the cool down stage.

sensors_critical_notification_setting

Class to hold sensor critical notification settings.

ColumnTypeNullableConstraintReferencesComment
delivery_type_idsmallint unsignedNOFOREIGN KEYusers_usernotificationsettingdeliverytype(id)Delivery type id, email, push, SMS, etc.
idint unsignedNOPRIMARY KEY
user_idintNOFOREIGN KEY, UNIQUEauth_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.

ColumnTypeNullableConstraintReferencesComment
date_createddatetimeNO
gateway_idintYESFOREIGN KEYsensors_gateway(id)
idint unsignedNOPRIMARY KEY
is_onlinetinyint(1)NO
sensor_idintYESFOREIGN KEYsensors_sensor(id)

sensors_gateway

Represents the gateway object.

ColumnTypeNullableConstraintReferencesComment
location_idintYESFOREIGN KEYlocations_location(id)
battery_levelintYESThe approximate battery level, [0, 100].
company_idintYESFOREIGN KEYusers_company(id)
created_user_idintYESFOREIGN KEYauth_user(id)
date_createddatetimeYES
date_modifieddatetimeYES
external_keyvarchar(100)NOWhen an user registers a new sensor using the mobile app we ask for an id that usually is in a label in the device.
gateway_typevarchar(100)NOAn english product name string representing the type of gateway.
idintNOPRIMARY KEY
integration_idintYESFOREIGN KEYsensors_integration(id)
is_activetinyint(1)NO
is_enabledtinyint(1)NO
is_onlinetinyint(1)NO
last_active_datedatetimeYES
manufacturervarchar(100)YESThe manufacturer name to use. For example: "monnit", "laird"
namevarchar(100)NOA descriptive name for this gateway.
secondary_keyvarchar(100)NOFor 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

sensors_gatewaybreach

Represents table gateway breach model.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEYusers_company(id)
date_closeddatetimeYES
date_createddatetimeNO
date_openeddatetimeNO
date_updateddatetimeNO
gateway_idintNOFOREIGN KEYsensors_gateway(id)
idint unsignedNOPRIMARY KEY
rule_idint unsignedNOFOREIGN KEYrules_rule(id)
trigger_subtype_idsmallint unsignedNOFOREIGN KEYrules_triggersubtype(id)

sensors_gatewaybreach_notifications

Table that connects gateway breaches and notifications

ColumnTypeNullableConstraintReferencesComment
gatewaybreach_idint unsignedNOFOREIGN KEY, UNIQUEsensors_gatewaybreach(id)Gateway breach id.
idintNOPRIMARY KEYIdentifier
notification_idint unsignedNOFOREIGN KEY, UNIQUEnotifications_notification_new(id)Notification id.

sensors_gatewaybreach_tasks

Table that connects gateway breaches and tasks

ColumnTypeNullableConstraintReferencesComment
gatewaybreach_idint unsignedNOFOREIGN KEY, UNIQUEsensors_gatewaybreach(id)Gateway breach id
idintNOPRIMARY KEYIdentifier
task_idint unsignedNOFOREIGN KEY, UNIQUEtasks_task(id)Task id

sensors_integration

A single integration between a company and an integration provider.

ColumnTypeNullableConstraintReferencesComment
client_account_idvarchar(75)YESUNIQUE
client_idvarchar(75)YES
client_secretvarchar(75)YES
company_idintNOFOREIGN KEYusers_company(id)
date_createddatetimeYES
date_modifieddatetimeYES
idintNOPRIMARY KEY
integration_typevarchar(50)NOTempAlert, Monnit, BluV2, The Things Industries, Senet Digi, MachineQ.
is_activetinyint(1)NO

sensors_integration_accounts

Table that connects integrations and accounts.

ColumnTypeNullableConstraintReferencesComment
location_idintNOFOREIGN KEY, UNIQUElocations_location(id)Location id
idintNOPRIMARY KEYIdentifier
integration_idintNOFOREIGN KEY, UNIQUEsensors_integration(id)Integration id

sensors_rulemetadata

Table that lists sensor rule metadata.

ColumnTypeNullableConstraintReferencesComment
idint unsignedNOPRIMARY KEY
is_defaulttinyint(1)NO
rule_idint unsignedNOFOREIGN KEYrules_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.

ColumnTypeNullableConstraintReferencesComment
location_idintYESFOREIGN KEYlocations_location(id)
batteryintYES
company_idintNOFOREIGN KEYusers_company(id)
created_user_idintYESFOREIGN KEYauth_user(id)
date_createddatetimeYES
date_modifieddatetimeYES
equipment_location_idbigintYESFOREIGN KEYequipment_equipmentlocation(id)
external_keyvarchar(100)NO
idintNOPRIMARY KEY
integration_idintNOFOREIGN KEYsensors_integration(id)
is_activetinyint(1)NO
is_configuredtinyint(1)NO
is_enabledtinyint(1)NO
is_onlinetinyint(1)NO
join_keyvarchar(100)NO
last_reading_datedatetimeYES
last_reading_valuedoubleYES
manufacturervarchar(100)YES
namevarchar(100)NO
placement_idintNOFOREIGN KEYsensors_sensorplacement(id)
secondary_keyvarchar(100)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.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEYusers_company(id)
date_closeddatetimeYES
date_createddatetimeNO
date_openeddatetimeNO
date_updateddatetimeNO
idint unsignedNOPRIMARY KEY
rule_idint unsignedNOFOREIGN KEYrules_rule(id)
sensor_idintNOFOREIGN KEYsensors_sensor(id)
trigger_subtype_idsmallint unsignedNOFOREIGN KEYrules_triggersubtype(id)

sensors_sensorbreach_notifications

Table that connects sensor breaches and notifications.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEYIdentifier
notification_idint unsignedNOFOREIGN KEY, UNIQUEnotifications_notification_new(id)Notification id
sensorbreach_idint unsignedNOFOREIGN KEY, UNIQUEsensors_sensorbreach(id)Sensor breach id

sensors_sensorbreach_tasks

Table that connects sensor breaches and tasks.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEYIdentifier
sensorbreach_idint unsignedNOFOREIGN KEY, UNIQUEsensors_sensorbreach(id)Sensor breach id
task_idint unsignedNOFOREIGN KEY, UNIQUEtasks_task(id)Task id

sensors_sensorplacement

The various generalized places a sensor might be placed at a physical location.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEY, UNIQUEusers_company(id)
date_createddatetimeYES
date_modifieddatetimeYES
idintNOPRIMARY KEY
namevarchar(50)NOUNIQUEA generalized location some hardware sensor might be placed within the physical location. For example, "Walk-in Cooler"
uses_simulated_temperaturetinyint(1)NO

sensors_sensorplacementnickname

Nicknames that can be used by a placement to automatically name sensors.

ColumnTypeNullableConstraintReferencesComment
date_createddatetimeYES
date_modifieddatetimeYES
idintNOPRIMARY KEY
namevarchar(50)NOUNIQUEAssigning nicknames change the naming system for new sensors in this placement. Existing sensors retain their custom names set by end users.
placement_idintNOFOREIGN KEY, UNIQUEsensors_sensorplacement(id)

tasks_follower

Table that connects tasks and users.

ColumnTypeNullableConstraintReferencesComment
idint unsignedNOPRIMARY KEY
task_idint unsignedNOFOREIGN KEY, UNIQUEtasks_task(id)
user_idintNOFOREIGN KEY, UNIQUEauth_user(id)

tasks_replyformtemplate

Many-to-many table that connects tasks and form_templates.

ColumnTypeNullableConstraintReferencesComment
form_template_idintNOFOREIGN KEYforms_formtemplate(id)
task_idint unsignedNOFOREIGN KEY, PRIMARY KEYtasks_task(id)

tasks_replytype

Describes the types of replies.

ColumnTypeNullableConstraintReferencesComment
idsmallint unsignedNOPRIMARY KEY
namevarchar(50)NOUNIQUEOptions: click_done, form_submission, quick.

tasks_statustype

Describes the tasks statuses.

ColumnTypeNullableConstraintReferencesComment
idsmallint unsignedNOPRIMARY KEY
namevarchar(50)NOUNIQUEIncomplete, Completed
ordersmallint unsignedNOUNIQUEOrder of the status(1,2).
valuevarchar(50)NOUNIQUEOpen, Closed

tasks_task

Describes the list of tasks. 'active_incomplete': is_active = True, is_closed = False 'archived_incomplete': is_active = False, is_closed = False 'complete': is_active = False, is_closed = True 'deleted': deleted = True, is_active = False, is_closed = False

ColumnTypeNullableConstraintReferencesComment
location_idintYESFOREIGN KEYlocations_location(id)
archived_user_idintYESFOREIGN KEYauth_user(id)
assignee_user_idintYESFOREIGN KEYauth_user(id)
company_idintNOFOREIGN KEYusers_company(id)
created_event_idint unsignedYESFOREIGN KEYevents_event(id)The event that created this task, if any
created_rule_idint unsignedYESFOREIGN KEYrules_rule(id)The rule that created this task, if any
datalongtextNO
date_archiveddatetimeYES
date_createddatetimeNO
date_deleteddatetimeYES
date_duedatetimeYES
date_due_localdatetimeYESLocalized datetime such that 7pm due date is the same value across all task timezones.
date_startdatetimeYESThe datetime the task should start, timezone aware.
date_start_localdatetimeYESLocalized datetime such that 7pm due start is the same value across all task timezones.
date_submitteddatetimeYES
date_updateddatetimeYES
deletedtinyint(1)NOIf True then the task was deleted do not show it, report on it, etc.
deleted_user_idintYESFOREIGN KEYauth_user(id)
descriptionmediumtextYES
fulfill_submission_idvarchar(24)YESFOREIGN KEYforms_submission(id)
fulfill_user_idintYESFOREIGN KEYauth_user(id)
idint unsignedNOPRIMARY KEY
is_activetinyint(1)NORepresents open/(close
is_closedtinyint(1)NORepresents whether or not a task has been fulfilled.
latdoubleYES
londoubleYES
project_idint unsignedYESFOREIGN KEYprojects_project(id)
reply_type_idsmallint unsignedNOFOREIGN KEYtasks_replytype(id)
reporter_user_idintYESFOREIGN KEYauth_user(id)
source_submission_idvarchar(24)YESFOREIGN KEYforms_submission(id)
task_status_type_idsmallint unsignedNOFOREIGN KEYtasks_statustype(id)
time_zonevarchar(40)YESThe time zone that this task is setup for.
titlevarchar(50)NO

temperature_profiles_temperaturecondition

Table that lists temperature conditions.

ColumnTypeNullableConstraintReferencesComment
acceptance_valueintNOValues: fail = -1, neutral = 0, pass = 1.
conditionvarchar(25)NOOptions: GT_OP, GTE_OP, LT_OP, LTE_OP, BETWEEN_OP, INCLUSIVE_BETWEEN_OP.
date_createddatetimeNO
date_modifieddatetimeNO
idintNOPRIMARY KEY
temperature_profile_idintNOFOREIGN KEYtemperature_profiles_temperatureprofile(id)
valuejsonYESValue, example: [20, 97] Holds the values - an array of numbers. Single value for all operators but between.

temperature_profiles_temperatureconditionfollowups

Table that lists temperature conditions follow up actions.

ColumnTypeNullableConstraintReferencesComment
date_createddatetimeNO
date_modifieddatetimeNO
idintNOPRIMARY KEY
is_requiredtinyint(1)NO
temperature_condition_idintNOFOREIGN KEYtemperature_profiles_temperaturecondition(id)

temperature_profiles_temperatureconditionfollowups_translation

Table that lists temperature conditions follow ups translation.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEYIdentifier
language_codevarchar(15)NOUNIQUELanguage code
master_idintYESFOREIGN KEY, UNIQUEtemperature_profiles_temperatureconditionfollowups(id)Master id
titlevarchar(500)NOTitle

temperature_profiles_temperatureprofile

Table that lists temperature profiles.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEY, UNIQUEusers_company(id)
date_createddatetimeNO
date_modifieddatetimeNO
external_keyvarchar(50)NOUNIQUE
idintNOPRIMARY KEY
is_activetinyint(1)NO
typeint unsignedNOOptions: Initial heating = 1, Holding = 2.

temperature_profiles_temperatureprofile_translation

Table that lists temperature profiles translations.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEYIdentifier
language_codevarchar(15)NOUNIQUELanguage code
master_idintYESFOREIGN KEY, UNIQUEtemperature_profiles_temperatureprofile(id)Master id
namevarchar(500)NOName

users_company

Base company record.

ColumnTypeNullableConstraintReferencesComment
all_locations_attribute_idintYESFOREIGN KEYlocations_attribute(id)Id of the location attribute that has all locations for the company.
all_team_idintYESFOREIGN KEYusers_teams(id)A system-created team that includes all user-created teams under it.
brand_idintYESFOREIGN KEYusers_companybrand(id)
date_createddatetimeYES
date_deactivateddatetimeYES
date_formatvarchar(50)YES
date_modifieddatetimeYES
distance_unitvarchar(50)YES
idintNOPRIMARY KEY
industry_idintYESFOREIGN KEYusers_companyindustry(id)Id of the associated users_companyindustry.
logo_urlvarchar(100)YES
namevarchar(50)YES
phonevarchar(20)YES
temperature_unitvarchar(50)YES
time_formatvarchar(50)YES
time_zonevarchar(40)YES

users_country

Available country codes.

ColumnTypeNullableConstraintReferencesComment
alpha_2varchar(2)NOPRIMARY KEY
alpha_3varchar(3)NO
namevarchar(255)NOUNIQUE

users_teams

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.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEY, UNIQUEusers_company(id)
created_user_idintYESFOREIGN KEYauth_user(id)
descriptionvarchar(255)NO
external_keyvarchar(255)YESUNIQUE
idintNOPRIMARY KEY
is_activetinyint(1)NO
is_editabletinyint(1)NO
is_privatetinyint(1)NO
lftint unsignedYESLeft tree level.
namevarchar(60)NO
parent_team_idintYESFOREIGN KEYusers_teams(id)
rgtintYESRight tree level.

users_team_locations

ColumnTypeNullableConstraintReferencesComment
location_idintNOFOREIGN KEY, UNIQUElocations_location(id)
team_idintNOFOREIGN KEY, UNIQUEusers_teams(id)
idintNOPRIMARY KEY

users_teamuser

Many to many through table relating users_distributegroup to auth_user.

ColumnTypeNullableConstraintReferencesComment
team_idintNOFOREIGN KEY, UNIQUEusers_teams(id)
idintNOPRIMARY KEY
user_idintNOFOREIGN KEY, UNIQUEauth_user(id)

users_savedsearch

A saved search which can be used to create reports.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEYusers_company(id)
created_user_idintNOFOREIGN KEYauth_user(id)
datalongtextNO
date_createddatetimeNO
date_modifieddatetimeNO
idint unsignedNOPRIMARY KEY
is_activetinyint(1)NO
modified_user_idintNOFOREIGN KEYauth_user(id)
namevarchar(255)NO
recurring_idint unsignedYESFOREIGN KEYschedules_recurring(id)
rule_idint unsignedYESFOREIGN KEYrules_rule(id)
saved_search_type_idsmallint unsignedNOFOREIGN KEYusers_savedsearchtype(id)

users_savedsearchtype

The saved search type of that Zenput creates, ie. form_template_submissions.

ColumnTypeNullableConstraintReferencesComment
abbreviationvarchar(5)NOUNIQUE
idsmallint unsignedNOPRIMARY KEY
titlevarchar(50)NOUNIQUE

users_savedsearchusage

Many to many through table relating saved searches and search usage types.

ColumnTypeNullableConstraintReferencesComment
idint unsignedNOPRIMARY KEY
saved_search_idint unsignedNOFOREIGN KEY, UNIQUEusers_savedsearch(id)
search_usage_type_idsmallint unsignedNOFOREIGN KEY, UNIQUEusers_searchusagetype(id)

users_searchusagetype

Search usage types.

ColumnTypeNullableConstraintReferencesComment
idsmallint unsignedNOPRIMARY KEY
namevarchar(50)NO

users_sharedsavedsearch

Saved searches that are shared with reporting companies.

ColumnTypeNullableConstraintReferencesComment
copying_user_idintNOFOREIGN KEYauth_user(id)
date_copieddatetimeYES
date_createddatetimeYES
date_modifieddatetimeYES
idint unsignedNOPRIMARY KEY
source_saved_search_idint unsignedNOFOREIGN KEY, UNIQUEusers_savedsearch(id)
target_company_idintYESFOREIGN KEY, UNIQUEusers_company(id)
target_saved_search_idint unsignedNOFOREIGN KEYusers_savedsearch(id)

users_usernotificationsetting

Holds user notification settings.

ColumnTypeNullableConstraintReferencesComment
delivery_type_idsmallint unsignedNOFOREIGN KEYusers_usernotificationsettingdeliverytype(id)
idint unsignedNOPRIMARY KEY
trigger_subtype_idsmallint unsignedNOFOREIGN KEY, UNIQUErules_triggersubtype(id)
trigger_type_idtinyint unsignedNOFOREIGN KEY, UNIQUErules_triggertype(id)
user_idintNOFOREIGN KEY, UNIQUEauth_user(id)

users_usernotificationsettingdeliverytype

The methods available for sending a notification to someone. Includes email, push, SMS, etc.

ColumnTypeNullableConstraintReferencesComment
idsmallint unsignedNOPRIMARY KEY
namevarchar(50)YESUNIQUE

users_userprofile

Additional user information. 1 to 1 with the users_user table.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEY, UNIQUEusers_company(id)
date_deactivateddatetimeYES
date_inviteddatetimeYES
date_redeemeddatetimeYES
default_dashboard_idint unsignedYESFOREIGN KEYdashboards_dashboard(id)If set, this is the default dashboard the user will see when going to the dashboard page.
default_team_idintYESFOREIGN KEYusers_teams(id)Default team for the user when displaying pages.
display_namevarchar(60)YES
external_keyvarchar(50)YESUNIQUE
idintNOPRIMARY KEY
localevarchar(5)NOThe users preferred locale for the UI display in <ISO-639 Language Codes>_<ISO-3166 Country Codes>, defaults en-US.
temperature_unitvarchar(1)YES
time_zonevarchar(40)NO
user_idintNOFOREIGN KEY, UNIQUEauth_user(id)
user_role_idintYESFOREIGN KEYusers_userrole(id)

users_userrole

Custom user roles.

ColumnTypeNullableConstraintReferencesComment
company_idintNOFOREIGN KEY, UNIQUEusers_company(id)
default_permission_idintNOFOREIGN KEYauth_permissiongroup(id)
idintNOPRIMARY KEY
is_activetinyint(1)NO
namevarchar(255)NOUNIQUE

users_userrolehierarchy

Hierarchical company user roles using nested set pattern.

ColumnTypeNullableConstraintReferencesComment
idintNOPRIMARY KEY
levelint unsignedNO
lftint unsignedNO
parent_idintYESFOREIGN KEYusers_userrolehierarchy(id)
rgtint unsignedNO
tree_idint unsignedNO
user_role_idintNOFOREIGN KEY, UNIQUEusers_userrole(id)