Attribute Definitions & System Variables
Overview
This domain has two tables. attribute_master stores the definition (schema) of the custom
attributes each LINE OA declares for its LINE users, while system_attribute stores OA/organization
level system variables as key-value pairs (constants or config consumed by merge tags and rule
conditions). Both tables are scoped by line_oa_id + organization_id and use soft deletes via
deleted_date.
Table attribute_master
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | SERIAL (INTEGER) | NO | nextval(...) | Primary key of the attribute definition set |
line_oa_id | INTEGER | NO | - | Owning LINE OA (FK to line_oa.id) |
organization_id | INTEGER | NO | - | Owning organization |
name | VARCHAR(255) | NO | - | Name of the attribute definition set |
description | TEXT | YES | - | Additional description of the definition set |
schema | JSONB | NO | {"version": "1.0", "attributes": []} | Full attribute definition structure (version plus the attribute list with types and options) |
status | VARCHAR(20) | NO | 'active' | Usage status of the definition set |
created_by | INTEGER | YES | - | User who created the record |
updated_by | INTEGER | YES | - | User who last updated the record |
created_date | TIMESTAMPTZ(3) | NO | now() | Creation timestamp |
updated_date | TIMESTAMPTZ(3) | YES | - | Last update timestamp |
deleted_date | TIMESTAMPTZ(3) | YES | - | Soft-delete timestamp (NULL means not deleted) |
Table system_attribute
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | SERIAL (INTEGER) | NO | nextval(...) | Primary key of the system variable |
line_oa_id | INTEGER | NO | - | LINE OA the variable belongs to |
organization_id | INTEGER | NO | - | Owning organization |
key | VARCHAR(255) | NO | - | Variable key (unique per OA + organization) |
value | TEXT | NO | '' | Variable value, always stored as text and interpreted per data_type |
data_type | VARCHAR(20) | NO | 'string' | Data type of the stored value, e.g. string, number, boolean |
expires_at | TIMESTAMPTZ | YES | - | Expiry timestamp of the value (NULL means never expires) |
description | VARCHAR(500) | YES | - | What the variable is used for |
created_by | INTEGER | YES | - | User who created the record |
updated_by | INTEGER | YES | - | User who last updated the record |
created_date | TIMESTAMP(3) | YES | now() | Creation timestamp |
updated_date | TIMESTAMP(3) | YES | now() | Last update timestamp |
deleted_date | TIMESTAMP(3) | YES | - | Soft-delete timestamp |
Notes
attribute_master.line_oa_idis an FK toline_oa.idwithON DELETE CASCADE— deleting a LINE OA removes its attribute definition sets.attribute_masterhas a unique constraint on (line_oa_id,organization_id,name): definition set names must be unique within an OA + organization.system_attributehas the unique constraintuq_system_attribute_oa_org_keyon (line_oa_id,organization_id,key) and the indexidx_system_attr_oaon (line_oa_id,organization_id).- The timestamp columns of
system_attributedeclare no timezone in the schema, so they areTIMESTAMP(3)rather than theTIMESTAMPTZ(3)used byattribute_master.