Skip to main content

PixelSense MySQL Schema

PixelSense MySQL Schema​

1. Overview​

This page describes the PixelSense MySQL database: what each table stores, what each column means, and how the tables connect. The database schema is called pixelsense_dev and runs on MySQL 8 (InnoDB engine, utf8mb4 character set).

The full ER diagram is attached to this page as pixelsenseDb.mwb. Follow Section 2 to open it in MySQL Workbench, then use the rest of this page as a reading guide.

At a glance

ItemDetails
Schema namepixelsense_dev
Tables19
Triggers19 (one per table)
Stored procedures57
Model filepixelsenseDb.mwb (MySQL Workbench model, saved with Workbench 8.0)

Conventions used across the database

  • IDs are UUIDs. Every primary key is CHAR(36). If you insert a row without an ID, a trigger fills it in automatically.
  • Soft delete. The user and projects tables are never physically deleted from. They use an is_deleted flag (1 = deleted), so queries should filter on is_deleted = 0.
  • Numbers that mean something. Columns like status and role store small numbers. The meaning of each number is listed in the table sections below (the application maps them in Java enums).
  • Audit columns. Most tables have created_by / CREATEDBY and a created date. These point to the user table.
  • Naming styles are mixed. Some tables use snake_case (created_at), others use UPPER or PascalCase (CREATEDDATE, AdminUserId). Always use the exact spelling shown on this page.

2. How to view the ER diagram in MySQL Workbench​

You do not need a database connection or access to the live database. The .mwb file contains the whole design.

  1. Download the file. Click the attached file pixelsenseDb.mwb on this page and download it to your computer.
  2. Install MySQL Workbench (free), version 8.0 or newer, if you don't have it: Download MySQL Workbench
  3. Open the model. Start MySQL Workbench, then go to File → Open Model… (or press Ctrl + O) and pick pixelsenseDb.mwb. You can also double-click the file.
  4. Find the schema. The MySQL Model tab opens. Under Physical Schemas you will see two schemas: mydb (an empty default, ignore it) and pixelsense_dev. Expand pixelsense_dev to see Tables and Routines (stored procedures).
  5. Open the diagram. Under EER Diagrams, double-click EER Diagram.
  6. Move around. Zoom with Ctrl + mouse wheel or the zoom slider in the Model Navigator panel. Drag with the middle mouse button (or the hand tool) to pan. Lines between tables are foreign key relationships.
  7. See column and index details. Double-click any table. The table editor opens at the bottom with tabs for Columns, Indexes, Foreign Keys and Triggers. Primary key columns show a key icon.
  8. See stored procedures. In the MySQL Model tab, expand pixelsense_dev → Routines, then double-click a routine to read its code.
  9. Optional: save the diagram as an image. Go to File → Export → Export as PNG…

3. The big picture​

The tables fall into five groups:

GroupTablesWhat it covers
Users and accessuser, user_invitations, access_tokensWho can log in, who was invited, and API tokens
Admin settingsadminsettings, admin_custom_colors, custom_theme_colorsColour and baseline settings for admins
Projectsprojects, project_members, project_audit_logProjects, who belongs to them, and a history of changes
Tests and resultstest_features, image_entities, checkpoints, image_baselines, baseline_variants, comparisons, json_data, testassignmentsThe core of PixelSense: screenshots, baselines and comparison results
Visual locatorvisual_locator, visual_locator_imagesVisual locator data saved against a checkpoint

How the data flows

  • Project (projects)
    • has members (project_members), invitations (user_invitations), access tokens (access_tokens) and an audit log (project_audit_log)
    • has features (test_features), linked by pid (see the note in Section 6)
      • a feature has test images (image_entities), which are the named screens being tested
        • a test image has checkpoints (checkpoints), which are screenshots captured during a run
          • a checkpoint can have extra JSON data (json_data), assignments (testassignments) and a visual locator (visual_locator, visual_locator_images)
        • a test image has baselines (image_baselines), which are approved reference screenshots
          • a baseline can have variants (baseline_variants)
        • a comparison (comparisons) records the result of comparing one checkpoint against a baseline, or against a variant

