Introduction to the Work_Instruction_Blocks Table
The work_instruction_blocks table is designed to store individual blocks of work instructions associated with process steps. This table plays a crucial role in the Serial system by providing a flexible and structured way to represent various types of instructional content, such as text, images, videos, and more.Table Structure
The work_instruction_blocks table is structured to accommodate different types of content while maintaining relationships with processes and companies. Here’s a detailed breakdown of its columns:| Column Name | Data Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | Unique identifier for each work instruction block |
| company_id | uuid | foreign key, not null | Reference to the company owning the block |
| process_step_id | uuid | foreign key, not null | Reference to the associated process step |
| order | integer | not null | Order of the block within the process step |
| type | text | not null | Type of the work instruction block |
| file_id | uuid | Reference to an associated file (if applicable) | |
| content | jsonb | JSON content of the block, structure varies by type | |
| created_at | timestamp | not null, default now() | Timestamp of block creation |
| dataset_ref_1 | uuid | Reference to an associated dataset (if applicable) | |
| dataset_ref_2 | uuid | Reference to an associated dataset (if applicable) | |
| dataset_ref_3 | uuid | Reference to an associated dataset (if applicable) | |
| dataset_ref_4 | uuid | Reference to an associated dataset (if applicable) | |
| dataset_ref_5 | uuid | Reference to an associated dataset (if applicable) |
Usage and Functionality
The work_instruction_blocks table is designed to be flexible and extensible, accommodating various types of instructional content. Here are some key points about its usage:- Block Types: The table supports multiple block types, including Heading, Text, Image, Video, PDF, File, List, Table, Callout, Code, and Delimiter. Each type has its own structure within the content JSONB field.
- Content Storage: The content column uses JSONB to store type-specific data. For example, a Heading block might include a ‘text’ field and a ‘level’ field, while an Image block might store ‘file_name’ and ‘height’.
- Ordering: The ‘order’ column ensures that blocks can be displayed in the correct sequence within a process step, allowing for a logical flow of instructions.
- Dataset References: The table includes five dataset reference columns, allowing blocks to be associated with up to five different datasets. This feature enables dynamic content based on dataset information.
Notes
- The work_instruction_blocks table is closely related to the process_steps table, with each block belonging to a specific step in a process.
-
Here’s an example of how a work instruction block might be represented in TypeScript:

