Introduction to the Component_Links Table
The component_links table is designed to establish hierarchical relationships between components in the Serial database. This table plays a crucial role in tracking the connections between parent and child components, associating them with specific processes and datasets.Table Structure
The component_links table is structured to efficiently represent component relationships and their associated data. Here’s a detailed breakdown of its columns:Usage and Functionality
The component_links table is designed to be flexible and support complex component hierarchies. Here are some key points about its usage:- Hierarchical Component Relationships: The table allows for the creation of parent-child relationships between components, enabling the representation of complex product structures or assembly hierarchies.
- Process and Dataset Association: Each link is associated with a specific process, and optionally with a dataset, allowing for detailed tracking of component relationships within different manufacturing or assembly processes.
- Unique Constraint: The table enforces a unique constraint on the combination of (component_id, has_child_of_id, process_id, dataset_id), ensuring that no duplicate links are created for the same component relationship and process-dataset combination.
-
Active Status Tracking: The
is_activecolumn allows for soft deletion or deactivation of links without removing the historical data from the database.
Notes
- The table has a Row Level Security (RLS) policy that allows only ADMIN users to update rows for their respective companies, ensuring data integrity and access control.
-
Example of creating a new component link:
-
The
data_key_idcolumn allows for optional association with specific data keys, providing additional flexibility in data management.