Checkpoints and baselines point to each other. A checkpoint is a screenshot. When it is accepted, it becomes a baseline. image_baselines.checkid says which checkpoint is the baseline image, and checkpoints.Imgid links a checkpoint back to a baseline.

Test run status is calculated, not stored. The stored procedures work it out from the comparison results:

StatusMeaning
NewThe checkpoint has no comparison yet
PassedThe comparison matched (ISMATCHED = 1)
UnresolvedThe comparison found differences (ISMATCHED = 0)
Accepted / RejectedA reviewer's decision, stored in checkpoints.ReviewStatus

Main relationships (parent → child)

Parent tableChild tableLinked byType
useralmost every tablecreated_by, updated_by, deleted_by, etc.One user, many rows
projectsproject_membersproject_idOne project, many members
projectsuser_invitationsproject_idOne project, many invitations
projectsaccess_tokensproject_idOne project, many tokens
projectsproject_audit_logproject_idOne project, many log entries
test_featuresimage_entitiesFeatureIdOne feature, many test images
image_entitiescheckpointsnidOne test image, many checkpoints
image_entitiesimage_baselinesnidOne test image, many baselines
image_baselinesbaseline_variantsBaselineImgIdOne baseline, many variants
checkpointsbaseline_variantsCheckpointIdCheckpoint used as the variant image
checkpointscomparisonscheckidOne checkpoint, many comparisons
image_baselinescomparisonsImgidOne baseline, many comparisons
baseline_variantscomparisonsVariantIdOptional: comparison against a variant
checkpointsjson_datacheckidOne checkpoint, many JSON records
checkpointstestassignmentsCheckpointIdOne checkpoint, many assignments
checkpointsvisual_locatorcheckidOne-to-one (unique)
visual_locatorvisual_locator_imageslocatorIdOne locator, many images
useradminsettingsAdminUserIdOne-to-one (unique)

Deleting data: no cascade rules are defined in this model. A parent row cannot be deleted while child rows still exist, so children must be deleted first. The delete stored procedures (sp_DeleteBaselineImages, sp_DeleteFeatures) already do this in the correct order.


4. Table reference​

In the column tables, Required = Yes means the column cannot be empty (NOT NULL).

4.1 Users and access​

user​

Stores every person who can log in to PixelSense.

ColumnTypeRequiredDefaultDescription
IDCHAR(36)Yesauto UUIDUnique user ID (primary key)
NAMEVARCHAR(100)Yes–Full name
EMAILVARCHAR(150)Yes–Login email. Must be unique
UsernameVARCHAR(100)NoNULLOptional username
PhoneVARCHAR(30)NoNULLOptional phone number
PASSWORDVARCHAR(255)Yes–Login password (stored hashed by the application)
CREATEDDATEDATETIMENoCurrent timeWhen the account was created
ROLEVARCHAR(20)NoUserAccount role, for example Admin or User
LastLoginTimeDATETIMENoNULLLast successful login
profile_image_pathVARCHAR(2000)NoNULLLocation of the profile picture
is_deletedTINYINT(1)Yes0Soft delete flag (1 = deleted)
deleted_byCHAR(36)NoNULLUser who deleted this account (→ user.ID)
deleted_atTIMESTAMPNoNULLWhen it was deleted
updated_byCHAR(36)NoNULLUser who last updated this account (→ user.ID)
updated_atTIMESTAMPNoSet on updateWhen it was last updated
statusTINYINTYes11 = active, 2 = suspended, 3 = locked
email_verifiedTINYINT(1)Yes01 = email has been verified
email_verified_atTIMESTAMPNoNULLWhen the email was verified
failed_login_attemptsTINYINTYes0Number of failed logins in a row
locked_untilTIMESTAMPNoNULLAccount is locked until this time
created_byCHAR(36)NoNULLUser who created this account (→ user.ID)
organizationVARCHAR(200)NoNULLOrganization name (plain text)

