Skip to main content

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

ColumnTypeNullableDefaultDescription
idSERIAL (INTEGER)NOnextval(...)Primary key of the attribute definition set
line_oa_idINTEGERNO-Owning LINE OA (FK to line_oa.id)
organization_idINTEGERNO-Owning organization
nameVARCHAR(255)NO-Name of the attribute definition set
descriptionTEXTYES-Additional description of the definition set
schemaJSONBNO{"version": "1.0", "attributes": []}Full attribute definition structure (version plus the attribute list with types and options)
statusVARCHAR(20)NO'active'Usage status of the definition set
created_byINTEGERYES-User who created the record
updated_byINTEGERYES-User who last updated the record
created_dateTIMESTAMPTZ(3)NOnow()Creation timestamp
updated_dateTIMESTAMPTZ(3)YES-Last update timestamp
deleted_dateTIMESTAMPTZ(3)YES-Soft-delete timestamp (NULL means not deleted)

Table system_attribute

ColumnTypeNullableDefaultDescription
idSERIAL (INTEGER)NOnextval(...)Primary key of the system variable
line_oa_idINTEGERNO-LINE OA the variable belongs to
organization_idINTEGERNO-Owning organization
keyVARCHAR(255)NO-Variable key (unique per OA + organization)
valueTEXTNO''Variable value, always stored as text and interpreted per data_type
data_typeVARCHAR(20)NO'string'Data type of the stored value, e.g. string, number, boolean
expires_atTIMESTAMPTZYES-Expiry timestamp of the value (NULL means never expires)
descriptionVARCHAR(500)YES-What the variable is used for
created_byINTEGERYES-User who created the record
updated_byINTEGERYES-User who last updated the record
created_dateTIMESTAMP(3)YESnow()Creation timestamp
updated_dateTIMESTAMP(3)YESnow()Last update timestamp
deleted_dateTIMESTAMP(3)YES-Soft-delete timestamp

Notes

  • attribute_master.line_oa_id is an FK to line_oa.id with ON DELETE CASCADE — deleting a LINE OA removes its attribute definition sets.
  • attribute_master has a unique constraint on (line_oa_id, organization_id, name): definition set names must be unique within an OA + organization.
  • system_attribute has the unique constraint uq_system_attribute_oa_org_key on (line_oa_id, organization_id, key) and the index idx_system_attr_oa on (line_oa_id, organization_id).
  • The timestamp columns of system_attribute declare no timezone in the schema, so they are TIMESTAMP(3) rather than the TIMESTAMPTZ(3) used by attribute_master.