Message Library (Rich/Template/Quick Reply)
Overview
This domain has three tables: rich_message (message content sent by campaigns and auto-responses,
supporting text, image, tappable image and flex message), template_message (ready-made messages
built from a showcase template), and quick_reply (sets of quick reply buttons that can be attached
to a message).
Table rich_message
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | SERIAL (INTEGER) | NO | nextval(...) | Primary key of the message |
title | TEXT | NO | - | Message name used for reference inside the system |
content | JSONB | NO | - | Message body as JSON, shaped according to type |
line_oa_id | INTEGER | NO | - | Owning LINE OA (FK to line_oa.id) |
type | "RichMessageType" | NO | - | Message kind: text, image, tappable_image, flex_message |
quick_reply_id | UUID | YES | - | Quick reply set attached to this message (refers to quick_reply.id) |
status | "CommonStatus" | NO | - | Message status (active, inactive, draft, ...) |
created_date | TIMESTAMPTZ(3) | NO | now() | Creation timestamp |
created_by | INTEGER | NO | 0 | User who created the record |
updated_date | TIMESTAMPTZ(3) | YES | - | Last update timestamp (maintained automatically) |
updated_by | INTEGER | YES | 0 | User who last updated the record |
deleted_date | TIMESTAMPTZ(3) | YES | - | Soft-delete timestamp |
Table template_message
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | UUID | NO | gen_random_uuid() | Primary key of the template message |
organization_id | INTEGER | NO | 0 | Owning organization |
line_oa_id | INTEGER | NO | - | Owning LINE OA (FK to line_oa.id) |
title | TEXT | NO | - | Template message name |
template_message_showcase_id | INTEGER | NO | - | Showcase template this record was built from |
line_template_message | JSONB | YES | - | Send-ready message structure in LINE Messaging API format |
form_template_message | JSONB | YES | - | Form data entered in the editor, used to compose line_template_message |
status | "CommonStatus" | NO | active | Template status |
created_date | TIMESTAMPTZ(3) | NO | now() | Creation timestamp |
created_by | INTEGER | NO | 0 | User who created the record |
updated_date | TIMESTAMPTZ(3) | YES | - | Last update timestamp (maintained automatically) |
updated_by | INTEGER | YES | 0 | User who last updated the record |
deleted_date | TIMESTAMPTZ(3) | YES | - | Soft-delete timestamp |
Table quick_reply
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | UUID | NO | gen_random_uuid() | Primary key of the quick reply set |
line_oa_id | BIGINT | NO | - | Owning LINE OA |
organization_id | BIGINT | NO | - | Owning organization |
name | TEXT | NO | - | Quick reply set name |
items | JSONB | NO | [] | Quick reply buttons (label and action for each button) |
status | TEXT | NO | 'active' | Usage status of the quick reply set |
created_date | TIMESTAMPTZ(3) | NO | now() | Creation timestamp |
created_by | BIGINT | NO | 0 | User who created the record |
updated_date | TIMESTAMPTZ(3) | YES | - | Last update timestamp (maintained automatically) |
updated_by | BIGINT | YES | - | User who last updated the record |
deleted_date | TIMESTAMPTZ(3) | YES | - | Soft-delete timestamp |
Notes
rich_message.line_oa_idandtemplate_message.line_oa_idare FKs toline_oa.id.rich_messageis referenced bycampaign.rich_message_idandauto_response.rich_message_id.rich_message.quick_reply_idis stored as a UUID and indexed, but is not declared as an FK constraint in the schema (it logically points atquick_reply.id).- Key indexes:
rich_messageonline_oa_idandquick_reply_id;template_messageon (line_oa_id,template_message_showcase_id,status) andcreated_date;quick_replyon (line_oa_id,status) andcreated_date. quick_replyusesBIGINTfor its reference id columns (line_oa_id,organization_id,created_by,updated_by), unlike the other two tables which useINTEGER.