Indexes

IndexTypeColumnsPurpose
PRIMARYPrimary keyIDIdentifies each user
EMAILUniqueEMAILNo two users can share an email; fast login lookup
idx_user_statusIndexstatusFilter users by status
idx_user_is_deletedIndexis_deletedFilter out deleted users
fk_user_created_by, fk_user_updated_by, fk_user_deleted_byIndexcreated_by, updated_by, deleted_bySupport the links back to user.ID

Relationships: created_by, updated_by and deleted_by link back to user.ID (the table references itself). user is the parent of most other tables.

user_invitations​

Stores invitations sent to people to join a project.

ColumnTypeRequiredDefaultDescription
idCHAR(36)Yesauto UUIDUnique invitation ID
emailVARCHAR(150)Yes–Email address of the person invited
project_idCHAR(36)Yes–Project they are invited to (→ projects.pid)
roleTINYINTYes–Role offered: 1 = owner, 2 = editor, 3 = viewer
invited_byCHAR(36)Yes–User who sent the invite (→ user.ID)
tokenVARCHAR(255)Yes–Unique secret token used in the invite link
statusTINYINTYes11 = pending, 2 = accepted, 3 = expired, 4 = revoked
expires_atTIMESTAMPYes–When the invitation stops working
accepted_user_idCHAR(36)NoNULLUser who accepted it (→ user.ID)
accepted_atTIMESTAMPNoNULLWhen it was accepted
created_atTIMESTAMPYesCurrent timeWhen the invitation was created

Indexes

IndexTypeColumnsPurpose
PRIMARYPrimary keyidIdentifies each invitation
uq_invite_tokenUniquetokenEach invite link is unique; fast lookup when it is opened
idx_invite_emailIndexemailFind invitations by email
idx_invite_projectIndexproject_idFind invitations for a project
idx_invite_statusIndexstatusFilter pending or expired invitations
fk_invite_invited_by, fk_invite_accepted_userIndexinvited_by, accepted_user_idSupport the links to user.ID

access_tokens​

Stores API access tokens for a project (used by the PixelBridge SDK). Only a hash of each token is stored, never the token itself.

ColumnTypeRequiredDefaultDescription
idCHAR(36)Yesauto UUIDUnique token record ID
project_idCHAR(36)Yes–Project the token belongs to (→ projects.pid)
user_idCHAR(36)Yes–User who owns the token (→ user.ID)
nameVARCHAR(100)Yes–A friendly name for the token
token_prefixVARCHAR(20)Yes–First few characters of the token, so people can recognise it
token_hashCHAR(64)Yes–64-character hash of the token, used to verify it
last_used_atDATETIMENoNULLWhen the token was last used
revoked_atDATETIMENoNULLWhen the token was revoked (NULL = still valid)
created_atDATETIMEYesCurrent timeWhen the token was created

Indexes

IndexTypeColumnsPurpose
PRIMARYPrimary keyidIdentifies each token record
uq_access_tokens_hashUniquetoken_hashNo two tokens share a hash; fast token lookup
idx_access_tokens_hashIndextoken_hashAlso on the hash (overlaps with the unique index above)
idx_access_tokens_projectIndexproject_idFind the tokens of a project
fk_access_tokens_userIndexuser_idSupports the link to user.ID

4.2 Admin settings​

adminsettings​

Stores the settings for each admin user: baseline limit and highlight and theme colours. Each admin has exactly one row.

