INSERT INTO eventstream_usermngt (timestamp, identifier, action, app, event_type, payload, user_id, user_name)
SELECT
utc_timestamp() as timestamp,
LOWER(id) as identifier,
"ImportedManually Added fromby antonyLegacySupport" as action,
"DbUp (AntonyIntegrationService)Navicat" as app,
2 as event_type, -- EventId = 0 = CustomFieldSetAdded =>
https://diegroupware.atlassian.net/wiki/spaces/DEV/pages/1066205202/Customfields
CONCAT_WS ("", "{", CHAR(13), CHAR(10),
' "UserId":', id, ",", CHAR(13), CHAR(10),
' "Division":', '"', division, '"', ",",CHAR(13), CHAR(10),
' "UserName":', '"', username, '"', ",",CHAR(13), CHAR(10),
' "FirstName":', '"', firstname, '"', ",",CHAR(13), CHAR(10),
' "LastName":', '"', lastname, '"', ",",CHAR(13), CHAR(10),
' "Acronym":', '"', shortcut, '"', ",",CHAR(13), CHAR(10),
' "Mail":', '"', email, '"', ",",CHAR(13), CHAR(10),
' "Telephone":', '"', phone, '"', ",",CHAR(13), CHAR(10),
' "Comment":', '"', comment, '"', ",",CHAR(13), CHAR(10),
' "IsInvisible":', IF(invisible=0,false, true), ",",CHAR(13), CHAR(10),
' "Location":', '"', location, '"', ",",CHAR(13), CHAR(10),
' "Position":', '"', position, '"', ",",CHAR(13), CHAR(10),
' "ExternalTelephone":', '"', external_phone, '"', ",",CHAR(13), CHAR(10),
' "Fax":', '"', fax, '"', ",",CHAR(13), CHAR(10),
"}") as payload,
0 as user_id,
"DbUpSupport" as user_name
FROM user
where id = <userId> |