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 NULL–LINE user ID (Uxxxxxxxx...) from the LINE Platform
display_nameTEXTNOT NULL–Display name on the LINE profile
picture_urlTEXTNOT NULL–Profile picture URL from LINE
user_infoJSONBNULL–Raw profile payload returned by the LINE API
languageTEXTNOT NULL'th'Language used to communicate with this friend
firstnameTEXTNULL–First name (from a registration form or a data import)
lastnameTEXTNULL–Last name
emailTEXTNULL–Email address
mobile_noTEXTNULL–Mobile phone number
followCommonConfirm (enum)NOT NULL–Current friendship state: yes = still following, no = blocked/unfollowed
rich_menu_idINTEGERNULL–Rich menu linked to this user (FK to rich_menu.id)
registered_dateTIMESTAMPTZ(3)NULL–Registration date (form submission / identity verification)
unfollow_dateTIMESTAMPTZ(3)NULL–Date the user unfollowed or blocked the OA
statusCommonStatus (enum)NOT NULLactiveRecord status
deleted_dateTIMESTAMPTZ(3)NULL–Soft-delete timestamp
created_byINTEGERNULL–User id of the creator (when created from the CMS or an import)
updated_byINTEGERNULL–User id of the last editor
created_dateTIMESTAMPTZ(3)NOT NULLCURRENT_TIMESTAMPRecord creation timestamp
updated_dateTIMESTAMPTZ(3)NULL–Last update timestamp
organization_idINTEGERNOT NULL–Organization owning the record
line_oa_idINTEGERNOT NULL–LINE 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)NULL–Time 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_idsJSONBNULL–IDs of the audiences/segments this user belongs to (JSON array)
rich_menu_archive_idINTEGERNULL–Archived 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".