ColumnTypeRequiredDefaultDescription
IdCHAR(36)Yesauto UUIDUnique settings ID
AdminUserIdCHAR(36)Yes–The admin these settings belong to (→ user.ID). Unique
BaselineLimitINTYes–Maximum number of baselines allowed
HighlightColorVARCHAR(20)NoNULLHighlight colour
CreatedDateDATETIMENoCurrent timeWhen the row was created
UpdatedDateDATETIMENoCurrent timeUpdates automatically on every change
ThemePrimaryVARCHAR(20)NoNULLMain theme colour
HighlightBorderVARCHAR(20)NoNULLBorder colour for highlighted regions
HighlightFillVARCHAR(20)NoNULLFill colour for highlighted regions
SelectionColorVARCHAR(20)NoNULLColour used for a selected region
OpacityINTNo35Highlight opacity

Indexes

IndexTypeColumnsPurpose
PRIMARYPrimary keyIdIdentifies each row
uq_adminsettings_AdminUserIdUniqueAdminUserIdOne settings row per admin

admin_custom_colors​

Stores custom colours saved by an admin. This table is standalone (no foreign keys).

ColumnTypeRequiredDefaultDescription
IdCHAR(36)Yesauto UUIDUnique ID
AdminUserIdBIGINTYes–Admin who saved the colour
ColorCodeVARCHAR(20)Yes–The colour value, for example a hex code
CreatedDateDATETIMENoCurrent timeWhen it was saved

Indexes: PRIMARY on Id only.

custom_theme_colors​

Stores custom theme colours. This table is standalone (no foreign keys).

ColumnTypeRequiredDefaultDescription
IdCHAR(36)Yesauto UUIDUnique ID
AdminUserIdINTNoNULLAdmin who saved the colour
ColorCodeVARCHAR(20)NoNULLThe colour value
CreatedDateDATETIMENoCurrent timeWhen it was saved

Indexes: PRIMARY on Id only.

4.3 Projects​

projects​

Stores each project. A project is the top-level container for features, tests and members.

ColumnTypeRequiredDefaultDescription
pidCHAR(36)Yesauto UUIDUnique project ID (primary key)
nameVARCHAR(150)Yes–Project name
organizationVARCHAR(100)NoNULLOrganization name (plain text)
descriptionVARCHAR(500)NoNULLShort description
statusTINYINTYes11 = active, 2 = archived, 3 = completed, 4 = on hold
is_deletedTINYINT(1)Yes0Soft delete flag (1 = deleted)
deleted_byCHAR(36)NoNULLUser who deleted the project (→ user.ID)
deleted_atTIMESTAMPNoNULLWhen it was deleted
updated_byCHAR(36)NoNULLUser who last updated it (→ user.ID)
updated_atTIMESTAMPNoSet on updateWhen it was last updated
created_byCHAR(36)Yes–User who created the project (→ user.ID)
created_atTIMESTAMPYesCurrent timeWhen it was created
active_nameVARCHAR(150)NoautoGenerated automatically. Equals name while the project is not deleted, and NULL once it is deleted. Do not fill it manually

Indexes

IndexTypeColumnsPurpose
PRIMARYPrimary keypidIdentifies each project
uq_project_name_per_userUniquecreated_by, active_nameA user cannot have two active projects with the same name. Deleted projects have no active_name, so their names can be reused
idx_projects_created_byIndexcreated_byFind a user's projects
idx_projects_statusIndexstatusFilter by status
idx_projects_is_deletedIndexis_deletedFilter out deleted projects
fk_projects_deleted_by, fk_projects_updated_byIndexdeleted_by, updated_bySupport the links to user.ID

project_members​

Stores which users belong to which project and what role they have.

ColumnTypeRequiredDefaultDescription
idCHAR(36)Yesauto UUIDUnique membership ID
project_idCHAR(36)Yes–The project (→ projects.pid)
user_idCHAR(36)Yes–The member (→ user.ID)
roleTINYINTYes–1 = owner, 2 = editor, 3 = viewer
assigned_byCHAR(36)Yes–User who added the member (→ user.ID)
assigned_atTIMESTAMPYesCurrent timeWhen the member was added
is_activeTINYINT(1)Yes11 = current member, 0 = removed
removed_byCHAR(36)NoNULLUser who removed the member (→ user.ID)
removed_atTIMESTAMPNoNULLWhen the member was removed

