Introduction to the Part_Numbers Table
The part_numbers table is designed to store and manage information about specific part numbers within the Serial application. This table plays a crucial role in the system by linking part numbers to companies and components, while also tracking their status and associated metadata.Table Structure
The part_numbers table is structured to provide comprehensive information about each part number. Here’s a detailed breakdown of its columns:| Column Name | Data Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | Unique identifier for each part number entry |
| company_id | uuid | foreign key, not null | Reference to the company associated with this part |
| pn | text | not null | The actual part number identifier |
| is_active | boolean | not null | Indicates whether the part number is currently active |
| created_at | timestamp with time zone | not null | Timestamp of when the entry was created |
| last_edited_at | timestamp with time zone | not null | Timestamp of the last edit to this entry |
| last_edited_user_id | text | foreign key, nullable | Reference to the user who last edited this entry |
| description | text | nullable | Optional description of the part number |
| component_id | uuid | foreign key, nullable | Reference to the associated component |
| metadata | jsonb | nullable | Custom metadata stored in JSON format |
Usage and Functionality
The part_numbers table is designed to be a central repository for part number information within the Serial application. Here are some key points about its usage:- Company and Component Association: Each part number is linked to a specific company and can be associated with a component, allowing for organized tracking of parts across the system.
-
Status Tracking: The
is_activefield enables easy filtering of current and discontinued part numbers, facilitating inventory management and historical record-keeping. -
Flexible Metadata Storage: The
metadatacolumn, using JSONB format, allows for storing additional custom information about part numbers without requiring schema changes. - Edit History: By tracking creation and last edit times, as well as the user who made the last edit, the table provides an audit trail for part number modifications.
Notes
- The part_numbers table is referenced by the unique_identifiers table, indicating its role in tracking individual instances or units of parts.
-
Example of querying active part numbers for a specific component:
-
The table is used in various database functions, such as
part_numbers_propagate_new_data, which suggests that changes to part numbers may trigger updates in related tables.

