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. |
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. |
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. |
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) | |
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. |
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 | {'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_id | String | Used to associate a submission to a form_submission. |
deleted | Boolean | Indicates if the submission has been deleted. |
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 |
| 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_teams(id) | |
Table that connects announcements and user roles.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
announcement_id | int unsigned | NO | FOREIGN KEY, UNIQUE | announcements_announcement(id) | Announcement id |
userrole_id | int | NO | FOREIGN KEY, UNIQUE | users_userrole(id) | User role id |
Table that connects announcements and users.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
announcement_id | int unsigned | NO | FOREIGN KEY, UNIQUE | announcements_announcement(id) | Announcement id |
user_id | int | NO | FOREIGN KEY, UNIQUE | auth_user(id) | User id |
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) | |
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | |
name | varchar(150) | NO | UNIQUE | | |
Basic user information
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
last_login | datetime | YES | | | Date of last login |
username | varchar(150) | NO | UNIQUE | | Username |
first_name | varchar(150) | NO | | | First name |
last_name | varchar(150) | NO | | | First name |
email | varchar(100) | NO | | | Email |
is_active | tinyint(1) | NO | | | Whether the user is deleted or not |
date_joined | datetime | NO | | | Date created |
Relates users to an auth_group.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
user_id | int | NO | FOREIGN KEY, UNIQUE | auth_user(id) | Associated user id |
group_id | int | NO | FOREIGN KEY, UNIQUE | auth_permissiongroup(id) | associated user group id |
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) | |
Table that connects comments and form submissions.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int unsigned | NO | PRIMARY KEY | | |
is_tag | 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. |
Table that connects comments and tasks.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int unsigned | NO | PRIMARY KEY | | |
is_tag | tinyint(1) | NO | | | |
comment_id | int unsigned | NO | FOREIGN KEY | comments_comment(id) | |
task_id | int unsigned | NO | FOREIGN KEY | tasks_task(id) | |
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) | |
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 | | | |
Table that connects comments and user.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int unsigned | NO | PRIMARY KEY | | |
is_tag | tinyint(1) | NO | | | |
comment_id | int unsigned | NO | FOREIGN KEY | comments_comment(id) | |
user_id | int | NO | FOREIGN KEY | auth_user(id) | |
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) | |
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_companyhierarchy_id | int | YES | FOREIGN KEY | companies_companyhierarchy(id) | |
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) | |
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) | |
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 | | | |
Table that connects an equipment with a category.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
equipment_id | int | NO | FOREIGN KEY, UNIQUE | equipment_equipment(id) | Equipment id |
equipmentcategory_id | int | NO | FOREIGN KEY, UNIQUE | equipment_equipmentcategory(id) | Category id |
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) | |
Table that lists the equipment category translations.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
language_code | varchar(15) | NO | UNIQUE | | Language code. |
name | varchar(100) | NO | | | Translated name |
master_id | int | YES | FOREIGN KEY, UNIQUE | equipment_equipmentcategory(id) | Master id |
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. |
equipment_id | int | NO | FOREIGN KEY | equipment_equipment(id) | |
location_id | int | NO | FOREIGN KEY | locations_location(id) | |
external_key | varchar(50) | YES | UNIQUE | | |
is_active | tinyint(1) | NO | | | |
company_id | int | YES | FOREIGN KEY, UNIQUE | users_company(id) | |
Table that connects equipment locations with temperature profiles.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | bigint | NO | PRIMARY KEY | | Identifier |
equipmentlocation_id | bigint | NO | FOREIGN KEY, UNIQUE | equipment_equipmentlocation(id) | Equipment location id. |
temperatureprofile_id | int | NO | FOREIGN KEY, UNIQUE | temperature_profiles_temperatureprofile(id) | Temperature profile id |
Through table for company and events.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
company_id | int | NO | FOREIGN KEY, PRIMARY KEY | users_company(id) | |
event_id | int unsigned | NO | FOREIGN KEY, PRIMARY KEY | events_event(id) | |
Through table for cooldown sensors and events.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | |
cooldown_id | int | NO | FOREIGN KEY | sensors_cooldown(id) | |
event_id | int unsigned | NO | FOREIGN KEY | events_event(id) | |
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) | |
Many to many table for event actions subtypes and events table
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
event_id | int unsigned | NO | FOREIGN KEY, UNIQUE | events_event(id) | References events. |
actionsubtype_id | smallint unsigned | NO | FOREIGN KEY, UNIQUE | rules_actionsubtype(id) | References event action subtypes. |
Many to many table between the sensors_gateway and events_event table.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
event_id | int unsigned | NO | FOREIGN KEY, UNIQUE | events_event(id) | References events. |
gateway_id | int | NO | FOREIGN KEY, UNIQUE | sensors_gateway(id) | References sensors gateway. |
Many to many table between the sensors_sensor and events_event table.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
event_id | int unsigned | NO | FOREIGN KEY, UNIQUE | events_event(id) | References events. |
sensor_id | int | NO | FOREIGN KEY, UNIQUE | sensors_sensor(id) | References sensor. |
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) | |
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) | |
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) | |
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) | |
| 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) | |
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) | |
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) | |
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) | |
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_teams(id) | |
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) | |
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) | |
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_companyhierarchy_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) | |
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) | |
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 | | |
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) | |
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) | |
| 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 | | | |
Translation records for form categories. This is used to store form category names.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
language_code | varchar(15) | NO | UNIQUE | | Language code. Currently only in en-us as of 4/29/25 |
name | varchar(50) | NO | | | Translation string |
master_id | int | YES | FOREIGN KEY, UNIQUE | forms_formcategory(id) | Id of the related table: forms_formcategory |
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) | |
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_teams(id) | |
form_template_id | int | NO | FOREIGN KEY, UNIQUE | forms_formtemplate(id) | |
form_parent_team_id | int | YES | FOREIGN KEY, UNIQUE | users_teams(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) |
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) | |
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 |
Used for which saved searches (reports) to reactivate when the associated forms_formtemplate is reactivated.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
formtemplate_id | int | NO | FOREIGN KEY, UNIQUE | forms_formtemplate(id) | Form template id |
savedsearch_id | int unsigned | NO | FOREIGN KEY, UNIQUE | users_savedsearch(id) | Saved search id |
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 | | |
Private form permission levels.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | |
name | varchar(40) | NO | | | |
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) | |
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. |
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': '', '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). |
deleted | Boolean | Indicates if the print job has been deleted. |
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) | |
Table that lists the allergen translations.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
language_code | varchar(15) | NO | UNIQUE | | Language code. |
allergen_label | varchar(2000) | NO | | | Translation string |
master_id | int | YES | FOREIGN KEY, UNIQUE | ingredients_allergenlabel(id) | Id of the related table: ingredients_allergenlabel |
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 | | | |
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) | |
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. |
Table that lists the category translations.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
language_code | varchar(15) | NO | UNIQUE | | Language code. |
name | varchar(100) | NO | | | Translation string |
master_id | int | YES | FOREIGN KEY, UNIQUE | ingredients_category(id) | Master id |
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) | |
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) | |
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 | | |
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. |
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. |
Many-to-many table that joins ingredients to categories.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
ingredient_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_ingredient(id) | Id of the ingredient |
category_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_category(id) | Id of the ingredient category |
Table that lists the ingredient translations.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
language_code | varchar(15) | NO | UNIQUE | | Language code. |
name | varchar(100) | NO | | | Translation string |
master_id | int | YES | FOREIGN KEY, UNIQUE | ingredients_ingredient(id) | Id of the related table: ingredients_ingredient |
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) | |
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) | |
Table that lists which ingredients are available in which locations.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | |
ingredient_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_ingredient(id) | |
location_id | int | NO | FOREIGN KEY, UNIQUE | locations_location(id) | |
default_unit_of_measure_id | int | YES | FOREIGN KEY | ingredients_unitofmeasure(id) | |
is_active | tinyint(1) | NO | | | |
Table that maps ingredient locations to temperature profiles.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
ingredientlocation_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_ingredientlocation(id) | Id of the related table: ingredients_ingredientlocation. |
temperatureprofile_id | int | NO | FOREIGN KEY, UNIQUE | temperature_profiles_temperatureprofile(id) | Id of the related table: temperature_profiles_temperatureprofile. |
Table that maps ingredient locations to units of measure.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
ingredientlocation_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_ingredientlocation(id) | Id of the related table: ingredients_ingredientlocation. |
unitofmeasure_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_unitofmeasure(id) | Id of the related table: ingredients_unitofmeasure. |
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) | |
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). |
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. |
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 | | | |
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 | | | |
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) | |
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) | |
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) | |
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 | | | |
Table maps template fields to templates.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
templatefield_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_templatefield(id) | Ingreadient template field Id |
template_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_template(id) | Ingredient template Id |
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 | | |
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 | | | |
Table that maps ingredient template groups to companies.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
templategroup_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_templategroup(id) | Template group Id |
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | Company Id |
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) | |
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) | |
Table that lists the unit of measure translations.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
language_code | varchar(15) | NO | UNIQUE | | Language code |
name | varchar(500) | NO | | | Translation string |
master_id | int | YES | FOREIGN KEY, UNIQUE | ingredients_unitofmeasure(id) | Id of the related table: ingredients_unitofmeasure |
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 | | |
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 | | | |
| 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) | |
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) | |
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) | |
This class represents different reference types for a locations calendar.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | |
key | varchar(50) | NO | UNIQUE | | |
company_id | int | YES | FOREIGN KEY, UNIQUE | users_company(id) | |
is_active | tinyint(1) | NO | | | |
Table that lists Location calendar event type translations.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
language_code | varchar(15) | NO | UNIQUE | | Language Code |
description | varchar(500) | NO | | | Description |
master_id | int | YES | FOREIGN KEY, UNIQUE | locations_locationcalendareventtype(id) | Master id |
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) | |
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) | |
| 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) | |
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) | |
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. |
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) | |
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. |
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) | |
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) | |
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 | | | |
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. |
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_teams(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. |
Many-to-many table that connects projects and location attributes.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
project_id | int unsigned | NO | FOREIGN KEY, UNIQUE | projects_project(id) | Project id |
attribute_id | int | NO | FOREIGN KEY, UNIQUE | locations_attribute(id) | Attribute id |
Many-to-many table that lists locations that tasks will be generated for when task generation begins.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
project_id | int unsigned | NO | FOREIGN KEY, UNIQUE | projects_project(id) | Project id |
location_id | int | NO | FOREIGN KEY, UNIQUE | locations_location(id) | Location id |
Table that connects projects and users.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
project_id | int unsigned | NO | FOREIGN KEY, UNIQUE | projects_project(id) | Project id |
user_id | int | NO | FOREIGN KEY, UNIQUE | auth_user(id) | User id |
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. |
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) | |
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) | |
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) | |
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) | |
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) | |
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) | |
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) | |
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 | | | |
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) | |
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) | |
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) | |
Table that lists rules action types.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | tinyint unsigned | NO | PRIMARY KEY | | |
name | varchar(50) | NO | UNIQUE | | |
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) | |
Table that lists rules condition types.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | smallint unsigned | NO | PRIMARY KEY | | |
name | varchar(50) | NO | UNIQUE | | |
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) | |
Table that lists rule priorities.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int unsigned | NO | PRIMARY KEY | | |
name | varchar(55) | NO | UNIQUE | | |
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 | | | |
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) | |
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) | |
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) | |
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) | |
Table that lists trigger types.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | tinyint unsigned | NO | PRIMARY KEY | | |
name | varchar(50) | NO | UNIQUE | | |
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) | |
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 | | | |
stage_identifier | varchar(100) | YES | | | Initial, middle, final. |
reading_method | varchar(100) | YES | | | Field to identify the origin of the sensor reading, manual, probe, sensor. |
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) | |
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) | |
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 | | | |
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 | | | |
Table that connects gateway breaches and notifications
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
gatewaybreach_id | int unsigned | NO | FOREIGN KEY, UNIQUE | sensors_gatewaybreach(id) | Gateway breach id. |
notification_id | int unsigned | NO | FOREIGN KEY, UNIQUE | notifications_notification_new(id) | Notification id. |
Table that connects gateway breaches and tasks
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
gatewaybreach_id | int unsigned | NO | FOREIGN KEY, UNIQUE | sensors_gatewaybreach(id) | Gateway breach id |
task_id | int unsigned | NO | FOREIGN KEY, UNIQUE | tasks_task(id) | Task id |
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_account_id | varchar(75) | YES | UNIQUE | | |
Table that connects integrations and accounts.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
integration_id | int | NO | FOREIGN KEY, UNIQUE | sensors_integration(id) | Integration id |
location_id | int | NO | FOREIGN KEY, UNIQUE | locations_location(id) | Location id |
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) | |
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 | | | |
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 | | | |
Table that connects sensor breaches and notifications.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
sensorbreach_id | int unsigned | NO | FOREIGN KEY, UNIQUE | sensors_sensorbreach(id) | Sensor breach id |
notification_id | int unsigned | NO | FOREIGN KEY, UNIQUE | notifications_notification_new(id) | Notification id |
Table that connects sensor breaches and tasks.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
sensorbreach_id | int unsigned | NO | FOREIGN KEY, UNIQUE | sensors_sensorbreach(id) | Sensor breach id |
task_id | int unsigned | NO | FOREIGN KEY, UNIQUE | tasks_task(id) | Task id |
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 | | | |
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) | |
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) | |
Many-to-many table that connects tasks and form_templates.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
task_id | int unsigned | NO | FOREIGN KEY, PRIMARY KEY | tasks_task(id) | |
form_template_id | int | NO | FOREIGN KEY | forms_formtemplate(id) | |
Describes the types of replies.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | smallint unsigned | NO | PRIMARY KEY | | |
name | varchar(50) | NO | UNIQUE | | Options: click_done, form_submission, quick. |
Describes the tasks statuses.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | smallint unsigned | NO | PRIMARY KEY | | |
name | varchar(50) | NO | UNIQUE | | Incomplete, Completed |
value | varchar(50) | NO | UNIQUE | | Open, Closed |
order | smallint unsigned | NO | UNIQUE | | Order of the status(1,2). |
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
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int unsigned | NO | PRIMARY KEY | | |
title | varchar(50) | NO | | | |
description | mediumtext | YES | | | |
date_created | datetime | NO | | | |
date_updated | datetime | YES | | | |
date_due | datetime | YES | | | |
date_submitted | datetime | YES | | | |
is_closed | tinyint(1) | NO | | | Represents whether or not a task has been fulfilled. |
is_active | tinyint(1) | NO | | | Represents open/(close |
data | longtext | NO | | | |
lat | double | YES | | | |
lon | double | YES | | | |
date_start | datetime | YES | | | The datetime the task should start, timezone aware. |
time_zone | varchar(40) | YES | | | The time zone that this task is setup for. |
location_id | int | YES | FOREIGN KEY | locations_location(id) | |
assignee_user_id | int | YES | FOREIGN KEY | auth_user(id) | |
company_id | int | NO | FOREIGN KEY | users_company(id) | |
created_event_id | int unsigned | YES | FOREIGN KEY | events_event(id) | |
created_rule_id | int unsigned | YES | FOREIGN KEY | rules_rule(id) | |
fulfill_submission_id | char(24) | YES | FOREIGN KEY | forms_submission(id) | |
fulfill_user_id | int | YES | FOREIGN KEY | auth_user(id) | |
project_id | int unsigned | YES | FOREIGN KEY | projects_project(id) | |
reply_type_id | smallint unsigned | NO | FOREIGN KEY | tasks_replytype(id) | |
reporter_user_id | int | YES | FOREIGN KEY | auth_user(id) | |
source_submission_id | char(24) | YES | FOREIGN KEY | forms_submission(id) | |
task_status_type_id | smallint unsigned | NO | FOREIGN KEY | tasks_statustype(id) | |
date_due_local | datetime | YES | | | Localized datetime such that 7pm due date is the same value across all task timezones. |
date_start_local | datetime | YES | | | Localized datetime such that 7pm due start is the same value across all task timezones. |
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 task was deleted do not show it, report on it, etc. |
deleted_user_id | int | YES | FOREIGN KEY | auth_user(id) | |
Table that lists temperature conditions.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | |
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
condition | varchar(25) | NO | | | Options: GT_OP, GTE_OP, LT_OP, LTE_OP, BETWEEN_OP, INCLUSIVE_BETWEEN_OP. |
value | json | YES | | | Value, example: [20, 97] Holds the values - an array of numbers. Single value for all operators but between. |
acceptance_value | int | NO | | | Values: fail = -1, neutral = 0, pass = 1. |
temperature_profile_id | int | NO | FOREIGN KEY | temperature_profiles_temperatureprofile(id) | |
Table that lists temperature conditions follow up actions.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | |
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
temperature_condition_id | int | NO | FOREIGN KEY | temperature_profiles_temperaturecondition(id) | |
is_required | tinyint(1) | NO | | | |
Table that lists temperature conditions follow ups translation.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
language_code | varchar(15) | NO | UNIQUE | | Language code |
title | varchar(500) | NO | | | Title |
master_id | int | YES | FOREIGN KEY, UNIQUE | temperature_profiles_temperatureconditionfollowups(id) | Master id |
Table that lists temperature profiles.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | |
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
external_key | varchar(50) | NO | UNIQUE | | |
is_active | tinyint(1) | NO | | | |
type | int unsigned | NO | | | Options: Initial heating = 1, Holding = 2. |
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | |
Table that lists temperature profiles translations.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
language_code | varchar(15) | NO | UNIQUE | | Language code |
name | varchar(500) | NO | | | Name |
master_id | int | YES | FOREIGN KEY, UNIQUE | temperature_profiles_temperatureprofile(id) | Master id |
Base company record.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | |
name | varchar(50) | YES | | | |
phone | varchar(20) | YES | | | |
logo_url | varchar(100) | YES | | | |
time_zone | varchar(40) | YES | | | |
date_created | datetime | YES | | | |
date_modified | datetime | YES | | | |
date_deactivated | datetime | YES | | | |
all_locations_attribute_id | int | YES | FOREIGN KEY | locations_attribute(id) | Id of the location attribute that has all locations for the company. |
all_team_id | int | YES | FOREIGN KEY | users_teams(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 | | | |
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 | | | |
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_teams(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) | |
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | |
team_id | int | NO | FOREIGN KEY, UNIQUE | users_teams(id) | |
location_id | int | NO | FOREIGN KEY, UNIQUE | locations_location(id) | |
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_teams(id) | |
user_id | int | NO | FOREIGN KEY, UNIQUE | auth_user(id) | |
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) | |
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 | | |
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) | |
Search usage types.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | smallint unsigned | NO | PRIMARY KEY | | |
name | varchar(50) | NO | | | |
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) | |
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) | |
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 | | |
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_teams(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 | | | |
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_permissiongroup(id) | |
Hierarchical company user roles using nested set pattern.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | |
lft | int unsigned | NO | | | |
rgt | int unsigned | NO | | | |
tree_id | int unsigned | NO | | | |
level | int unsigned | NO | | | |
parent_id | int | YES | FOREIGN KEY | users_userrolehierarchy(id) | |
user_role_id | int | NO | FOREIGN KEY, UNIQUE | users_userrole(id) | |