Indexes

IndexTypeColumnsPurpose
PRIMARYPrimary keyidIdentifies each membership
uq_project_userUniqueproject_id, user_idA user can appear only once per project
idx_pm_projectIndexproject_idList the members of a project
idx_pm_userIndexuser_idList the projects of a user
idx_pm_activeIndexis_activeFilter current members
fk_pm_assigned_by, fk_pm_removed_byIndexassigned_by, removed_bySupport the links to user.ID

project_audit_log​

A history of important changes made to projects (who did what, and when).

ColumnTypeRequiredDefaultDescription
idCHAR(36)Yesauto UUIDUnique log entry ID
project_idCHAR(36)Yes–Project the action was on (→ projects.pid)
action_typeTINYINTYes–1 = project created, 2 = project updated, 3 = member added, 4 = member removed, 5 = role changed, 6 = status changed, 7 = deleted, 8 = restored
performed_byCHAR(36)Yes–User who did the action (→ user.ID)
affected_user_idCHAR(36)NoNULLUser the action was about, for member actions (→ user.ID)
field_nameVARCHAR(100)NoNULLField that was edited, for example name, description or status
old_valueVARCHAR(1000)NoNULLValue before the change
new_valueVARCHAR(1000)NoNULLValue after the change
created_atTIMESTAMPYesCurrent timeWhen the action happened

Indexes

IndexTypeColumnsPurpose
PRIMARYPrimary keyidIdentifies each entry
idx_audit_projectIndexproject_idShow the history of one project
idx_audit_actionIndexaction_typeFilter by kind of action
idx_audit_performed_byIndexperformed_byFind what a user did
idx_audit_created_atIndexcreated_atSort or filter by date
fk_audit_affected_userIndexaffected_user_idSupports the link to user.ID

4.4 Tests and results​

test_features​

A feature is a named group of tests, for example a "Checkout flow". It has a product name and a feature name.

ColumnTypeRequiredDefaultDescription
FeatureIdCHAR(36)Yesauto UUIDUnique feature ID (primary key)
pidCHAR(36)NoNULLProject this feature belongs to (matches projects.pid; no foreign key, see Section 6)
ProductNameVARCHAR(100)Yes–Product name
FeatureNameVARCHAR(100)Yes–Feature name
DESCRIPTIONVARCHAR(255)NoNULLShort description
CREATEDBYCHAR(36)NoNULLUser who created it (no foreign key)
CREATEDDATEDATETIMENoCurrent timeWhen it was created

Indexes

IndexTypeColumnsPurpose
PRIMARYPrimary keyFeatureIdIdentifies each feature
uq_product_featureUniqueProductName, FeatureNameThe same product and feature name pair cannot be repeated

image_entities​

A test image is a named screen or page that is being visually tested. All checkpoints and baselines of that screen point back to it. In stored procedures it is often called the "test", and its ID is called nid.

ColumnTypeRequiredDefaultDescription
nidCHAR(36)Yesauto UUIDUnique test image ID (primary key)
imgnameVARCHAR(100)Yes–Name of the test image
DESCRIPTIONVARCHAR(255)NoNULLShort description
CREATEDBYCHAR(36)Yes–User who created it (→ user.ID)
CREATEDDATEDATETIMENoCurrent timeWhen it was created
FeatureIdCHAR(36)Yes–Feature it belongs to (→ test_features.FeatureId)

Indexes

IndexTypeColumnsPurpose
PRIMARYPrimary keynidIdentifies each test image
fk_image_featureIndexFeatureIdList the test images of a feature
CREATEDBYIndexCREATEDBYSupports the link to user.ID

checkpoints​

A checkpoint is one screenshot captured during a test run.

