Introduction to the Unique_Identifiers Table
The unique_identifiers table is designed to store and manage information about individual items or components within the Serial system. This table plays a crucial role in tracking the lifecycle, status, and relationships of uniquely identifiable objects across various processes and operations.Table Structure
The unique_identifiers table is structured to capture comprehensive details about each unique identifier. Here’s a detailed breakdown of its columns:| Column Name | Data Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | Unique identifier for the record |
| identifier | text | not null | The actual unique identifier string |
| company_id | uuid | not null, foreign key | Reference to the company owning this identifier |
| component_id | uuid | not null, foreign key | Reference to the associated component |
| created_at | timestamp with time zone | not null, default now() | Timestamp of record creation |
| status | text | foreign key | Current status of the identifier |
| metadata | jsonb | Flexible field for additional data | |
| last_updated_at | timestamp with time zone | default now() | Timestamp of the last update |
| completed_at | timestamp with time zone | Timestamp when the identifier was marked as completed | |
| work_order_id | uuid | foreign key | Reference to the associated work order |
| part_number_id | uuid | foreign key | Reference to the associated part number |
| latitude | double precision | Geographical latitude of the identifier | |
| longitude | double precision | Geographical longitude of the identifier | |
| latest_process_entry_id | uuid | foreign key | Reference to the latest process entry for this identifier |
Usage and Functionality
The unique_identifiers table is designed to be the central repository for tracking individual items throughout their lifecycle. Here are some key points about its usage:- Lifecycle Tracking: The table captures the creation, updates, and completion of identifiers, allowing for comprehensive lifecycle management.
- Status Management: The status field, linked to the unique_identifier_status_types table, enables efficient tracking of an identifier’s current state (e.g., WIP, COMPLETE, DEFECTIVE).
- Relational Connections: Through various foreign keys, the table establishes relationships with companies, components, work orders, part numbers, and process entries, creating a web of interconnected data.
- Geolocation Support: The latitude and longitude fields allow for geographical tracking of identifiers, which can be crucial for logistics and inventory management.
- Flexible Metadata: The jsonb metadata field provides a way to store additional, schema-less information about the identifier, accommodating diverse use cases.
Notes
-
The table is central to many operations in the Serial system, including the
sn_lookup_pagefunction, which retrieves detailed information about an identifier and its genealogy. -
The
latest_process_entry_idfield allows for quick access to the most recent process information without the need for complex joins or subqueries. -
Example usage in TypeScript:

