Skip to main content
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:
  1. 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.
  2. 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.
  3. 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.
  4. Active Status Tracking: The is_active column 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_id column allows for optional association with specific data keys, providing additional flexibility in data management.
By leveraging the component_links table, the Serial application can maintain a comprehensive and flexible representation of component relationships throughout various manufacturing processes, enabling efficient tracking and analysis of product structures and assembly hierarchies.