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
| Item | Details |
|---|---|
| Schema name | pixelsense_dev |
| Tables | 19 |
| Triggers | 19 (one per table) |
| Stored procedures | 57 |
| Model file | pixelsenseDb.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
userandprojectstables are never physically deleted from. They use anis_deletedflag (1 = deleted), so queries should filter onis_deleted = 0. - Numbers that mean something. Columns like
statusandrolestore 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/CREATEDBYand a created date. These point to theusertable. - Naming styles are mixed. Some tables use
snake_case(created_at), others useUPPERorPascalCase(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.
- Download the file. Click the attached file pixelsenseDb.mwb on this page and download it to your computer.
- Install MySQL Workbench (free), version 8.0 or newer, if you don't have it: Download MySQL Workbench
- Open the model. Start MySQL Workbench, then go to File → Open Model… (or press
Ctrl + O) and pickpixelsenseDb.mwb. You can also double-click the file. - Find the schema. The MySQL Model tab opens. Under Physical Schemas you will see two schemas:
mydb(an empty default, ignore it) andpixelsense_dev. Expandpixelsense_devto see Tables and Routines (stored procedures). - Open the diagram. Under EER Diagrams, double-click EER Diagram.
- Move around. Zoom with
Ctrl + mouse wheelor 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. - 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.
- See stored procedures. In the MySQL Model tab, expand
pixelsense_dev→ Routines, then double-click a routine to read its code. - Optional: save the diagram as an image. Go to File → Export → Export as PNG…
3. The big picture
The tables fall into five groups:
| Group | Tables | What it covers |
|---|---|---|
| Users and access | user, user_invitations, access_tokens | Who can log in, who was invited, and API tokens |
| Admin settings | adminsettings, admin_custom_colors, custom_theme_colors | Colour and baseline settings for admins |
| Projects | projects, project_members, project_audit_log | Projects, who belongs to them, and a history of changes |
| Tests and results | test_features, image_entities, checkpoints, image_baselines, baseline_variants, comparisons, json_data, testassignments | The core of PixelSense: screenshots, baselines and comparison results |
| Visual locator | visual_locator, visual_locator_images | Visual 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 bypid(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 checkpoint can have extra JSON data (
- a test image has baselines (
image_baselines), which are approved reference screenshots- a baseline can have variants (
baseline_variants)
- a baseline can have variants (
- a comparison (
comparisons) records the result of comparing one checkpoint against a baseline, or against a variant
- a test image has checkpoints (
- a feature has test images (
- has members (
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:
| Status | Meaning |
|---|---|
| New | The checkpoint has no comparison yet |
| Passed | The comparison matched (ISMATCHED = 1) |
| Unresolved | The comparison found differences (ISMATCHED = 0) |
| Accepted / Rejected | A reviewer's decision, stored in checkpoints.ReviewStatus |
Main relationships (parent → child)
| Parent table | Child table | Linked by | Type |
|---|---|---|---|
user | almost every table | created_by, updated_by, deleted_by, etc. | One user, many rows |
projects | project_members | project_id | One project, many members |
projects | user_invitations | project_id | One project, many invitations |
projects | access_tokens | project_id | One project, many tokens |
projects | project_audit_log | project_id | One project, many log entries |
test_features | image_entities | FeatureId | One feature, many test images |
image_entities | checkpoints | nid | One test image, many checkpoints |
image_entities | image_baselines | nid | One test image, many baselines |
image_baselines | baseline_variants | BaselineImgId | One baseline, many variants |
checkpoints | baseline_variants | CheckpointId | Checkpoint used as the variant image |
checkpoints | comparisons | checkid | One checkpoint, many comparisons |
image_baselines | comparisons | Imgid | One baseline, many comparisons |
baseline_variants | comparisons | VariantId | Optional: comparison against a variant |
checkpoints | json_data | checkid | One checkpoint, many JSON records |
checkpoints | testassignments | CheckpointId | One checkpoint, many assignments |
checkpoints | visual_locator | checkid | One-to-one (unique) |
visual_locator | visual_locator_images | locatorId | One locator, many images |
user | adminsettings | AdminUserId | One-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.
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
ID | CHAR(36) | Yes | auto UUID | Unique user ID (primary key) |
NAME | VARCHAR(100) | Yes | – | Full name |
EMAIL | VARCHAR(150) | Yes | – | Login email. Must be unique |
Username | VARCHAR(100) | No | NULL | Optional username |
Phone | VARCHAR(30) | No | NULL | Optional phone number |
PASSWORD | VARCHAR(255) | Yes | – | Login password (stored hashed by the application) |
CREATEDDATE | DATETIME | No | Current time | When the account was created |
ROLE | VARCHAR(20) | No | User | Account role, for example Admin or User |
LastLoginTime | DATETIME | No | NULL | Last successful login |
profile_image_path | VARCHAR(2000) | No | NULL | Location of the profile picture |
is_deleted | TINYINT(1) | Yes | 0 | Soft delete flag (1 = deleted) |
deleted_by | CHAR(36) | No | NULL | User who deleted this account (→ user.ID) |
deleted_at | TIMESTAMP | No | NULL | When it was deleted |
updated_by | CHAR(36) | No | NULL | User who last updated this account (→ user.ID) |
updated_at | TIMESTAMP | No | Set on update | When it was last updated |
status | TINYINT | Yes | 1 | 1 = active, 2 = suspended, 3 = locked |
email_verified | TINYINT(1) | Yes | 0 | 1 = email has been verified |
email_verified_at | TIMESTAMP | No | NULL | When the email was verified |
failed_login_attempts | TINYINT | Yes | 0 | Number of failed logins in a row |
locked_until | TIMESTAMP | No | NULL | Account is locked until this time |
created_by | CHAR(36) | No | NULL | User who created this account (→ user.ID) |
organization | VARCHAR(200) | No | NULL | Organization name (plain text) |
Indexes
| Index | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary key | ID | Identifies each user |
EMAIL | Unique | EMAIL | No two users can share an email; fast login lookup |
idx_user_status | Index | status | Filter users by status |
idx_user_is_deleted | Index | is_deleted | Filter out deleted users |
fk_user_created_by, fk_user_updated_by, fk_user_deleted_by | Index | created_by, updated_by, deleted_by | Support 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.
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
id | CHAR(36) | Yes | auto UUID | Unique invitation ID |
email | VARCHAR(150) | Yes | – | Email address of the person invited |
project_id | CHAR(36) | Yes | – | Project they are invited to (→ projects.pid) |
role | TINYINT | Yes | – | Role offered: 1 = owner, 2 = editor, 3 = viewer |
invited_by | CHAR(36) | Yes | – | User who sent the invite (→ user.ID) |
token | VARCHAR(255) | Yes | – | Unique secret token used in the invite link |
status | TINYINT | Yes | 1 | 1 = pending, 2 = accepted, 3 = expired, 4 = revoked |
expires_at | TIMESTAMP | Yes | – | When the invitation stops working |
accepted_user_id | CHAR(36) | No | NULL | User who accepted it (→ user.ID) |
accepted_at | TIMESTAMP | No | NULL | When it was accepted |
created_at | TIMESTAMP | Yes | Current time | When the invitation was created |
Indexes
| Index | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary key | id | Identifies each invitation |
uq_invite_token | Unique | token | Each invite link is unique; fast lookup when it is opened |
idx_invite_email | Index | email | Find invitations by email |
idx_invite_project | Index | project_id | Find invitations for a project |
idx_invite_status | Index | status | Filter pending or expired invitations |
fk_invite_invited_by, fk_invite_accepted_user | Index | invited_by, accepted_user_id | Support 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.
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
id | CHAR(36) | Yes | auto UUID | Unique token record ID |
project_id | CHAR(36) | Yes | – | Project the token belongs to (→ projects.pid) |
user_id | CHAR(36) | Yes | – | User who owns the token (→ user.ID) |
name | VARCHAR(100) | Yes | – | A friendly name for the token |
token_prefix | VARCHAR(20) | Yes | – | First few characters of the token, so people can recognise it |
token_hash | CHAR(64) | Yes | – | 64-character hash of the token, used to verify it |
last_used_at | DATETIME | No | NULL | When the token was last used |
revoked_at | DATETIME | No | NULL | When the token was revoked (NULL = still valid) |
created_at | DATETIME | Yes | Current time | When the token was created |
Indexes
| Index | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary key | id | Identifies each token record |
uq_access_tokens_hash | Unique | token_hash | No two tokens share a hash; fast token lookup |
idx_access_tokens_hash | Index | token_hash | Also on the hash (overlaps with the unique index above) |
idx_access_tokens_project | Index | project_id | Find the tokens of a project |
fk_access_tokens_user | Index | user_id | Supports 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.
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
Id | CHAR(36) | Yes | auto UUID | Unique settings ID |
AdminUserId | CHAR(36) | Yes | – | The admin these settings belong to (→ user.ID). Unique |
BaselineLimit | INT | Yes | – | Maximum number of baselines allowed |
HighlightColor | VARCHAR(20) | No | NULL | Highlight colour |
CreatedDate | DATETIME | No | Current time | When the row was created |
UpdatedDate | DATETIME | No | Current time | Updates automatically on every change |
ThemePrimary | VARCHAR(20) | No | NULL | Main theme colour |
HighlightBorder | VARCHAR(20) | No | NULL | Border colour for highlighted regions |
HighlightFill | VARCHAR(20) | No | NULL | Fill colour for highlighted regions |
SelectionColor | VARCHAR(20) | No | NULL | Colour used for a selected region |
Opacity | INT | No | 35 | Highlight opacity |
Indexes
| Index | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary key | Id | Identifies each row |
uq_adminsettings_AdminUserId | Unique | AdminUserId | One settings row per admin |
admin_custom_colors
Stores custom colours saved by an admin. This table is standalone (no foreign keys).
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
Id | CHAR(36) | Yes | auto UUID | Unique ID |
AdminUserId | BIGINT | Yes | – | Admin who saved the colour |
ColorCode | VARCHAR(20) | Yes | – | The colour value, for example a hex code |
CreatedDate | DATETIME | No | Current time | When it was saved |
Indexes: PRIMARY on Id only.
custom_theme_colors
Stores custom theme colours. This table is standalone (no foreign keys).
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
Id | CHAR(36) | Yes | auto UUID | Unique ID |
AdminUserId | INT | No | NULL | Admin who saved the colour |
ColorCode | VARCHAR(20) | No | NULL | The colour value |
CreatedDate | DATETIME | No | Current time | When 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.
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
pid | CHAR(36) | Yes | auto UUID | Unique project ID (primary key) |
name | VARCHAR(150) | Yes | – | Project name |
organization | VARCHAR(100) | No | NULL | Organization name (plain text) |
description | VARCHAR(500) | No | NULL | Short description |
status | TINYINT | Yes | 1 | 1 = active, 2 = archived, 3 = completed, 4 = on hold |
is_deleted | TINYINT(1) | Yes | 0 | Soft delete flag (1 = deleted) |
deleted_by | CHAR(36) | No | NULL | User who deleted the project (→ user.ID) |
deleted_at | TIMESTAMP | No | NULL | When it was deleted |
updated_by | CHAR(36) | No | NULL | User who last updated it (→ user.ID) |
updated_at | TIMESTAMP | No | Set on update | When it was last updated |
created_by | CHAR(36) | Yes | – | User who created the project (→ user.ID) |
created_at | TIMESTAMP | Yes | Current time | When it was created |
active_name | VARCHAR(150) | No | auto | Generated automatically. Equals name while the project is not deleted, and NULL once it is deleted. Do not fill it manually |
Indexes
| Index | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary key | pid | Identifies each project |
uq_project_name_per_user | Unique | created_by, active_name | A 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_by | Index | created_by | Find a user's projects |
idx_projects_status | Index | status | Filter by status |
idx_projects_is_deleted | Index | is_deleted | Filter out deleted projects |
fk_projects_deleted_by, fk_projects_updated_by | Index | deleted_by, updated_by | Support the links to user.ID |
project_members
Stores which users belong to which project and what role they have.
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
id | CHAR(36) | Yes | auto UUID | Unique membership ID |
project_id | CHAR(36) | Yes | – | The project (→ projects.pid) |
user_id | CHAR(36) | Yes | – | The member (→ user.ID) |
role | TINYINT | Yes | – | 1 = owner, 2 = editor, 3 = viewer |
assigned_by | CHAR(36) | Yes | – | User who added the member (→ user.ID) |
assigned_at | TIMESTAMP | Yes | Current time | When the member was added |
is_active | TINYINT(1) | Yes | 1 | 1 = current member, 0 = removed |
removed_by | CHAR(36) | No | NULL | User who removed the member (→ user.ID) |
removed_at | TIMESTAMP | No | NULL | When the member was removed |
Indexes
| Index | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary key | id | Identifies each membership |
uq_project_user | Unique | project_id, user_id | A user can appear only once per project |
idx_pm_project | Index | project_id | List the members of a project |
idx_pm_user | Index | user_id | List the projects of a user |
idx_pm_active | Index | is_active | Filter current members |
fk_pm_assigned_by, fk_pm_removed_by | Index | assigned_by, removed_by | Support the links to user.ID |
project_audit_log
A history of important changes made to projects (who did what, and when).
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
id | CHAR(36) | Yes | auto UUID | Unique log entry ID |
project_id | CHAR(36) | Yes | – | Project the action was on (→ projects.pid) |
action_type | TINYINT | Yes | – | 1 = project created, 2 = project updated, 3 = member added, 4 = member removed, 5 = role changed, 6 = status changed, 7 = deleted, 8 = restored |
performed_by | CHAR(36) | Yes | – | User who did the action (→ user.ID) |
affected_user_id | CHAR(36) | No | NULL | User the action was about, for member actions (→ user.ID) |
field_name | VARCHAR(100) | No | NULL | Field that was edited, for example name, description or status |
old_value | VARCHAR(1000) | No | NULL | Value before the change |
new_value | VARCHAR(1000) | No | NULL | Value after the change |
created_at | TIMESTAMP | Yes | Current time | When the action happened |
Indexes
| Index | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary key | id | Identifies each entry |
idx_audit_project | Index | project_id | Show the history of one project |
idx_audit_action | Index | action_type | Filter by kind of action |
idx_audit_performed_by | Index | performed_by | Find what a user did |
idx_audit_created_at | Index | created_at | Sort or filter by date |
fk_audit_affected_user | Index | affected_user_id | Supports 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.
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
FeatureId | CHAR(36) | Yes | auto UUID | Unique feature ID (primary key) |
pid | CHAR(36) | No | NULL | Project this feature belongs to (matches projects.pid; no foreign key, see Section 6) |
ProductName | VARCHAR(100) | Yes | – | Product name |
FeatureName | VARCHAR(100) | Yes | – | Feature name |
DESCRIPTION | VARCHAR(255) | No | NULL | Short description |
CREATEDBY | CHAR(36) | No | NULL | User who created it (no foreign key) |
CREATEDDATE | DATETIME | No | Current time | When it was created |
Indexes
| Index | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary key | FeatureId | Identifies each feature |
uq_product_feature | Unique | ProductName, FeatureName | The 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.
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
nid | CHAR(36) | Yes | auto UUID | Unique test image ID (primary key) |
imgname | VARCHAR(100) | Yes | – | Name of the test image |
DESCRIPTION | VARCHAR(255) | No | NULL | Short description |
CREATEDBY | CHAR(36) | Yes | – | User who created it (→ user.ID) |
CREATEDDATE | DATETIME | No | Current time | When it was created |
FeatureId | CHAR(36) | Yes | – | Feature it belongs to (→ test_features.FeatureId) |
Indexes
| Index | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary key | nid | Identifies each test image |
fk_image_feature | Index | FeatureId | List the test images of a feature |
CREATEDBY | Index | CREATEDBY | Supports the link to user.ID |
checkpoints
A checkpoint is one screenshot captured during a test run.
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
checkid | CHAR(36) | Yes | auto UUID | Unique checkpoint ID (primary key) |
nid | CHAR(36) | Yes | – | Test image this screenshot belongs to (→ image_entities.nid) |
Imgid | CHAR(36) | No | NULL | Baseline linked to this checkpoint (→ image_baselines.Imgid) |
STORAGE_KEY | LONGBLOB | No | NULL | The screenshot stored directly inside the database |
STORAGE_PATH | VARCHAR(2000) | No | NULL | Location of the screenshot file |
STORAGE_SHA256 | VARCHAR(64) | No | NULL | SHA-256 fingerprint of the image |
CREATEDBY | CHAR(36) | Yes | – | User who created it (→ user.ID) |
CREATEDDATE | DATETIME | No | Current time | When it was captured |
ReviewStatus | ENUM | No | NULL | Reviewer decision: Accepted or Rejected. NULL = not reviewed yet |
ReviewedBy | CHAR(36) | No | NULL | Reviewer (→ user.ID) |
ReviewedDate | DATETIME | No | NULL | When it was reviewed |
Indexes
| Index | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary key | checkid | Identifies each checkpoint |
nid | Index | nid | List the checkpoints of a test image |
Imgid | Index | Imgid | Find checkpoints linked to a baseline |
CREATEDBY | Index | CREATEDBY | Supports the link to user.ID |
fk_checkpoint_reviewer | Index | ReviewedBy | Supports the link to user.ID |
image_baselines
A baseline is the approved reference screenshot that new checkpoints are compared against.
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
Imgid | CHAR(36) | Yes | auto UUID | Unique baseline ID (primary key) |
nid | CHAR(36) | Yes | – | Test image it belongs to (→ image_entities.nid) |
checkid | CHAR(36) | No | NULL | Checkpoint whose screenshot is the baseline (→ checkpoints.checkid). Can be NULL if that checkpoint was removed |
CREATEDBY | CHAR(36) | Yes | – | User who created it (→ user.ID) |
CREATEDDATE | DATETIME | No | Current time | When it was created |
AcceptedRegions | JSON | No | NULL | Regions marked on this baseline, for example areas to ignore during comparison, stored as JSON |
Indexes
| Index | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary key | Imgid | Identifies each baseline |
idx_baselines_nid_created | Index | nid, CREATEDDATE | Quickly find the latest baseline of a test image |
checkpoints | Index | checkid | Supports the link to checkpoints |
CREATEDBY | Index | CREATEDBY | Supports 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.
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
VariantId | CHAR(36) | Yes | auto UUID | Unique variant ID (primary key) |
BaselineImgId | CHAR(36) | Yes | – | Baseline this variant belongs to (→ image_baselines.Imgid) |
CheckpointId | CHAR(36) | Yes | – | Checkpoint used as the variant image (→ checkpoints.checkid) |
VariantName | VARCHAR(100) | No | NULL | Name of the variant |
CREATEDBY | CHAR(36) | No | NULL | User who created it (no foreign key) |
CREATEDDATE | DATETIME | No | Current time | When it was created |
AcceptedRegions | JSON | No | NULL | Regions marked on this variant, stored as JSON |
VariantImagePath | VARCHAR(2000) | No | NULL | Location of the variant image |
Indexes
| Index | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary key | VariantId | Identifies each variant |
BaselineImgId | Index | BaselineImgId | List the variants of a baseline |
CheckpointId | Index | CheckpointId | Find variants by checkpoint |
comparisons
Stores the result of comparing a checkpoint against a baseline (or a variant).
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
comparid | CHAR(36) | Yes | auto UUID | Unique comparison ID (primary key) |
Imgid | CHAR(36) | Yes | – | Baseline used (→ image_baselines.Imgid) |
checkid | CHAR(36) | Yes | – | Checkpoint that was compared (→ checkpoints.checkid) |
ISMATCHED | TINYINT(1) | No | NULL | 1 = images matched, 0 = differences found |
DIFF_STORAGE_KEY | LONGBLOB | No | NULL | The difference image stored inside the database |
DiffStoragePath | VARCHAR(1000) | No | NULL | Location of the difference image file |
diffRegionsJson | JSON | No | NULL | Regions where differences were found, stored as JSON |
VariantId | CHAR(36) | No | NULL | Variant used, if compared against a variant (→ baseline_variants.VariantId) |
CREATEDBY | CHAR(36) | Yes | – | User who created it (→ user.ID) |
CREATEDDATE | DATETIME | No | Current time | When the comparison was made |
Indexes
| Index | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary key | comparid | Identifies each comparison |
checkid | Index | checkid | Find comparisons of a checkpoint |
Imgid | Index | Imgid | Find comparisons against a baseline |
fk_comparison_variant | Index | VariantId | Find comparisons against a variant |
CREATEDBY | Index | CREATEDBY | Supports 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.
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
Jid | CHAR(36) | Yes | auto UUID | Unique record ID (primary key) |
checkid | CHAR(36) | Yes | – | Checkpoint it belongs to (→ checkpoints.checkid) |
data | JSON | Yes | – | The JSON content |
CreatedDate | DATETIME | No | Current time | When it was saved |
Indexes
| Index | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary key | Jid | Identifies each record |
checkid | Index | checkid | Find the JSON records of a checkpoint |
testassignments
Tracks checkpoints that one user has assigned to another for review.
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
Id | CHAR(36) | Yes | auto UUID | Unique assignment ID (primary key) |
CheckpointId | CHAR(36) | Yes | – | Checkpoint assigned (→ checkpoints.checkid) |
AssignedToUserId | CHAR(36) | Yes | – | User who received the assignment (→ user.ID) |
AssignedByUserId | CHAR(36) | Yes | – | User who made the assignment (→ user.ID) |
AssignedDate | DATETIME | No | Current time | When it was assigned |
Status | VARCHAR(50) | No | Assigned | Assignment status |
Remarks | VARCHAR(255) | No | NULL | Optional note from the assigner |
IsSeen | BIT(1) | No | 0 | 0 = not opened yet by the assignee, 1 = seen |
Indexes
| Index | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary key | Id | Identifies each assignment |
idx_checkpoint | Index | CheckpointId | Find assignments of a checkpoint |
idx_assigned_user | Index | AssignedToUserId | Show a user's assignments |
fk_ta_assigned_by | Index | AssignedByUserId | Supports 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.
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
Id | CHAR(36) | Yes | auto UUID | Unique ID (primary key) |
checkid | CHAR(36) | Yes | – | Checkpoint it belongs to (→ checkpoints.checkid). Unique |
locatorJson | JSON | Yes | – | The locator data |
createdBy | CHAR(36) | Yes | – | User who created it (→ user.ID) |
createdDate | DATETIME | No | Current time | When it was created |
updatedBy | CHAR(36) | No | NULL | User who last updated it (→ user.ID) |
updatedDate | DATETIME | No | NULL | When it was last updated |
Indexes
| Index | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary key | Id | Identifies each row |
checkid | Unique | checkid | Guarantees one locator per checkpoint |
fk_vl_created_by, fk_vl_updated_by | Index | createdBy, updatedBy | Support the links to user.ID |
visual_locator_images
Stores the image files that belong to a visual locator.
| Column | Type | Required | Default | Description |
|---|---|---|---|---|
Id | CHAR(36) | Yes | auto UUID | Unique ID (primary key) |
checkid | CHAR(36) | Yes | – | Checkpoint it belongs to (→ checkpoints.checkid) |
locatorId | CHAR(36) | Yes | – | The locator this image belongs to (→ visual_locator.Id) |
createdDate | DATETIME | No | Current time | When it was saved |
imagePath | VARCHAR(500) | No | NULL | Location of the image file |
Indexes
| Index | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary key | Id | Identifies each row |
checkid | Index | checkid | Find images of a checkpoint |
fk_vli_locator | Index | locatorId | Find 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.
| Area | Procedures |
|---|---|
| Users and login | sp_CreateUser, sp_CreateUserFull, sp_ValidateUser, sp_GetUserById, sp_GetAllUsersFull, sp_GetActiveUsers, sp_ResetPassword, sp_UpdatePassword, sp_GetProfileImage, sp_UpdateProfileImage |
| Admin settings | sp_GetAdminSettings, sp_SaveAdminSettings |
| Features and test images | sp_get_or_create_feature, sp_GetAllFeatures, sp_UpdateFeature, sp_DeleteFeatures, sp_GetOrCreateName, sp_GetOrCreateNamewithFeature, sp_GetImageEntitiesWithFeatureProduct, sp_GetImagesByFeature |
| Checkpoints and run data | sp_InsertCheckpoint, sp_InsertCheckpointPath, sp_GetCheckpointById, InsertJsonData, sp_GetAllCheckpointsWithJsonByNidNew, sp_GetTestRunsByFeature, sp_GetTestRunsByFeatureAndImage |
| Baselines and variants | sp_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 |
| Regions | sp_SaveRegions, sp_SaveBaselineRegions, sp_DeleteRegion |
| Comparisons and dashboard numbers | sp_InsertComparison, sp_GetComparisonDetailsByCheckIdNew, sp_GetComparisonStatusesByNid, sp_GetImageStatusByNid, sp_GetImageRunSummaryByFeature, sp_GetOverallTestRunSummary, sp_GetTestRunSummaryByDateRange |
| Assignments | sp_AssignCheckpoint, sp_GetUserAssignments, sp_GetUnreadAssignmentsCount, sp_MarkAssignmentsSeen |
| Visual locator | sp_SaveVisualLocator, sp_SaveVisualLocatorImage, sp_GetVisualLocator |
7. Good to know
- Features and projects:
test_features.pidlinks 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 withprojects.pid. - Colour tables are standalone:
admin_custom_colorsandcustom_theme_colorshave no foreign keys. TheirAdminUserIdcolumns are numbers (BIGINT/INT), whileuser.IDis a UUID, so they cannot link touser. Onlyadminsettingslinks touser. - Overlapping index:
access_tokens.token_hashhas 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 = 0when reading directly from SQL. - Status and role numbers: the numbers listed in this page (for example
role1 = owner) are mapped in the Java application code, not enforced by the database.