ColumnTypeRequiredDefaultDescription
checkidCHAR(36)Yesauto UUIDUnique checkpoint ID (primary key)
nidCHAR(36)Yes–Test image this screenshot belongs to (→ image_entities.nid)
ImgidCHAR(36)NoNULLBaseline linked to this checkpoint (→ image_baselines.Imgid)
STORAGE_KEYLONGBLOBNoNULLThe screenshot stored directly inside the database
STORAGE_PATHVARCHAR(2000)NoNULLLocation of the screenshot file
STORAGE_SHA256VARCHAR(64)NoNULLSHA-256 fingerprint of the image
CREATEDBYCHAR(36)Yes–User who created it (→ user.ID)
CREATEDDATEDATETIMENoCurrent timeWhen it was captured
ReviewStatusENUMNoNULLReviewer decision: Accepted or Rejected. NULL = not reviewed yet
ReviewedByCHAR(36)NoNULLReviewer (→ user.ID)
ReviewedDateDATETIMENoNULLWhen it was reviewed

Indexes

IndexTypeColumnsPurpose
PRIMARYPrimary keycheckidIdentifies each checkpoint
nidIndexnidList the checkpoints of a test image
ImgidIndexImgidFind checkpoints linked to a baseline
CREATEDBYIndexCREATEDBYSupports the link to user.ID
fk_checkpoint_reviewerIndexReviewedBySupports the link to user.ID

image_baselines​

A baseline is the approved reference screenshot that new checkpoints are compared against.

ColumnTypeRequiredDefaultDescription
ImgidCHAR(36)Yesauto UUIDUnique baseline ID (primary key)
nidCHAR(36)Yes–Test image it belongs to (→ image_entities.nid)
checkidCHAR(36)NoNULLCheckpoint whose screenshot is the baseline (→ checkpoints.checkid). Can be NULL if that checkpoint was removed
CREATEDBYCHAR(36)Yes–User who created it (→ user.ID)
CREATEDDATEDATETIMENoCurrent timeWhen it was created
AcceptedRegionsJSONNoNULLRegions marked on this baseline, for example areas to ignore during comparison, stored as JSON

Indexes

IndexTypeColumnsPurpose
PRIMARYPrimary keyImgidIdentifies each baseline
idx_baselines_nid_createdIndexnid, CREATEDDATEQuickly find the latest baseline of a test image
checkpointsIndexcheckidSupports the link to checkpoints
CREATEDBYIndexCREATEDBYSupports the link to user.ID

baseline_variants​

A variant is an alternative version of a baseline (for example, the same screen with an accepted difference). It can have its own regions.

ColumnTypeRequiredDefaultDescription
VariantIdCHAR(36)Yesauto UUIDUnique variant ID (primary key)
BaselineImgIdCHAR(36)Yes–Baseline this variant belongs to (→ image_baselines.Imgid)
CheckpointIdCHAR(36)Yes–Checkpoint used as the variant image (→ checkpoints.checkid)
VariantNameVARCHAR(100)NoNULLName of the variant
CREATEDBYCHAR(36)NoNULLUser who created it (no foreign key)
CREATEDDATEDATETIMENoCurrent timeWhen it was created
AcceptedRegionsJSONNoNULLRegions marked on this variant, stored as JSON
VariantImagePathVARCHAR(2000)NoNULLLocation of the variant image

Indexes

IndexTypeColumnsPurpose
PRIMARYPrimary keyVariantIdIdentifies each variant
BaselineImgIdIndexBaselineImgIdList the variants of a baseline
CheckpointIdIndexCheckpointIdFind variants by checkpoint

comparisons​

Stores the result of comparing a checkpoint against a baseline (or a variant).

