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 |
|---|
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. |
date_created | datetime | YES | | | Date activity was created. |
date_modified | datetime | YES | | | Most recent modification date (defaults to created date). |
form_template_id | int | NO | FOREIGN KEY | forms_formtemplate(id) | What form template is associated with this activity. |
id | int unsigned | NO | PRIMARY KEY | | Identifier |
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. |
name | mediumtext | NO | | | Name of activity, automatically created from form template name. |
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. |
template_category_id | int | NO | FOREIGN KEY | forms_formtemplatecategory(id) | Default is uncategorized, associates an activity with a template category. |
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 |
|---|
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. |
id | int unsigned | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | Is the activity active (1) or archived (0) |
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 |
|---|
activity_id | int unsigned | NO | FOREIGN KEY | activities_activity(id) | The activity is associated with this template. |
data | json | NO | | | json of all fields including how fields should be shown and how they interact with each other. |
date_created | datetime | YES | | | When was the activity template created. |
date_modified | datetime | YES | | | When was the activity template last modified. |
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). |
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. |
name | mediumtext | NO | | | Comes from the name of the form. |
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 |
|---|
activity_template_id | int unsigned | NO | FOREIGN KEY, UNIQUE | activities_activitytemplate(id) | |
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. |
id | int unsigned | NO | PRIMARY KEY | | |
location_id | int | NO | FOREIGN KEY, UNIQUE | locations_location(id) | |
modified_user_id | int | NO | FOREIGN KEY | auth_user(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 |
|---|
copying_user_id | int | NO | FOREIGN KEY | auth_user(id) | Who shared the form. |
date_copied | datetime | YES | | | Date it was copied. |
date_created | datetime | YES | | | Date it was created. |
date_modified | datetime | YES | | | Date it was last modified. |
id | int unsigned | NO | PRIMARY KEY | | |
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 |
|---|
attachments | json | YES | | | |
company_id | int | NO | FOREIGN KEY | users_company(id) | |
created_user_id | int | NO | FOREIGN KEY | auth_user(id) | |
date_created | datetime | YES | | | |
date_modified | datetime | YES | | | |
date_scheduled | datetime | YES | | | |
id | int unsigned | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
is_editable | tinyint(1) | NO | | | Is this announcement editable, true only while the announcement is not yet live. |
location_attributes | json | YES | | | |
message | mediumtext | YES | | | |
queue_item_id | int unsigned | YES | FOREIGN KEY | schedules_queue(id) | |
scope | varchar(255) | NO | | | Brand or Company |
title | mediumtext | YES | | | |
| Column | Type | Nullable | Constraint | References | Comment |
|---|
announcement_id | int unsigned | NO | FOREIGN KEY, UNIQUE | announcements_announcement(id) | |
team_id | int | NO | FOREIGN KEY, UNIQUE | users_teams(id) | |
id | int | NO | PRIMARY KEY | | |
Table that connects announcements and user roles.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
announcement_id | int unsigned | NO | FOREIGN KEY, UNIQUE | announcements_announcement(id) | Announcement id |
id | int | NO | PRIMARY KEY | | Identifier |
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 |
|---|
announcement_id | int unsigned | NO | FOREIGN KEY, UNIQUE | announcements_announcement(id) | Announcement id |
id | int | NO | PRIMARY KEY | | Identifier |
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 |
|---|
announcement_id | int unsigned | NO | FOREIGN KEY, UNIQUE | announcements_announcement(id) | |
date_end | datetime | NO | | | |
date_stopped | datetime | YES | | | |
id | int unsigned | NO | PRIMARY KEY | | |
status | varchar(50) | NO | | | Options: Scheduled, Live, Ended, Stopped, Deleted |
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 |
|---|
date_joined | datetime | NO | | | Date created |
email | varchar(100) | NO | | | Email |
first_name | varchar(150) | NO | | | First name |
id | int | NO | PRIMARY KEY | | Identifier |
is_active | tinyint(1) | NO | | | Whether the user is deleted or not |
last_login | datetime | YES | | | Date of last login |
last_name | varchar(150) | NO | | | First name |
username | varchar(150) | NO | UNIQUE | | Username |
Relates users to an auth_group.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
group_id | int | NO | FOREIGN KEY, UNIQUE | auth_permissiongroup(id) | associated user group id |
id | int | NO | PRIMARY KEY | | Identifier |
user_id | int | NO | FOREIGN KEY, UNIQUE | auth_user(id) | Associated user id |
Describes the list of comments. Comments can be made on submissions and tasks.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
created_user_id | int | NO | FOREIGN KEY | auth_user(id) | |
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
id | int unsigned | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
message | varchar(3000) | YES | | | |
topic_id | int unsigned | NO | FOREIGN KEY | comments_topic(id) | |
Table that connects comments and form submissions.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
comment_id | int unsigned | NO | FOREIGN KEY | comments_comment(id) | |
id | int unsigned | NO | PRIMARY KEY | | |
is_tag | tinyint(1) | NO | | | |
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 |
|---|
comment_id | int unsigned | NO | FOREIGN KEY | comments_comment(id) | |
id | int unsigned | NO | PRIMARY KEY | | |
is_tag | tinyint(1) | NO | | | |
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 |
|---|
date_created | datetime | NO | | | |
date_last_read | datetime | NO | | | |
date_subscribed | datetime | NO | | | |
id | int unsigned | NO | PRIMARY KEY | | |
topic_id | int unsigned | NO | FOREIGN KEY, UNIQUE | comments_topic(id) | |
user_id | int | NO | FOREIGN KEY, UNIQUE | auth_user(id) | |
Table that connects comments and user.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
comment_id | int unsigned | NO | FOREIGN KEY | comments_comment(id) | |
id | int unsigned | NO | PRIMARY KEY | | |
is_tag | tinyint(1) | NO | | | |
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 |
|---|
accepted_user_id | int | NO | FOREIGN KEY, UNIQUE | auth_user(id) | |
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | |
date_accepted | datetime | NO | | | |
id | int | NO | PRIMARY KEY | | |
Hierarchical company association using nested set pattern.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | |
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
id | int | NO | PRIMARY KEY | | |
level | int unsigned | NO | | | |
lft | int unsigned | NO | | | |
parent_companyhierarchy_id | int | YES | FOREIGN KEY | companies_companyhierarchy(id) | |
rgt | int unsigned | NO | | | |
tree_id | int unsigned | NO | UNIQUE | | |
Table that lists the dashboards.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
created_user_id | int | NO | FOREIGN KEY | auth_user(id) | |
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
id | int unsigned | NO | PRIMARY KEY | | |
title | varchar(50) | NO | | | |
Table that lists the dashboards saved search.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
dashboard_id | int unsigned | NO | FOREIGN KEY | dashboards_dashboard(id) | |
id | int unsigned | NO | PRIMARY KEY | | |
order | smallint unsigned | NO | | | |
saved_search_id | int unsigned | NO | FOREIGN KEY | users_savedsearch(id) | |
Table that lists the equipment.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
company_id | int | YES | FOREIGN KEY, UNIQUE | users_company(id) | |
created_user_id | int | YES | FOREIGN KEY | auth_user(id) | |
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
description | mediumtext | YES | | | |
external_key | varchar(50) | YES | UNIQUE | | |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
manufacturer | varchar(100) | NO | | | |
model_name | varchar(100) | NO | | | |
Table that connects an equipment with a category.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
equipment_id | int | NO | FOREIGN KEY, UNIQUE | equipment_equipment(id) | Equipment id |
equipmentcategory_id | int | NO | FOREIGN KEY, UNIQUE | equipment_equipmentcategory(id) | Category id |
id | int | NO | PRIMARY KEY | | Identifier |
Table that lists the equipment categories.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
company_id | int | YES | FOREIGN KEY, UNIQUE | users_company(id) | |
created_user_id | int | YES | FOREIGN KEY | auth_user(id) | |
date_created | datetime | NO | | | |
external_key | varchar(50) | YES | UNIQUE | | |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
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. |
master_id | int | YES | FOREIGN KEY, UNIQUE | equipment_equipmentcategory(id) | Master id |
name | varchar(100) | NO | | | Translated name |
Assignment of equipment to a location with location specific information for that piece of equipment.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
company_id | int | YES | FOREIGN KEY, UNIQUE | users_company(id) | |
equipment_id | int | NO | FOREIGN KEY | equipment_equipment(id) | |
external_key | varchar(50) | YES | UNIQUE | | |
id | bigint | NO | PRIMARY KEY | | |
identifier | varchar(255) | YES | | | A unique description to help uniquely identify this equipment instance. |
is_active | tinyint(1) | NO | | | |
location_id | int | NO | FOREIGN KEY | locations_location(id) | |
location_zone | varchar(255) | YES | | | A text description of where this equipment exists within the specific location. |
Table that connects equipment locations with temperature profiles.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
equipmentlocation_id | bigint | NO | FOREIGN KEY, UNIQUE | equipment_equipmentlocation(id) | Equipment location id. |
id | bigint | NO | PRIMARY KEY | | Identifier |
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 |
|---|
cooldown_id | int | NO | FOREIGN KEY | sensors_cooldown(id) | |
event_id | int unsigned | NO | FOREIGN KEY | events_event(id) | |
id | int | NO | PRIMARY KEY | | |
The table lists out events regarding follow-up actions.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
data | longtext | NO | | | JSON data containing the details regarding follow up actions. |
date_created | datetime | NO | | | |
id | int unsigned | NO | PRIMARY KEY | | |
message | varchar(255) | YES | | | |
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 |
|---|
actionsubtype_id | smallint unsigned | NO | FOREIGN KEY, UNIQUE | rules_actionsubtype(id) | References event action subtypes. |
event_id | int unsigned | NO | FOREIGN KEY, UNIQUE | events_event(id) | References events. |
id | int | NO | PRIMARY KEY | | Identifier |
Many to many table between the sensors_gateway and events_event table.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
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. |
id | int | NO | PRIMARY KEY | | Identifier |
Many to many table between the sensors_sensor and events_event table.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
event_id | int unsigned | NO | FOREIGN KEY, UNIQUE | events_event(id) | References events. |
id | int | NO | PRIMARY KEY | | Identifier |
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 |
|---|
event_id | int unsigned | NO | FOREIGN KEY, PRIMARY KEY | events_event(id) | |
form_submission_id | char(24) | NO | FOREIGN KEY, PRIMARY KEY | forms_submission(id) | This is the Object id of the submission |
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 |
|---|
event_id | int unsigned | NO | FOREIGN KEY | events_event(id) | |
id | int unsigned | NO | PRIMARY KEY | | |
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 |
|---|
event_id | int unsigned | NO | FOREIGN KEY, UNIQUE | events_event(id) | |
id | int unsigned | NO | PRIMARY KEY | | |
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 |
|---|
event_id | int unsigned | NO | FOREIGN KEY | events_event(id) | |
id | int unsigned | NO | PRIMARY KEY | | |
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 |
|---|
event_id | int unsigned | NO | FOREIGN KEY | events_event(id) | |
id | int | NO | PRIMARY KEY | | |
sensor_form_submission_id | char(32) | NO | | | |
Through table for tasks and events.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
event_id | int unsigned | NO | FOREIGN KEY, PRIMARY KEY | events_event(id) | |
task_id | int unsigned | NO | FOREIGN KEY, PRIMARY KEY | tasks_task(id) | |
Through table for teams and events.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
team_id | int | NO | FOREIGN KEY, PRIMARY KEY | users_teams(id) | |
event_id | int unsigned | NO | FOREIGN KEY, PRIMARY KEY | events_event(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 |
|---|
activity_submission_id | varchar(25) | NO | UNIQUE | | Mongo id of the related activity submission. |
date_submitted | datetime | NO | | | |
form_template_id | int | NO | FOREIGN KEY | forms_formtemplate(id) | |
id | bigint | NO | PRIMARY KEY | | |
legacy_submission_id | varchar(25) | NO | UNIQUE | | Mongo legacy id of the submission. |
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 |
|---|
company_id | int | NO | FOREIGN KEY | users_company(id) | |
date_created | datetime | YES | | | |
id | int unsigned | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | Is the form active (1) or archived (0). |
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 |
|---|
company_id | int | NO | FOREIGN KEY | users_company(id) | |
data | json | NO | | | |
date_created | datetime | YES | | | |
field_id | int unsigned | NO | FOREIGN KEY | fields_field(id) | |
field_type | char(255) | NO | FOREIGN KEY | fields_fieldtype(type) | |
id | int unsigned | NO | PRIMARY KEY | | |
is_primary | tinyint(1) | NO | | | |
title | mediumtext | NO | | | |
Relational table between form templates and form categories. This is currently functioning as a 1:1 relationship.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
form_category_id | int | NO | FOREIGN KEY | forms_formcategory(id) | |
form_template_id | int | NO | FOREIGN KEY, UNIQUE | forms_formtemplate(id) | |
id | int | NO | PRIMARY KEY | | |
| Column | Type | Nullable | Constraint | References | Comment |
|---|
company_id | int | NO | FOREIGN KEY | users_company(id) | |
id | int | NO | PRIMARY KEY | | |
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 |
master_id | int | YES | FOREIGN KEY, UNIQUE | forms_formcategory(id) | Id of the related table: forms_formcategory |
name | varchar(50) | NO | | | Translation string |
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 |
|---|
form_template_id | int | NO | FOREIGN KEY, UNIQUE | forms_formtemplate(id) | |
id | int | NO | PRIMARY KEY | | |
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 |
|---|
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. |
id | int | NO | PRIMARY KEY | | |
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 |
|---|
form_template_id | int | NO | FOREIGN KEY, UNIQUE | forms_formtemplate(id) | |
id | int | NO | PRIMARY KEY | | |
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 |
|---|
company_id | int | NO | FOREIGN KEY | users_company(id) | |
data | longtext | NO | | | A JSON dictionary defining various form values and all the form’s fields' specifics. |
date_created | datetime | YES | | | |
date_last_submitted | datetime | YES | | | |
date_updated | datetime | YES | | | |
deleted | tinyint(1) | NO | | | |
form_template_type_id | smallint unsigned | NO | FOREIGN KEY | forms_formtemplatetype(id) | |
id | int | NO | PRIMARY KEY | | |
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. |
num_submissions | int | NO | | | Number of submissions made with this form |
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. |
is_fbc_audit | tinyint(1) | NO | | | Whether to show submissions made on this form on the FBC Audits page |
title | varchar(255) | NO | | | |
user_id | int | NO | FOREIGN KEY | auth_user(id) | |
Used for which saved searches (reports) to reactivate when the associated forms_formtemplate is reactivated.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
formtemplate_id | int | NO | FOREIGN KEY, UNIQUE | forms_formtemplate(id) | Form template id |
id | int | NO | PRIMARY KEY | | Identifier |
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 |
|---|
form_template_id | int | NO | FOREIGN KEY | forms_formtemplate(id) | |
id | int unsigned | NO | PRIMARY KEY | | |
saved_search_id | int unsigned | NO | FOREIGN KEY, UNIQUE | users_savedsearch(id) | |
Record of form submissions.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
company_id | int | YES | FOREIGN KEY | users_company(id) | |
date_submitted | datetime | NO | | | |
date_submitted_local | datetime | YES | | | Local datetime when submitted. |
distance_to_location | double | YES | | | Miles between the submission lat/lon and the location lat/lon. |
form_template_id | int | NO | FOREIGN KEY | forms_formtemplate(id) | |
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. |
lat | double | YES | | | Device latitude at time of hitting submit. |
lon | double | YES | | | Device longitude at time of hitting submit. |
num_failures | int | YES | | | The number questions with acceptance_value = -1. |
num_images | int | NO | | | |
questions_answered | int | NO | | | |
submitted_user_id | int | NO | FOREIGN KEY | auth_user(id) | |
time_to_complete | int | YES | | | Milliseconds delta between date_created and date_completed. |
time_zone | varchar(40) | YES | | | Submission timezone. |
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 |
|---|
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
id | int | NO | PRIMARY KEY | | |
ingredient_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_ingredient(id) | |
Table that lists the allergen translations.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
allergen_label | varchar(2000) | NO | | | Translation string |
id | int | NO | PRIMARY KEY | | Identifier |
language_code | varchar(15) | NO | UNIQUE | | Language code. |
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 |
|---|
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | |
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
name | varchar(200) | 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_id | int | YES | FOREIGN KEY | ingredients_catalog(id) | |
ingredient_catalog_subscriber_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | |
Table that lists ingredient categories.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
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 |
color | varchar(6) | NO | | | Hex color value for displaying the category color. |
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | |
created_user_id | int | NO | FOREIGN KEY | auth_user(id) | |
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
external_key | varchar(100) | YES | UNIQUE | | Key used to link the Crunchtime value to the customer’s internal systems. |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
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. |
master_id | int | YES | FOREIGN KEY, UNIQUE | ingredients_category(id) | Master id |
name | varchar(100) | NO | | | Translation string |
Table that lists categories that are disabled for specific companies.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
category_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_category(id) | |
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | |
id | int | NO | PRIMARY KEY | | |
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 |
|---|
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | |
id | int | NO | PRIMARY KEY | | |
label_type | varchar(75) | NO | | | The type of label to order (low-adhesive or dissolvable), Default is Low-Adhesive. |
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 |
|---|
activities_support | tinyint(1) | NO | | | Whether or not this ingredient is used by the Activities feature. |
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | |
created_user_id | int | NO | FOREIGN KEY | auth_user(id) | |
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
external_key | varchar(100) | YES | UNIQUE | | Key used to link the Crunchtime value to the customer’s internal systems. |
has_expiration | tinyint(1) | NO | | | |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
labels_support | tinyint(1) | NO | | | Whether or not this ingredient is used by the Zenput Labels application. |
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 |
production_sheets_support | tinyint(1) | NO | | | Whether or not this ingredient is used by the Production Sheets application. |
template_group_id | int | YES | FOREIGN KEY | ingredients_templategroup(id) | |
Many-to-many table that joins ingredients to categories.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
category_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_category(id) | Id of the ingredient category |
id | int | NO | PRIMARY KEY | | Identifier |
ingredient_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_ingredient(id) | Id of the ingredient |
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. |
master_id | int | YES | FOREIGN KEY, UNIQUE | ingredients_ingredient(id) | Id of the related table: ingredients_ingredient |
name | varchar(100) | NO | | | Translation string |
Table that lists the ClearView external key for ingredients. Used only by Production Sheets for tracking waste.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
clearview_external_key | varchar(100) | NO | | | |
id | int | NO | PRIMARY KEY | | |
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 |
|---|
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | |
id | int | NO | PRIMARY KEY | | |
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 |
|---|
default_unit_of_measure_id | int | YES | FOREIGN KEY | ingredients_unitofmeasure(id) | |
id | int | NO | PRIMARY KEY | | |
ingredient_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_ingredient(id) | |
is_active | tinyint(1) | NO | | | |
location_id | int | NO | FOREIGN KEY, UNIQUE | locations_location(id) | |
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 |
|---|
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
expiration_date_type_id | smallint unsigned | YES | FOREIGN KEY | ingredients_expirationdatetype(id) | |
expiration_type_id | smallint unsigned | NO | FOREIGN KEY | ingredients_expirationtype(id) | |
expiration_unit | varchar(11) | YES | | | Days, weeks, months, etc. |
expiration_value | int | YES | | | How many units. |
id | int | NO | PRIMARY KEY | | |
ingredient_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_ingredient(id) | |
is_active | tinyint(1) | NO | | | |
location_id | int | NO | FOREIGN KEY, UNIQUE | locations_location(id) | |
phase_type_id | int | YES | FOREIGN KEY, UNIQUE | ingredients_phasetype(id) | |
Table that contains information on where to send ordered labels.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
location_id | int | YES | FOREIGN KEY | locations_location(id) | |
address | varchar(75) | NO | | | Recipient address. |
address2 | varchar(75) | YES | | | Recipient address 2. |
brand_id | int | YES | FOREIGN KEY | users_companybrand(id) | |
city | varchar(75) | NO | | | Recipient city. |
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) | |
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
email | varchar(75) | NO | | | Recipient email. |
id | int | NO | PRIMARY KEY | | |
label_type | varchar(75) | YES | | | The label size (1x1, 2x1, 2x2). |
media | varchar(50) | NO | | | The type of label (low-adhesive, dissolvable). |
phone | varchar(75) | NO | | | Recipient phone. |
quantity | int | YES | | | How many items where ordered. |
state | varchar(75) | NO | | | Recipient state. |
zipcode | varchar(10) | NO | | | Recipient zipcode. |
Table contains information on an ingredient phase.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | |
date_created | datetime | NO | | | |
date_label | varchar(24) | YES | | | The name for the type of date that is printed on the label |
date_modified | datetime | NO | | | |
duration_type | varchar(11) | YES | | | Days, weeks, months, etc. |
duration_type_step_two | varchar(11) | YES | | | Days, weeks, months, etc., for the second step in a two-step expiration ingredient phase. |
duration_value | int | YES | | | How many units. |
duration_value_step_two | int | YES | | | How many units for the second step in a two-step expiration phase. |
expiration_date_type_id | smallint unsigned | YES | FOREIGN KEY | ingredients_expirationdatetype(id) | |
expiration_type_id | smallint unsigned | NO | FOREIGN KEY | ingredients_expirationtype(id) | |
id | int | NO | PRIMARY KEY | | |
ingredient_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_ingredient(id) | |
is_active | tinyint(1) | NO | | | |
phase_type_id | int | YES | FOREIGN KEY, UNIQUE | ingredients_phasetype(id) | |
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. |
template_group_id | int | YES | FOREIGN KEY | ingredients_templategroup(id) | |
Table that lists the [optional] phase attributes.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
is_required | tinyint(1) | NO | | | |
name | varchar(50) | NO | UNIQUE | | |
phase_type_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_phasetype(id) | |
Table that lists the phase attribute options.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
name | varchar(50) | NO | UNIQUE | | |
phase_attribute_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_phaseattribute(id) | |
Table that lists the selected attribute option.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | |
phase_attribute_option_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_phaseattributeoption(id) | |
phase_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_phase(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 |
|---|
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) | |
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
display_name | varchar(50) | NO | | | |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
name | varchar(50) | NO | | | Value that the user sets when creating the phase. |
order | smallint unsigned | YES | UNIQUE | | The order in which to display this phase type. |
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 |
|---|
data | varchar(1024) | NO | | | The ZPL for the template. This includes tokens for the template fields. |
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
id | int | NO | PRIMARY KEY | | |
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 |
|---|
break_twice | tinyint(1) | NO | | | |
description | varchar(1024) | NO | | | The ZPL for the template. This includes tokens for the template fields. |
field_type | int | NO | FOREIGN KEY | ingredients_templatefieldtype(id) | |
id | int | NO | PRIMARY KEY | | |
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. |
Table maps template fields to templates.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
template_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_template(id) | Ingredient template Id |
templatefield_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_templatefield(id) | Ingreadient template field 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 |
|---|
description | varchar(1024) | NO | | | |
id | int | NO | PRIMARY KEY | | |
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 |
|---|
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
description | varchar(1024) | NO | | | |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
name | varchar(128) | NO | UNIQUE | | |
Table that maps ingredient template groups to companies.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | Company Id |
id | int | NO | PRIMARY KEY | | Identifier |
templategroup_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_templategroup(id) | Template group 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 |
|---|
company_id | int | NO | FOREIGN KEY | users_company(id) | |
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. |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
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 |
master_id | int | YES | FOREIGN KEY, UNIQUE | ingredients_unitofmeasure(id) | Id of the related table: ingredients_unitofmeasure |
name | varchar(500) | NO | | | Translation string |
Attributes are keywords or terms that end users can assign to a location.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | |
external_key | varchar(50) | YES | UNIQUE | | |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | Describes if the attribute has been deleted by a user or not. |
is_editable | tinyint(1) | NO | | | Dictates whether or not locations can be removed/added from this attribute. |
name | varchar(100) | NO | UNIQUE | | |
Lists all relevant information pertaining to locations.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
address | varchar(100) | NO | | | |
city | varchar(100) | NO | | | |
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | |
country_id | varchar(2) | YES | FOREIGN KEY | users_country(alpha_2) | |
date_created | datetime | YES | | | |
date_deactivated | datetime | YES | | | |
date_modified | datetime | YES | | | |
email | varchar(500) | YES | | | |
external_key | varchar(100) | YES | UNIQUE | | |
full_text_search | varchar(1000) | NO | | | Allows searching of location based on email, location name, state, country and etc. |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
lat | double | YES | | | |
lon | double | YES | | | |
name | varchar(100) | NO | | | |
phone | varchar(20) | YES | | | |
region | varchar(50) | YES | | | |
state | varchar(50) | NO | | | |
temperature_unit | varchar(1) | YES | | | |
time_zone | varchar(40) | YES | | | |
zipcode | varchar(40) | YES | | | |
| Column | Type | Nullable | Constraint | References | Comment |
|---|
location_id | int | NO | FOREIGN KEY, UNIQUE | locations_location(id) | |
id | int | NO | PRIMARY KEY | | |
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 |
|---|
calendar_event_type_id | int | NO | FOREIGN KEY, UNIQUE | locations_locationcalendareventtype(id) | |
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. |
id | int | NO | PRIMARY KEY | | |
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 |
|---|
calendar_event_type_id | int | NO | FOREIGN KEY, UNIQUE | locations_locationcalendareventtype(id) | |
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. |
id | int | NO | PRIMARY KEY | | |
location_id | int | NO | FOREIGN KEY, UNIQUE | locations_location(id) | |
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. |
This class represents different reference types for a locations calendar.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
company_id | int | YES | FOREIGN KEY, UNIQUE | users_company(id) | |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
key | varchar(50) | NO | UNIQUE | | |
Table that lists Location calendar event type translations.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
description | varchar(500) | NO | | | Description |
id | int | NO | PRIMARY KEY | | Identifier |
language_code | varchar(15) | NO | UNIQUE | | Language Code |
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 |
|---|
location_id | int | NO | FOREIGN KEY, UNIQUE | locations_location(id) | |
id | int | NO | PRIMARY KEY | | |
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 |
|---|
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) | |
date_created | datetime | YES | | | |
date_modified | datetime | YES | | | |
date_seen | datetime | YES | | | |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | is_active is currently used for marking announcements as resent. |
recipient_user_id | int | NO | FOREIGN KEY | auth_user(id) | |
target_type | varchar(255) | NO | | | Is this an Announcement, Task, or Submission? |
Who the notification is notifying.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
delivery_type_id | smallint unsigned | NO | FOREIGN KEY | users_usernotificationsettingdeliverytype(id) | |
email | varchar(75) | YES | | | |
id | int unsigned | NO | PRIMARY KEY | | |
notification_id | int unsigned | NO | FOREIGN KEY | notifications_notification_new(id) | |
notification_type | varchar(50) | NO | | | Internal OR external. |
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 |
|---|
approved_local_username | varchar(20) | YES | | | |
approved_user_id | int | YES | FOREIGN KEY | auth_user(id) | |
date | date | NO | UNIQUE | | What date is the sheet for. |
date_approved | datetime | YES | | | |
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
location_id | int | NO | FOREIGN KEY, UNIQUE | locations_location(id) | |
modified_local_username | varchar(20) | NO | | | |
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 |
|---|
amount_made | double | YES | | | |
amount_wasted | double | YES | | | |
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
date_modified_local | 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. |
id | int | NO | PRIMARY KEY | | |
modified_local_username | varchar(20) | NO | | | |
modified_user_id | int | NO | FOREIGN KEY | auth_user(id) | |
parent_entry_id | int | YES | FOREIGN KEY | production_sheets_sheetentry(id) | Id of the same table. |
sheet_ingredient_id | int | NO | FOREIGN KEY | production_sheets_sheetingredient(id) | |
temperature | double | YES | | | |
type | int unsigned | NO | | | 1 = Regular, 2 = Special Count. |
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 |
|---|
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
expiration_unit | varchar(11) | YES | | | |
expiration_value | int | YES | | | |
id | int | NO | PRIMARY KEY | | |
ingredient_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_ingredient(id) | |
modified_local_username | varchar(20) | NO | | | |
modified_user_id | int | NO | FOREIGN KEY | auth_user(id) | |
parent_sheet_ingredient_id | int | YES | FOREIGN KEY | production_sheets_sheetingredient(id) | |
recommended_amount_to_make | double | YES | | | |
sheet_id | int | NO | FOREIGN KEY, UNIQUE | production_sheets_sheet(id) | |
unit_of_measure_id | int | NO | FOREIGN KEY | ingredients_unitofmeasure(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 |
|---|
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
day_of_week | int | NO | UNIQUE | | Day of the week(0 - 6), 0 = Monday |
id | int | NO | PRIMARY KEY | | |
ingredient_id | int | NO | FOREIGN KEY, UNIQUE | ingredients_ingredient(id) | |
is_active | tinyint(1) | NO | | | |
location_id | int | NO | FOREIGN KEY, UNIQUE | locations_location(id) | |
modified_local_username | varchar(20) | NO | | | |
modified_user_id | int | NO | FOREIGN KEY | auth_user(id) | |
recommended_amount_to_make | double | YES | | | |
unit_of_measure_id | int | NO | FOREIGN KEY | ingredients_unitofmeasure(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 |
|---|
allow_any_user_fulfill | tinyint(1) | NO | | | |
archived_user_id | int | YES | FOREIGN KEY | auth_user(id) | |
company_id | int | NO | FOREIGN KEY | users_company(id) | |
create_tasks_data | mediumtext | YES | | | |
create_tasks_form_template_id | int | YES | FOREIGN KEY | forms_formtemplate(id) | |
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. |
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) | |
date_archived | datetime | YES | | | |
date_created | datetime | NO | | | |
date_deleted | datetime | YES | | | |
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. |
date_modified | datetime | NO | | | |
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. |
deleted | tinyint(1) | NO | | | |
deleted_user_id | int | YES | FOREIGN KEY | auth_user(id) | |
description | mediumtext | YES | | | |
frequency | int | YES | | | Yearly, Monthly, Weekly, Daily. |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | States whether the project is active/has not been archived. |
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. |
is_propagated | tinyint(1) | NO | | | |
project_type | varchar(255) | NO | | | The project type, it can be Location or User. |
recurring_data | json | YES | | | |
title | varchar(255) | 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 |
|---|
allow_any_user_fulfill | tinyint(1) | NO | | | |
archived_user_id | int | YES | FOREIGN KEY | auth_user(id) | |
company_id | int | NO | FOREIGN KEY | users_company(id) | |
create_tasks_data | mediumtext | YES | | | This is json representation of how to create the child projects (if recurring), or how this project was created. |
create_tasks_team_id | int | YES | FOREIGN KEY | users_teams(id) | This is the team to assign created tasks to. |
create_tasks_form_template_id | int | YES | FOREIGN KEY | forms_formtemplate(id) | |
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. |
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 assign created tasks to. |
created_user_id | int | NO | FOREIGN KEY | auth_user(id) | |
date_archived | datetime | YES | | | |
date_created | datetime | NO | | | |
date_deleted | datetime | YES | | | |
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. |
date_due_utc | datetime | YES | | | |
date_modified | datetime | NO | | | |
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. |
date_start_utc | 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) | |
description | mediumtext | YES | | | |
frequency | int | YES | | | 0 - YEARLY, 1 - MONTHLY, 2 - WEEKLY, 3 - DAILY |
id | int unsigned | NO | PRIMARY KEY | | |
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. |
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. |
is_future_project | tinyint(1) | NO | | | This states that the project was setup to run in the future. |
parent_project_id | int unsigned | YES | FOREIGN KEY | projects_project(id) | Id of the same table. |
project_type | varchar(255) | NO | | | The project type, it can be Location or User. |
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. |
title | varchar(255) | NO | | | |
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 |
|---|
location_id | int | NO | FOREIGN KEY, UNIQUE | locations_location(id) | Location id |
id | int | NO | PRIMARY KEY | | Identifier |
project_id | int unsigned | NO | FOREIGN KEY, UNIQUE | projects_project(id) | Project 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 |
|---|
copying_user_id | int | NO | FOREIGN KEY | auth_user(id) | |
date_copied | datetime | YES | | | |
date_created | datetime | YES | | | |
date_modified | datetime | YES | | | |
id | int unsigned | NO | PRIMARY KEY | | |
crosscompany_project_id | int | NO | FOREIGN KEY, UNIQUE | projects_crosscompanyproject(id) | ID of the cross company project that is being shared. |
target_company_id | int | YES | FOREIGN KEY, UNIQUE | users_company(id) | ID of the target company. |
target_project_id | int unsigned | NO | FOREIGN KEY | projects_project(id) | ID of the shared project. |
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 |
|---|
company_id | int | NO | FOREIGN KEY | users_company(id) | |
configuration | json | NO | | | |
created_user_id | int | NO | FOREIGN KEY | auth_user(id) | |
date_created | datetime | YES | | | |
date_updated | datetime | YES | | | |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
is_brandwide | tinyint(1) | NO | | | |
recipients_criteria | json | NO | | | |
recurring_id | int unsigned | YES | FOREIGN KEY, UNIQUE | schedules_recurring(id) | |
report_type | varchar(255) | NO | | | Choices are User Project Completion Recap and User Project with Failures. |
send_to_franchisee | tinyint(1) | NO | | | |
title | varchar(255) | NO | | | |
updated_user_id | int | YES | FOREIGN KEY | auth_user(id) | |
use_recipient_visibility | tinyint(1) | NO | | | |
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 |
|---|
action_subtype_id | smallint unsigned | NO | FOREIGN KEY | rules_actionsubtype(id) | |
action_type_id | tinyint unsigned | NO | FOREIGN KEY | rules_actiontype(id) | |
data | longtext | NO | | | JSON representation of the data for this action. This is for quick retrieving of the information. The information here can or cannot be represented in additional tables, ie. events_action_notify_user. |
id | int unsigned | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
order | smallint unsigned | YES | | | Sequence of actions. |
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 |
|---|
action_type_id | tinyint unsigned | NO | FOREIGN KEY, UNIQUE | rules_actiontype(id) | |
id | smallint unsigned | NO | PRIMARY KEY | | |
name | varchar(50) | NO | UNIQUE | | |
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 | | | |
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 |
|---|
condition_type_id | smallint unsigned | NO | FOREIGN KEY | rules_conditiontype(id) | |
data | longtext | NO | | | A reference to the saved search. |
id | int unsigned | NO | PRIMARY KEY | | |
order | smallint unsigned | YES | | | Should only been NULL when updating for a rule. |
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 |
|---|
form_template_id | int | NO | FOREIGN KEY, UNIQUE | forms_formtemplate(id) | |
id | int | NO | PRIMARY KEY | | |
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 |
|---|
company_id | int | YES | FOREIGN KEY | users_company(id) | |
created_user_id | int | NO | FOREIGN KEY | auth_user(id) | |
data | longtext | NO | | | JSON representation of the data in this table. That is ONLY the columns in this table. This is for quick retrieving of the information. |
date_created | datetime | NO | | | |
date_updated | datetime | NO | | | |
id | int unsigned | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
is_enabled | tinyint(1) | NO | | | |
is_system | tinyint(1) | NO | | | System rules are not visible to end user and/or knowingly created to the user. |
last_event_datetime | datetime | YES | | | |
title | varchar(255) | 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 |
|---|
condition_id | int unsigned | YES | FOREIGN KEY, UNIQUE | rules_condition(id) | |
id | int unsigned | NO | PRIMARY KEY | | |
rule_id | int unsigned | NO | FOREIGN KEY, UNIQUE | rules_rule(id) | This is denormalized, but will allow quicker way to get what rules use what saved searches. |
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) | YES | UNIQUE | | |
Represents the cooldown object.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
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) | |
date_created | datetime | YES | | | |
date_ended | datetime | YES | | | |
date_modified | datetime | YES | | | |
date_started | datetime | YES | | | |
food | varchar(100) | NO | | | |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
is_archived | tinyint(1) | NO | | | |
name | varchar(100) | NO | | | |
rule_id | int unsigned | NO | FOREIGN KEY | rules_rule(id) | |
sensor_id | int | NO | FOREIGN KEY | sensors_sensor(id) | |
status | varchar(100) | NO | | | field for the current state of the cool down process, values are: in_progress, failed, success |
task_id | int unsigned | YES | FOREIGN KEY, UNIQUE | tasks_task(id) | |
Represents the cooldown stage.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
cooldown_id | int | NO | FOREIGN KEY | sensors_cooldown(id) | |
date_processed | datetime | YES | | | |
date_reading | datetime | YES | | | |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
operator_id | varchar(100) | NO | | | Less than or less than or equal |
reading_ending | double | NO | | | |
reading_method | varchar(100) | YES | | | Field to identify the origin of the sensor reading, manual, probe, sensor. |
reading_starting | double | NO | | | |
seconds_from_start | int | NO | | | |
sensor_reading | double | YES | | | |
stage_identifier | varchar(100) | YES | | | Initial, middle, final. |
status | varchar(100) | YES | | | field for the current state of the cool down stage. |
Class to hold sensor critical notification settings.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
delivery_type_id | smallint unsigned | NO | FOREIGN KEY | users_usernotificationsettingdeliverytype(id) | Delivery type id, email, push, SMS, etc. |
id | int unsigned | NO | PRIMARY KEY | | |
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 |
|---|
date_created | datetime | NO | | | |
gateway_id | int | YES | FOREIGN KEY | sensors_gateway(id) | |
id | int unsigned | NO | PRIMARY KEY | | |
is_online | tinyint(1) | NO | | | |
sensor_id | int | YES | FOREIGN KEY | sensors_sensor(id) | |
Represents the gateway object.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
location_id | int | YES | FOREIGN KEY | locations_location(id) | |
battery_level | int | YES | | | The approximate battery level, [0, 100]. |
company_id | int | YES | FOREIGN KEY | users_company(id) | |
created_user_id | int | YES | FOREIGN KEY | auth_user(id) | |
date_created | datetime | YES | | | |
date_modified | datetime | YES | | | |
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. |
gateway_type | varchar(100) | NO | | | An english product name string representing the type of gateway. |
id | int | NO | PRIMARY KEY | | |
integration_id | int | YES | FOREIGN KEY | sensors_integration(id) | |
is_active | tinyint(1) | NO | | | |
is_enabled | tinyint(1) | NO | | | |
is_online | tinyint(1) | NO | | | |
last_active_date | datetime | YES | | | |
manufacturer | varchar(100) | YES | | | The manufacturer name to use. For example: "monnit", "laird" |
name | varchar(100) | NO | | | A descriptive name for this gateway. |
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 |
Represents table gateway breach model.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
company_id | int | NO | FOREIGN KEY | users_company(id) | |
date_closed | datetime | YES | | | |
date_created | datetime | NO | | | |
date_opened | datetime | NO | | | |
date_updated | datetime | NO | | | |
gateway_id | int | NO | FOREIGN KEY | sensors_gateway(id) | |
id | int unsigned | NO | PRIMARY KEY | | |
rule_id | int unsigned | NO | FOREIGN KEY | rules_rule(id) | |
trigger_subtype_id | smallint unsigned | NO | FOREIGN KEY | rules_triggersubtype(id) | |
Table that connects gateway breaches and notifications
| Column | Type | Nullable | Constraint | References | Comment |
|---|
gatewaybreach_id | int unsigned | NO | FOREIGN KEY, UNIQUE | sensors_gatewaybreach(id) | Gateway breach id. |
id | int | NO | PRIMARY KEY | | Identifier |
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 |
|---|
gatewaybreach_id | int unsigned | NO | FOREIGN KEY, UNIQUE | sensors_gatewaybreach(id) | Gateway breach id |
id | int | NO | PRIMARY KEY | | Identifier |
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 |
|---|
client_account_id | varchar(75) | YES | UNIQUE | | |
client_id | varchar(75) | YES | | | |
client_secret | varchar(75) | YES | | | |
company_id | int | NO | FOREIGN KEY | users_company(id) | |
date_created | datetime | YES | | | |
date_modified | datetime | YES | | | |
id | int | NO | PRIMARY KEY | | |
integration_type | varchar(50) | NO | | | TempAlert, Monnit, BluV2, The Things Industries, Senet Digi, MachineQ. |
is_active | tinyint(1) | NO | | | |
Table that connects integrations and accounts.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
location_id | int | NO | FOREIGN KEY, UNIQUE | locations_location(id) | Location id |
id | int | NO | PRIMARY KEY | | Identifier |
integration_id | int | NO | FOREIGN KEY, UNIQUE | sensors_integration(id) | Integration 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 |
|---|
location_id | int | YES | FOREIGN KEY | locations_location(id) | |
battery | int | YES | | | |
company_id | int | NO | FOREIGN KEY | users_company(id) | |
created_user_id | int | YES | FOREIGN KEY | auth_user(id) | |
date_created | datetime | YES | | | |
date_modified | datetime | YES | | | |
equipment_location_id | bigint | YES | FOREIGN KEY | equipment_equipmentlocation(id) | |
external_key | varchar(100) | NO | | | |
id | int | NO | PRIMARY KEY | | |
integration_id | int | NO | FOREIGN KEY | sensors_integration(id) | |
is_active | tinyint(1) | NO | | | |
is_configured | tinyint(1) | NO | | | |
is_enabled | tinyint(1) | NO | | | |
is_online | tinyint(1) | NO | | | |
join_key | varchar(100) | NO | | | |
last_reading_date | datetime | YES | | | |
last_reading_value | double | YES | | | |
manufacturer | varchar(100) | YES | | | |
name | varchar(100) | NO | | | |
placement_id | int | NO | FOREIGN KEY | sensors_sensorplacement(id) | |
secondary_key | varchar(100) | 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 |
|---|
company_id | int | NO | FOREIGN KEY | users_company(id) | |
date_closed | datetime | YES | | | |
date_created | datetime | NO | | | |
date_opened | datetime | NO | | | |
date_updated | datetime | NO | | | |
id | int unsigned | NO | PRIMARY KEY | | |
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) | |
Table that connects sensor breaches and notifications.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | Identifier |
notification_id | int unsigned | NO | FOREIGN KEY, UNIQUE | notifications_notification_new(id) | Notification id |
sensorbreach_id | int unsigned | NO | FOREIGN KEY, UNIQUE | sensors_sensorbreach(id) | Sensor breach 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 |
|---|
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | |
date_created | datetime | YES | | | |
date_modified | datetime | YES | | | |
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" |
uses_simulated_temperature | tinyint(1) | NO | | | |
Nicknames that can be used by a placement to automatically name sensors.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
date_created | datetime | YES | | | |
date_modified | datetime | YES | | | |
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. |
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 |
|---|
form_template_id | int | NO | FOREIGN KEY | forms_formtemplate(id) | |
task_id | int unsigned | NO | FOREIGN KEY, PRIMARY KEY | tasks_task(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 |
order | smallint unsigned | NO | UNIQUE | | Order of the status(1,2). |
value | varchar(50) | NO | UNIQUE | | Open, Closed |
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 |
|---|
location_id | int | YES | FOREIGN KEY | locations_location(id) | |
archived_user_id | int | YES | FOREIGN KEY | auth_user(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) | The event that created this task, if any |
created_rule_id | int unsigned | YES | FOREIGN KEY | rules_rule(id) | The rule that created this task, if any |
data | longtext | NO | | | |
date_archived | datetime | YES | | | |
date_created | datetime | NO | | | |
date_deleted | datetime | YES | | | |
date_due | datetime | YES | | | |
date_due_local | datetime | YES | | | Localized datetime such that 7pm due date is the same value across all task timezones. |
date_start | datetime | YES | | | The datetime the task should start, timezone aware. |
date_start_local | datetime | YES | | | Localized datetime such that 7pm due start is the same value across all task timezones. |
date_submitted | datetime | YES | | | |
date_updated | 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) | |
description | mediumtext | YES | | | |
fulfill_submission_id | varchar(24) | YES | FOREIGN KEY | forms_submission(id) | |
fulfill_user_id | int | YES | FOREIGN KEY | auth_user(id) | |
id | int unsigned | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | Represents open/(close |
is_closed | tinyint(1) | NO | | | Represents whether or not a task has been fulfilled. |
lat | double | YES | | | |
lon | double | YES | | | |
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 | varchar(24) | YES | FOREIGN KEY | forms_submission(id) | |
task_status_type_id | smallint unsigned | NO | FOREIGN KEY | tasks_statustype(id) | |
time_zone | varchar(40) | YES | | | The time zone that this task is setup for. |
title | varchar(50) | NO | | | |
Table that lists temperature conditions.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
acceptance_value | int | NO | | | Values: fail = -1, neutral = 0, pass = 1. |
condition | varchar(25) | NO | | | Options: GT_OP, GTE_OP, LT_OP, LTE_OP, BETWEEN_OP, INCLUSIVE_BETWEEN_OP. |
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
id | int | NO | PRIMARY KEY | | |
temperature_profile_id | int | NO | FOREIGN KEY | temperature_profiles_temperatureprofile(id) | |
value | json | YES | | | Value, example: [20, 97] Holds the values - an array of numbers. Single value for all operators but between. |
Table that lists temperature conditions follow up actions.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
id | int | NO | PRIMARY KEY | | |
is_required | tinyint(1) | NO | | | |
temperature_condition_id | int | NO | FOREIGN KEY | temperature_profiles_temperaturecondition(id) | |
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 |
master_id | int | YES | FOREIGN KEY, UNIQUE | temperature_profiles_temperatureconditionfollowups(id) | Master id |
title | varchar(500) | NO | | | Title |
Table that lists temperature profiles.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | |
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
external_key | varchar(50) | NO | UNIQUE | | |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
type | int unsigned | NO | | | Options: Initial heating = 1, Holding = 2. |
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 |
master_id | int | YES | FOREIGN KEY, UNIQUE | temperature_profiles_temperatureprofile(id) | Master id |
name | varchar(500) | NO | | | Name |
Base company record.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
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) | |
date_created | datetime | YES | | | |
date_deactivated | datetime | YES | | | |
date_format | varchar(50) | YES | | | |
date_modified | datetime | YES | | | |
distance_unit | varchar(50) | YES | | | |
id | int | NO | PRIMARY KEY | | |
industry_id | int | YES | FOREIGN KEY | users_companyindustry(id) | Id of the associated users_companyindustry. |
logo_url | varchar(100) | YES | | | |
name | varchar(50) | YES | | | |
phone | varchar(20) | YES | | | |
temperature_unit | varchar(50) | YES | | | |
time_format | varchar(50) | YES | | | |
time_zone | varchar(40) | YES | | | |
Available country codes.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
alpha_2 | varchar(2) | NO | PRIMARY KEY | | |
alpha_3 | varchar(3) | NO | | | |
name | varchar(255) | NO | UNIQUE | | |
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 |
|---|
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | |
created_user_id | int | YES | FOREIGN KEY | auth_user(id) | |
description | varchar(255) | NO | | | |
external_key | varchar(255) | YES | UNIQUE | | |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
is_editable | tinyint(1) | NO | | | |
is_private | tinyint(1) | NO | | | |
lft | int unsigned | YES | | | Left tree level. |
name | varchar(60) | NO | | | |
parent_team_id | int | YES | FOREIGN KEY | users_teams(id) | |
rgt | int | YES | | | Right tree level. |
| Column | Type | Nullable | Constraint | References | Comment |
|---|
location_id | int | NO | FOREIGN KEY, UNIQUE | locations_location(id) | |
team_id | int | NO | FOREIGN KEY, UNIQUE | users_teams(id) | |
id | int | NO | PRIMARY KEY | | |
Many to many through table relating users_distributegroup to auth_user.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
team_id | int | NO | FOREIGN KEY, UNIQUE | users_teams(id) | |
id | int | NO | PRIMARY KEY | | |
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 |
|---|
company_id | int | NO | FOREIGN KEY | users_company(id) | |
created_user_id | int | NO | FOREIGN KEY | auth_user(id) | |
data | longtext | NO | | | |
date_created | datetime | NO | | | |
date_modified | datetime | NO | | | |
id | int unsigned | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
modified_user_id | int | NO | FOREIGN KEY | auth_user(id) | |
name | varchar(255) | NO | | | |
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 |
|---|
abbreviation | varchar(5) | NO | UNIQUE | | |
id | smallint unsigned | NO | PRIMARY KEY | | |
title | varchar(50) | 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 |
|---|
copying_user_id | int | NO | FOREIGN KEY | auth_user(id) | |
date_copied | datetime | YES | | | |
date_created | datetime | YES | | | |
date_modified | datetime | YES | | | |
id | int unsigned | NO | PRIMARY KEY | | |
source_saved_search_id | int unsigned | NO | FOREIGN KEY, UNIQUE | users_savedsearch(id) | |
target_company_id | int | YES | FOREIGN KEY, UNIQUE | users_company(id) | |
target_saved_search_id | int unsigned | NO | FOREIGN KEY | users_savedsearch(id) | |
Holds user notification settings.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
delivery_type_id | smallint unsigned | NO | FOREIGN KEY | users_usernotificationsettingdeliverytype(id) | |
id | int unsigned | NO | PRIMARY KEY | | |
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) | YES | UNIQUE | | |
Additional user information. 1 to 1 with the users_user table.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | |
date_deactivated | datetime | YES | | | |
date_invited | datetime | YES | | | |
date_redeemed | datetime | YES | | | |
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. |
display_name | varchar(60) | YES | | | |
external_key | varchar(50) | YES | UNIQUE | | |
id | int | NO | PRIMARY KEY | | |
locale | varchar(5) | NO | | | The users preferred locale for the UI display in <ISO-639 Language Codes>_<ISO-3166 Country Codes>, defaults en-US. |
temperature_unit | varchar(1) | YES | | | |
time_zone | varchar(40) | NO | | | |
user_id | int | NO | FOREIGN KEY, UNIQUE | auth_user(id) | |
user_role_id | int | YES | FOREIGN KEY | users_userrole(id) | |
Custom user roles.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
company_id | int | NO | FOREIGN KEY, UNIQUE | users_company(id) | |
default_permission_id | int | NO | FOREIGN KEY | auth_permissiongroup(id) | |
id | int | NO | PRIMARY KEY | | |
is_active | tinyint(1) | NO | | | |
name | varchar(255) | NO | UNIQUE | | |
Hierarchical company user roles using nested set pattern.
| Column | Type | Nullable | Constraint | References | Comment |
|---|
id | int | NO | PRIMARY KEY | | |
level | int unsigned | NO | | | |
lft | int unsigned | NO | | | |
parent_id | int | YES | FOREIGN KEY | users_userrolehierarchy(id) | |
rgt | int unsigned | NO | | | |
tree_id | int unsigned | NO | | | |
user_role_id | int | NO | FOREIGN KEY, UNIQUE | users_userrole(id) | |