Skip to main content

LINE Friends (LINE User)

Overview

This domain has a single table, line_user, which stores the profile of each friend (follower) of a LINE OA. One row represents one LINE-user-to-channel pair and combines LINE profile data, customer-supplied details, follow/unfollow state, the linked rich menu, audience membership and organization-defined custom attributes (custom_attribute).

Table line_user

ColumnTypeNullableDefaultDescription
idUUIDNOT NULLgen_random_uuid()Internal primary key
user_idTEXTNOT NULLLINE user ID (Uxxxxxxxx...) from the LINE Platform
display_nameTEXTNOT NULLDisplay name on the LINE profile
picture_urlTEXTNOT NULLProfile picture URL from LINE
user_infoJSONBNULLRaw profile payload returned by the LINE API
languageTEXTNOT NULL'th'Language used to communicate with this friend
firstnameTEXTNULLFirst name (from a registration form or a data import)
lastnameTEXTNULLLast name
emailTEXTNULLEmail address
mobile_noTEXTNULLMobile phone number
followCommonConfirm (enum)NOT NULLCurrent friendship state: yes = still following, no = blocked/unfollowed
rich_menu_idINTEGERNULLRich menu linked to this user (FK to rich_menu.id)
registered_dateTIMESTAMPTZ(3)NULLRegistration date (form submission / identity verification)
unfollow_dateTIMESTAMPTZ(3)NULLDate the user unfollowed or blocked the OA
statusCommonStatus (enum)NOT NULLactiveRecord status
deleted_dateTIMESTAMPTZ(3)NULLSoft-delete timestamp
created_byINTEGERNULLUser id of the creator (when created from the CMS or an import)
updated_byINTEGERNULLUser id of the last editor
created_dateTIMESTAMPTZ(3)NOT NULLCURRENT_TIMESTAMPRecord creation timestamp
updated_dateTIMESTAMPTZ(3)NULLLast update timestamp
organization_idINTEGERNOT NULLOrganization owning the record
line_oa_idINTEGERNOT NULLLINE OA channel this user is a friend of
user_typeLineUserType (enum)NULLguestFriend type: guest (not registered) or member (registered)
last_activity_typeActivityType (enum)NULLfollowMost recent activity type: follow, unfollow, message, tracking
last_activity_periodActivityPeriod (enum)NULLTime of day of the last activity: morning, afternoon, evening, night
last_activity_dateTIMESTAMPTZ(3)NULLCURRENT_TIMESTAMPTimestamp of the last activity
last_activity_statusActivityStatus (enum)NULLactiveEngagement status: active or inactive
audience_idsJSONBNULLIDs of the audiences/segments this user belongs to (JSON array)
rich_menu_archive_idINTEGERNULLArchived rich menu previously linked to the user (FK to rich_menu_archive.id)
custom_attributeJSONBNULL{}Organization-defined attributes, stored as key-value pairs declared in attribute_master

Notes

  • Unique constraint: (user_id, line_oa_id, organization_id) — the same LINE user may be a friend of several channels, but only one row exists per channel.
  • Indexes: line_user_line_oa_id_idx (btree on line_oa_id) and line_user_audience_ids_idx (GIN on audience_ids, for fast audience-membership queries).
  • Foreign keys: rich_menu_id -> rich_menu.id, rich_menu_archive_id -> rich_menu_archive.id. organization_id and line_oa_id are logical references and are not declared as FK constraints in Prisma.
  • custom_attribute is a key-value JSON object, e.g. {"member_tier":"gold","birth_month":"05"}. The allowed keys and their data types are defined per channel in the attribute_master table. The default is an empty object.
  • audience_ids is a JSON array of audience ids refreshed whenever audiences are recalculated. The GIN index makes it possible to find an audience's members without joining a link table.
  • The last_activity_* columns power behavioural segments, such as "friends with no activity for more than N days".