ColumnTypeRequiredDefaultDescription
comparidCHAR(36)Yesauto UUIDUnique comparison ID (primary key)
ImgidCHAR(36)Yes–Baseline used (→ image_baselines.Imgid)
checkidCHAR(36)Yes–Checkpoint that was compared (→ checkpoints.checkid)
ISMATCHEDTINYINT(1)NoNULL1 = images matched, 0 = differences found
DIFF_STORAGE_KEYLONGBLOBNoNULLThe difference image stored inside the database
DiffStoragePathVARCHAR(1000)NoNULLLocation of the difference image file
diffRegionsJsonJSONNoNULLRegions where differences were found, stored as JSON
VariantIdCHAR(36)NoNULLVariant used, if compared against a variant (→ baseline_variants.VariantId)
CREATEDBYCHAR(36)Yes–User who created it (→ user.ID)
CREATEDDATEDATETIMENoCurrent timeWhen the comparison was made

Indexes

IndexTypeColumnsPurpose
PRIMARYPrimary keycomparidIdentifies each comparison
checkidIndexcheckidFind comparisons of a checkpoint
ImgidIndexImgidFind comparisons against a baseline
fk_comparison_variantIndexVariantIdFind comparisons against a variant
CREATEDBYIndexCREATEDBYSupports the link to user.ID

json_data​

Extra JSON details saved for a checkpoint (for example, information captured along with the screenshot). A checkpoint can have more than one record.

ColumnTypeRequiredDefaultDescription
JidCHAR(36)Yesauto UUIDUnique record ID (primary key)
checkidCHAR(36)Yes–Checkpoint it belongs to (→ checkpoints.checkid)
dataJSONYes–The JSON content
CreatedDateDATETIMENoCurrent timeWhen it was saved

Indexes

IndexTypeColumnsPurpose
PRIMARYPrimary keyJidIdentifies each record
checkidIndexcheckidFind the JSON records of a checkpoint

testassignments​

Tracks checkpoints that one user has assigned to another for review.

ColumnTypeRequiredDefaultDescription
IdCHAR(36)Yesauto UUIDUnique assignment ID (primary key)
CheckpointIdCHAR(36)Yes–Checkpoint assigned (→ checkpoints.checkid)
AssignedToUserIdCHAR(36)Yes–User who received the assignment (→ user.ID)
AssignedByUserIdCHAR(36)Yes–User who made the assignment (→ user.ID)
AssignedDateDATETIMENoCurrent timeWhen it was assigned
StatusVARCHAR(50)NoAssignedAssignment status
RemarksVARCHAR(255)NoNULLOptional note from the assigner
IsSeenBIT(1)No00 = not opened yet by the assignee, 1 = seen

Indexes

IndexTypeColumnsPurpose
PRIMARYPrimary keyIdIdentifies each assignment
idx_checkpointIndexCheckpointIdFind assignments of a checkpoint
idx_assigned_userIndexAssignedToUserIdShow a user's assignments
fk_ta_assigned_byIndexAssignedByUserIdSupports the link to user.ID

4.5 Visual locator​

visual_locator​

Stores visual locator data for a checkpoint. Each checkpoint has at most one row.

ColumnTypeRequiredDefaultDescription
IdCHAR(36)Yesauto UUIDUnique ID (primary key)
checkidCHAR(36)Yes–Checkpoint it belongs to (→ checkpoints.checkid). Unique
locatorJsonJSONYes–The locator data
createdByCHAR(36)Yes–User who created it (→ user.ID)
createdDateDATETIMENoCurrent timeWhen it was created
updatedByCHAR(36)NoNULLUser who last updated it (→ user.ID)
updatedDateDATETIMENoNULLWhen it was last updated

Indexes

IndexTypeColumnsPurpose
PRIMARYPrimary keyIdIdentifies each row
checkidUniquecheckidGuarantees one locator per checkpoint
fk_vl_created_by, fk_vl_updated_byIndexcreatedBy, updatedBySupport the links to user.ID

visual_locator_images​

Stores the image files that belong to a visual locator.

ColumnTypeRequiredDefaultDescription
IdCHAR(36)Yesauto UUIDUnique ID (primary key)
checkidCHAR(36)Yes–Checkpoint it belongs to (→ checkpoints.checkid)
locatorIdCHAR(36)Yes–The locator this image belongs to (→ visual_locator.Id)
createdDateDATETIMENoCurrent timeWhen it was saved
imagePathVARCHAR(500)NoNULLLocation of the image file

Indexes

IndexTypeColumnsPurpose
PRIMARYPrimary keyIdIdentifies each row
checkidIndexcheckidFind images of a checkpoint
fk_vli_locatorIndexlocatorIdFind images of a locator

5. Triggers​

There are 19 triggers, one per table, all named trg_<table_name>_guid.

  • When it runs: BEFORE INSERT, on every new row.
  • What it does: if the ID column is empty, it fills it with a new UUID().
  • Why it matters: applications and scripts do not need to generate IDs. You can insert a row without one.

6. Stored procedures​

The application reads and writes data through 57 stored procedures. In Workbench they are under pixelsense_dev → Routines.

AreaProcedures
Users and loginsp_CreateUser, sp_CreateUserFull, sp_ValidateUser, sp_GetUserById, sp_GetAllUsersFull, sp_GetActiveUsers, sp_ResetPassword, sp_UpdatePassword, sp_GetProfileImage, sp_UpdateProfileImage
Admin settingssp_GetAdminSettings, sp_SaveAdminSettings
Features and test imagessp_get_or_create_feature, sp_GetAllFeatures, sp_UpdateFeature, sp_DeleteFeatures, sp_GetOrCreateName, sp_GetOrCreateNamewithFeature, sp_GetImageEntitiesWithFeatureProduct, sp_GetImagesByFeature
Checkpoints and run datasp_InsertCheckpoint, sp_InsertCheckpointPath, sp_GetCheckpointById, InsertJsonData, sp_GetAllCheckpointsWithJsonByNidNew, sp_GetTestRunsByFeature, sp_GetTestRunsByFeatureAndImage
Baselines and variantssp_AcceptCheckpointAsBaseline, sp_GetAllBaselineImages, sp_GetBaselineImagesByCheckIds, sp_GetBaselineImagesByNid, sp_GetBaselineCheckpointsWithLatestJsonByNid, sp_GetBaselinesByTestId, sp_GetBaselinesForTest, sp_DeleteBaselineImages, sp_InsertBaselineVariant, sp_GetBaselineVariantsByImgId, sp_GetVariantsForTest, sp_UpdateBaselineVariantName, sp_DeleteBaselineVariant
Regionssp_SaveRegions, sp_SaveBaselineRegions, sp_DeleteRegion
Comparisons and dashboard numberssp_InsertComparison, sp_GetComparisonDetailsByCheckIdNew, sp_GetComparisonStatusesByNid, sp_GetImageStatusByNid, sp_GetImageRunSummaryByFeature, sp_GetOverallTestRunSummary, sp_GetTestRunSummaryByDateRange
Assignmentssp_AssignCheckpoint, sp_GetUserAssignments, sp_GetUnreadAssignmentsCount, sp_MarkAssignmentsSeen
Visual locatorsp_SaveVisualLocator, sp_SaveVisualLocatorImage, sp_GetVisualLocator

7. Good to know​

  • Features and projects: test_features.pid links a feature to a project, but there is no foreign key or index on it in this model. The link works by matching the value with projects.pid.
  • Colour tables are standalone: admin_custom_colors and custom_theme_colors have no foreign keys. Their AdminUserId columns are numbers (BIGINT / INT), while user.ID is a UUID, so they cannot link to user. Only adminsettings links to user.
  • Overlapping index: access_tokens.token_hash has both a unique index and a normal index. The unique index already covers lookups.
  • Deleted users and projects: they stay in the tables. Always filter with is_deleted = 0 when reading directly from SQL.
  • Status and role numbers: the numbers listed in this page (for example role 1 = owner) are mapped in the Java application code, not enforced by the database.