external_sub_items
Overview
Sub items of imported questions (CS's sub_item), mainly the columns of a text matrix.
Table Definition
| Logical name | Physical name | Column | Type | PK | Relation | Unique | Nullable | Default | Notes |
|---|---|---|---|---|---|---|---|---|---|
| External sub item | external_sub_items | id | uuid | โฏ | gen_random_uuid() | ||||
| external_question_id | uuid | external_questions:id (cascade) | |||||||
| external_id | bigint | Sub item ID on the CS side. Referenced by branch conditions | |||||||
| sentence | text | โฏ | Text of the sub item | ||||||
| order_index | integer | โฏ | Position within the question | ||||||
| raw | jsonb | Raw JSON of the sub item object |
Relations
- external_question_id โ external_questions.id (onDelete: cascade)
Indexes
- Primary key (id)
- UNIQUE INDEX: external_sub_items_question_external_id_idx (external_question_id, external_id)
Notes
- Matrix cell conditions: a branch condition on a CS matrix question becomes a cell-level condition by specifying both
answer_item_id(row) andsub_item_id(column) - The extension's conversion maps text matrix rows to
answer_itemsand columns tosub_items rawsometimes contains ananswer_typefield (a case where the sub item side also carries format information)- When registered into the question library, sub items are stored as
normalized_payload.subItems. The design tool's schema has nowhere to store matrix sub items, so reusing such a question writes them into the note text