Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

21.0 KB
Raw Blame
-- Fixture for channels outbound repo integration tests.
--
-- Channel: ch1 (public, in org 1)
-- Top-level messages: msg1 (oldest), msg2, msg3 (newest)
-- msg1 has a thread with 4 replies (r1..r4), reactions, and an attachment
-- msg2 is soft-deleted but has an active reply → should still appear in message listings
-- but its attachments should not appear in the channel attachments endpoint
-- msg3 is a normal message with no thread
--
-- Also:
-- deleted_msg: soft-deleted with no active replies → should NOT appear
-- Channel: ch2 (separate channel for isolation tests)
-- Participants: owner, admin, member (active), left_user (left)

-- Team channels for bulk membership tests.
INSERT INTO macro_user (id, username, email, stripe_customer_id) VALUES
  ('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 'team-owner-a', '[email protected]', 'cus_team_a'),
  ('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', 'team-owner-b', '[email protected]', 'cus_team_b'),
  ('cccccccc-cccc-cccc-cccc-cccccccccccc', 'left-user', '[email protected]', 'cus_left_user'),
  ('dddddddd-dddd-dddd-dddd-dddddddddddd', 'user-d', '[email protected]', 'cus_user_d');

INSERT INTO "User" (id, email, macro_user_id) VALUES
  ('macro|[email protected]', '[email protected]', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'),
  ('macro|[email protected]', '[email protected]', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb'),
  ('macro|[email protected]', '[email protected]', 'cccccccc-cccc-cccc-cccc-cccccccccccc'),
  ('macro|[email protected]', '[email protected]', 'dddddddd-dddd-dddd-dddd-dddddddddddd');

INSERT INTO team (id, name, owner_id) VALUES
  ('11111111-1111-1111-1111-111111111111', 'Team A', 'macro|[email protected]'),
  ('22222222-2222-2222-2222-222222222222', 'Team B', 'macro|[email protected]');

-- Team memberships for the channel-list participation tests: left-user is on
-- Team A (participant of c11/c13, left c12); user-d is on Team B but has never
-- joined its channel c21. (team_user is unique per user, so one team each.)
INSERT INTO team_user (user_id, team_id, team_role) VALUES
  ('macro|[email protected]', '11111111-1111-1111-1111-111111111111', 'member'),
  ('macro|[email protected]', '22222222-2222-2222-2222-222222222222', 'member');

INSERT INTO comms_channels (
  id, name, channel_type, org_id, owner_id, team_id, auto_join_team, created_at, updated_at
) VALUES
  ('00000000-0000-0000-0000-000000000c11', 'team-a-auto-active', 'team', NULL,
   'macro|[email protected]', '11111111-1111-1111-1111-111111111111', TRUE,
   '2024-01-01 00:00:00+00', '2024-01-01 00:00:00+00'),
  ('00000000-0000-0000-0000-000000000c12', 'team-a-auto-left', 'team', NULL,
   'macro|[email protected]', '11111111-1111-1111-1111-111111111111', TRUE,
   '2024-01-01 00:00:00+00', '2024-01-01 00:00:00+00'),
  ('00000000-0000-0000-0000-000000000c13', 'team-a-manual', 'team', NULL,
   'macro|[email protected]', '11111111-1111-1111-1111-111111111111', FALSE,
   '2024-01-01 00:00:00+00', '2024-01-01 00:00:00+00'),
  ('00000000-0000-0000-0000-000000000c21', 'team-b-auto', 'team', NULL,
   'macro|[email protected]', '22222222-2222-2222-2222-222222222222', TRUE,
   '2024-01-01 00:00:00+00', '2024-01-01 00:00:00+00');

INSERT INTO comms_channel_participants (channel_id, user_id, role, joined_at, left_at) VALUES
  ('00000000-0000-0000-0000-000000000c11', 'macro|[email protected]', 'admin',
   '2024-01-01 00:00:00+00', NULL),
  ('00000000-0000-0000-0000-000000000c12', 'macro|[email protected]', 'admin',
   '2024-01-01 00:01:00+00', '2024-01-05 00:00:00+00'),
  ('00000000-0000-0000-0000-000000000c13', 'macro|[email protected]', 'owner',
   '2024-01-01 00:02:00+00', NULL),
  ('00000000-0000-0000-0000-000000000c21', 'macro|[email protected]', 'member',
   '2024-01-01 00:03:00+00', NULL);

-- channels
INSERT INTO comms_channels (id, name, channel_type, org_id, owner_id, created_at, updated_at) VALUES
  ('00000000-0000-0000-0000-000000000c01', 'test-channel', 'public', NULL, 'macro|[email protected]',
   '2024-01-01 00:00:00+00', '2024-01-01 00:00:00+00'),
  ('00000000-0000-0000-0000-000000000c02', 'other-channel', 'public', NULL, 'macro|[email protected]',
   '2024-01-01 00:00:00+00', '2024-01-01 00:00:00+00');

-- top-level messages in ch1 (thread_id IS NULL)
INSERT INTO comms_messages (id, parent_entity_type, parent_entity_id, thread_id, sender_id, content, created_at, updated_at, edited_at, deleted_at) VALUES
  -- msg1: oldest, has thread
  ('00000000-0000-0000-0000-000000000001', 'channel', '00000000-0000-0000-0000-000000000c01', NULL,
   'macro|[email protected]', 'first message', '2024-01-01 10:00:00+00', '2024-01-01 10:00:00+00', NULL, NULL),
  -- msg2: soft-deleted but has active reply → should appear
  ('00000000-0000-0000-0000-000000000002', 'channel', '00000000-0000-0000-0000-000000000c01', NULL,
   'macro|[email protected]', 'deleted with reply', '2024-01-01 11:00:00+00', '2024-01-01 11:00:00+00', NULL, '2024-01-02 00:00:00'),
  -- msg3: newest, edited
  ('00000000-0000-0000-0000-000000000003', 'channel', '00000000-0000-0000-0000-000000000c01', NULL,
   'macro|[email protected]', 'third message edited', '2024-01-01 12:00:00+00', '2024-01-01 13:00:00+00', '2024-01-01 13:00:00', NULL),
  -- deleted_msg: soft-deleted with NO active replies → should NOT appear
  ('00000000-0000-0000-0000-000000000004', 'channel', '00000000-0000-0000-0000-000000000c01', NULL,
   'macro|[email protected]', 'fully deleted', '2024-01-01 09:00:00+00', '2024-01-01 09:00:00+00', NULL, '2024-01-02 00:00:00'),
  -- message in ch2 for isolation
  ('00000000-0000-0000-0000-000000000005', 'channel', '00000000-0000-0000-0000-000000000c02', NULL,
   'macro|[email protected]', 'other channel msg', '2024-01-01 10:00:00+00', '2024-01-01 10:00:00+00', NULL, NULL);

-- thread replies under msg1 (4 replies)
INSERT INTO comms_messages (id, parent_entity_type, parent_entity_id, thread_id, sender_id, content, created_at, updated_at, edited_at, deleted_at) VALUES
  ('00000000-0000-0000-0000-00000000b001', 'channel', '00000000-0000-0000-0000-000000000c01',
   '00000000-0000-0000-0000-000000000001', 'macro|[email protected]', 'reply 1',
   '2024-01-01 10:01:00+00', '2024-01-01 10:01:00+00', NULL, NULL),
  ('00000000-0000-0000-0000-00000000b002', 'channel', '00000000-0000-0000-0000-000000000c01',
   '00000000-0000-0000-0000-000000000001', 'macro|[email protected]', 'reply 2',
   '2024-01-01 10:02:00+00', '2024-01-01 10:02:00+00', NULL, NULL),
  ('00000000-0000-0000-0000-00000000b003', 'channel', '00000000-0000-0000-0000-000000000c01',
   '00000000-0000-0000-0000-000000000001', 'macro|[email protected]', 'reply 3',
   '2024-01-01 10:03:00+00', '2024-01-01 10:03:00+00', NULL, NULL),
  ('00000000-0000-0000-0000-00000000b004', 'channel', '00000000-0000-0000-0000-000000000c01',
   '00000000-0000-0000-0000-000000000001', 'macro|[email protected]', 'reply 4',
   '2024-01-01 10:04:00+00', '2024-01-01 10:04:00+00', NULL, NULL);

-- active reply under msg2 (the deleted parent)
INSERT INTO comms_messages (id, parent_entity_type, parent_entity_id, thread_id, sender_id, content, created_at, updated_at, edited_at, deleted_at) VALUES
  ('00000000-0000-0000-0000-00000000b005', 'channel', '00000000-0000-0000-0000-000000000c01',
   '00000000-0000-0000-0000-000000000002', 'macro|[email protected]', 'reply to deleted',
   '2024-01-01 11:01:00+00', '2024-01-01 11:01:00+00', NULL, NULL);

-- deleted reply under deleted_msg (no active replies)
INSERT INTO comms_messages (id, parent_entity_type, parent_entity_id, thread_id, sender_id, content, created_at, updated_at, edited_at, deleted_at) VALUES
  ('00000000-0000-0000-0000-00000000b006', 'channel', '00000000-0000-0000-0000-000000000c01',
   '00000000-0000-0000-0000-000000000004', 'macro|[email protected]', 'also deleted reply',
   '2024-01-01 09:01:00+00', '2024-01-01 09:01:00+00', NULL, '2024-01-02 00:00:00');

-- reactions on msg1
INSERT INTO comms_reactions (message_id, emoji, user_id, created_at) VALUES
  ('00000000-0000-0000-0000-000000000001', '👍', 'macro|[email protected]', '2024-01-01 10:10:00+00'),
  ('00000000-0000-0000-0000-000000000001', '👍', 'macro|[email protected]', '2024-01-01 10:11:00+00'),
  ('00000000-0000-0000-0000-000000000001', '🎉', 'macro|[email protected]', '2024-01-01 10:12:00+00');

-- reactions on msg3
INSERT INTO comms_reactions (message_id, emoji, user_id, created_at) VALUES
  ('00000000-0000-0000-0000-000000000003', '👍', 'macro|[email protected]', '2024-01-01 12:10:00+00');

-- attachments on msg1
INSERT INTO comms_attachments (id, message_id, entity_type, entity_id, width, height, created_at) VALUES
  ('00000000-0000-0000-0000-00000000a001', '00000000-0000-0000-0000-000000000001',
   'document', 'doc-1', NULL, NULL, '2024-01-01 10:00:00+00'),
  ('00000000-0000-0000-0000-00000000a002', '00000000-0000-0000-0000-000000000001',
   'image', 'img-1', 800, 600, '2024-01-01 10:00:01+00');

-- attachment on msg3
INSERT INTO comms_attachments (id, message_id, entity_type, entity_id, width, height, created_at) VALUES
  ('00000000-0000-0000-0000-00000000a003', '00000000-0000-0000-0000-000000000003',
   'document', 'doc-2', NULL, NULL, '2024-01-01 12:00:00+00');

-- attachment on deleted msg2: should be excluded from channel-level attachments
INSERT INTO comms_attachments (id, message_id, entity_type, entity_id, width, height, created_at) VALUES
  ('00000000-0000-0000-0000-00000000a004', '00000000-0000-0000-0000-000000000002',
   'image', 'img-deleted', 640, 480, '2024-01-01 11:00:30+00');

-- participants in ch1
INSERT INTO comms_channel_participants (channel_id, user_id, role, joined_at, left_at) VALUES
  ('00000000-0000-0000-0000-000000000c01', 'macro|[email protected]', 'owner', '2024-01-01 00:00:00+00', NULL),
  ('00000000-0000-0000-0000-000000000c01', 'macro|[email protected]', 'admin', '2024-01-01 00:01:00+00', NULL),
  ('00000000-0000-0000-0000-000000000c01', 'macro|[email protected]', 'member', '2024-01-01 00:02:00+00', NULL),
  ('00000000-0000-0000-0000-000000000c01', 'macro|[email protected]', 'member', '2024-01-01 00:03:00+00', '2024-01-05 00:00:00+00');

-- Channel ch3: isolated thread-recipient correctness fixture.
-- A departed participant (left-user) authored a reply in a thread whose parent
-- was authored by an active participant (user-a). The departed sender must be
-- excluded from thread recipient/notification lookups, while the active sender
-- is still included.
INSERT INTO comms_channels (id, name, channel_type, org_id, owner_id, created_at, updated_at) VALUES
  ('00000000-0000-0000-0000-000000000c03', 'thread-recipients', 'public', NULL, 'macro|[email protected]',
   '2024-01-01 00:00:00+00', '2024-01-01 00:00:00+00');

INSERT INTO comms_messages (id, parent_entity_type, parent_entity_id, thread_id, sender_id, content, created_at, updated_at, edited_at, deleted_at) VALUES
  -- thread parent authored by an active participant
  ('00000000-0000-0000-0000-000000000031', 'channel', '00000000-0000-0000-0000-000000000c03', NULL,
   'macro|[email protected]', 'thread parent', '2024-01-01 10:00:00+00', '2024-01-01 10:00:00+00', NULL, NULL),
  -- reply authored by a participant who later left the channel
  ('00000000-0000-0000-0000-00000000b031', 'channel', '00000000-0000-0000-0000-000000000c03',
   '00000000-0000-0000-0000-000000000031', 'macro|[email protected]', 'reply from departed user',
   '2024-01-01 10:01:00+00', '2024-01-01 10:01:00+00', NULL, NULL);

INSERT INTO comms_channel_participants (channel_id, user_id, role, joined_at, left_at) VALUES
  ('00000000-0000-0000-0000-000000000c03', 'macro|[email protected]', 'owner', '2024-01-01 00:00:00+00', NULL),
  ('00000000-0000-0000-0000-000000000c03', 'macro|[email protected]', 'member', '2024-01-01 00:03:00+00', '2024-01-05 00:00:00+00');

-- Channel ch4: participant-filter fixture (no user-a so ch4 threads stay out of the
-- user-a listing assertions above).
-- Participants: user-b (owner), user-c (member), user-e (member), left-user (left).
-- Threads (all rooted by user-b):
--   t41 (10:00): user-c replied (10:05); left-user replied (10:06); a soft-deleted
--       reply from user-e (10:07) that must NOT make user-e a participant; a
--       soft-deleted reply from user-b (10:09) that @-mentions user-e, which
--       likewise must NOT make user-e a participant
--   t42 (11:00): user-c is @-mentioned in the root message
--   t43 (12:00): root message contains a group mention (@here), stored as the
--       client-side expansion: one user mention row per member at send time
--   t44 (13:00): plain root; a reply (13:05) contains a group mention (@here),
--       likewise expanded into per-user mention rows
INSERT INTO comms_channels (id, name, channel_type, org_id, owner_id, created_at, updated_at) VALUES
  ('00000000-0000-0000-0000-000000000c04', 'participant-filter', 'public', NULL, 'macro|[email protected]',
   '2024-01-02 00:00:00+00', '2024-01-02 00:00:00+00');

INSERT INTO comms_channel_participants (channel_id, user_id, role, joined_at, left_at) VALUES
  ('00000000-0000-0000-0000-000000000c04', 'macro|[email protected]', 'owner', '2024-01-02 00:00:00+00', NULL),
  ('00000000-0000-0000-0000-000000000c04', 'macro|[email protected]', 'member', '2024-01-02 00:01:00+00', NULL),
  ('00000000-0000-0000-0000-000000000c04', 'macro|[email protected]', 'member', '2024-01-02 00:02:00+00', NULL),
  ('00000000-0000-0000-0000-000000000c04', 'macro|[email protected]', 'member', '2024-01-02 00:03:00+00', '2024-01-05 00:00:00+00');

INSERT INTO comms_messages (id, parent_entity_type, parent_entity_id, thread_id, sender_id, content, created_at, updated_at, edited_at, deleted_at) VALUES
  -- t41: replies determine participants
  ('00000000-0000-0000-0000-000000000041', 'channel', '00000000-0000-0000-0000-000000000c04', NULL,
   'macro|[email protected]', 'participant thread parent', '2024-01-02 10:00:00+00', '2024-01-02 10:00:00+00', NULL, NULL),
  ('00000000-0000-0000-0000-00000000b041', 'channel', '00000000-0000-0000-0000-000000000c04',
   '00000000-0000-0000-0000-000000000041', 'macro|[email protected]', 'reply from user-c',
   '2024-01-02 10:05:00+00', '2024-01-02 10:05:00+00', NULL, NULL),
  ('00000000-0000-0000-0000-00000000b042', 'channel', '00000000-0000-0000-0000-000000000c04',
   '00000000-0000-0000-0000-000000000041', 'macro|[email protected]', 'reply from departed user',
   '2024-01-02 10:06:00+00', '2024-01-02 10:06:00+00', NULL, NULL),
  ('00000000-0000-0000-0000-00000000b043', 'channel', '00000000-0000-0000-0000-000000000c04',
   '00000000-0000-0000-0000-000000000041', 'macro|[email protected]', 'deleted reply from user-e',
   '2024-01-02 10:07:00+00', '2024-01-02 10:07:00+00', NULL, '2024-01-02 10:08:00+00'),
  ('00000000-0000-0000-0000-00000000b045', 'channel', '00000000-0000-0000-0000-000000000c04',
   '00000000-0000-0000-0000-000000000041', 'macro|[email protected]', '',
   '2024-01-02 10:09:00+00', '2024-01-02 10:10:00+00', NULL, '2024-01-02 10:10:00+00'),
  -- t42: @-mention determines participants (mention row below)
  ('00000000-0000-0000-0000-000000000042', 'channel', '00000000-0000-0000-0000-000000000c04', NULL,
   'macro|[email protected]', 'mentioning <m-user-mention>{"userId":"macro|[email protected]","email":"[email protected]"}</m-user-mention>',
   '2024-01-02 11:00:00+00', '2024-01-02 11:00:00+00', NULL, NULL),
  -- t43: group mention in the root message
  ('00000000-0000-0000-0000-000000000043', 'channel', '00000000-0000-0000-0000-000000000c04', NULL,
   'macro|[email protected]', 'heads up <m-group-mention>{"groupAlias":"here"}</m-group-mention>',
   '2024-01-02 12:00:00+00', '2024-01-02 12:00:00+00', NULL, NULL),
  -- t44: group mention in a reply
  ('00000000-0000-0000-0000-000000000044', 'channel', '00000000-0000-0000-0000-000000000c04', NULL,
   'macro|[email protected]', 'plain parent', '2024-01-02 13:00:00+00', '2024-01-02 13:00:00+00', NULL, NULL),
  ('00000000-0000-0000-0000-00000000b044', 'channel', '00000000-0000-0000-0000-000000000c04',
   '00000000-0000-0000-0000-000000000044', 'macro|[email protected]',
   'pinging <m-group-mention>{"groupAlias":"here"}</m-group-mention>',
   '2024-01-02 13:05:00+00', '2024-01-02 13:05:00+00', NULL, NULL);

-- user-c is @-mentioned in t42's root message
INSERT INTO comms_entity_mentions (id, source_entity_type, source_entity_id, entity_type, entity_id, user_id, created_at) VALUES
  ('00000000-0000-0000-0000-00000000e042', 'message', '00000000-0000-0000-0000-000000000042',
   'user', 'macro|[email protected]', NULL, '2024-01-02 11:00:00+00');

-- user-e was @-mentioned in t41's soft-deleted reply from user-b. Deleting a
-- message clears its content but leaves its mention rows behind, so the mention
-- must be ignored through the message's deleted_at.
INSERT INTO comms_entity_mentions (id, source_entity_type, source_entity_id, entity_type, entity_id, user_id, created_at) VALUES
  ('00000000-0000-0000-0000-00000000e045', 'message', '00000000-0000-0000-0000-00000000b045',
   'user', 'macro|[email protected]', NULL, '2024-01-02 10:09:00+00');

-- @here in t43's root message and t44's reply, as sent by the client: expanded into
-- one user mention row per channel member at send time (left-user had not left yet)
INSERT INTO comms_entity_mentions (id, source_entity_type, source_entity_id, entity_type, entity_id, user_id, created_at) VALUES
  ('00000000-0000-0000-0000-00000000e431', 'message', '00000000-0000-0000-0000-000000000043',
   'user', 'macro|[email protected]', NULL, '2024-01-02 12:00:00+00'),
  ('00000000-0000-0000-0000-00000000e432', 'message', '00000000-0000-0000-0000-000000000043',
   'user', 'macro|[email protected]', NULL, '2024-01-02 12:00:00+00'),
  ('00000000-0000-0000-0000-00000000e433', 'message', '00000000-0000-0000-0000-000000000043',
   'user', 'macro|[email protected]', NULL, '2024-01-02 12:00:00+00'),
  ('00000000-0000-0000-0000-00000000e434', 'message', '00000000-0000-0000-0000-000000000043',
   'user', 'macro|[email protected]', NULL, '2024-01-02 12:00:00+00'),
  ('00000000-0000-0000-0000-00000000e441', 'message', '00000000-0000-0000-0000-00000000b044',
   'user', 'macro|[email protected]', NULL, '2024-01-02 13:05:00+00'),
  ('00000000-0000-0000-0000-00000000e442', 'message', '00000000-0000-0000-0000-00000000b044',
   'user', 'macro|[email protected]', NULL, '2024-01-02 13:05:00+00'),
  ('00000000-0000-0000-0000-00000000e443', 'message', '00000000-0000-0000-0000-00000000b044',
   'user', 'macro|[email protected]', NULL, '2024-01-02 13:05:00+00'),
  ('00000000-0000-0000-0000-00000000e444', 'message', '00000000-0000-0000-0000-00000000b044',
   'user', 'macro|[email protected]', NULL, '2024-01-02 13:05:00+00');

-- entity mentions (used by attachment-references tests)
-- doc-mention is mentioned inside msg3 (a message source → channel reference, gated by participation)
-- doc-generic is mentioned by a non-message source (doc → generic reference, not gated)
-- doc-2 already has a direct attachment on msg3 (a003, 12:00); this newer generic mention
--   lets the merge/sort test assert generic-before-channel ordering
INSERT INTO comms_entity_mentions (id, source_entity_type, source_entity_id, entity_type, entity_id, user_id, created_at) VALUES
  ('00000000-0000-0000-0000-00000000e001', 'message', '00000000-0000-0000-0000-000000000003',
   'document', 'doc-mention', 'macro|[email protected]', '2024-01-01 12:00:00+00'),
  ('00000000-0000-0000-0000-00000000e002', 'doc', 'src-doc',
   'document', 'doc-generic', 'macro|[email protected]', '2024-01-03 00:00:00+00'),
  ('00000000-0000-0000-0000-00000000e003', 'doc', 'src-doc-2',
   'document', 'doc-2', 'macro|[email protected]', '2024-01-04 00:00:00+00');

-- comments: messages on non-channel parents (used by attachment-references tests)
-- c0a1: an initiative discussion comment mentioning doc-comment
-- c0a2: a document discussion comment attaching doc-comment
-- c0a3: a soft-deleted reply under c0a1 that also mentions doc-comment → excluded
INSERT INTO comms_messages (id, parent_entity_type, parent_entity_id, thread_id, sender_id, content, created_at, updated_at, edited_at, deleted_at) VALUES
  ('00000000-0000-0000-0000-00000000c0a1', 'initiative', '00000000-0000-0000-0000-0000000000a1', NULL,
   'macro|[email protected]', 'see <m-document-mention>doc-comment</m-document-mention>',
   '2024-01-05 10:00:00+00', '2024-01-05 10:00:00+00', NULL, NULL),
  ('00000000-0000-0000-0000-00000000c0a2', 'document', 'doc-parent', NULL,
   'macro|[email protected]', 'attached here',
   '2024-01-05 11:00:00+00', '2024-01-05 11:00:00+00', NULL, NULL),
  ('00000000-0000-0000-0000-00000000c0a3', 'initiative', '00000000-0000-0000-0000-0000000000a1',
   '00000000-0000-0000-0000-00000000c0a1', 'macro|[email protected]', 'deleted reply',
   '2024-01-05 12:00:00+00', '2024-01-05 12:00:00+00', NULL, '2024-01-06 00:00:00');

INSERT INTO comms_entity_mentions (id, source_entity_type, source_entity_id, entity_type, entity_id, user_id, created_at) VALUES
  ('00000000-0000-0000-0000-00000000e0c1', 'message', '00000000-0000-0000-0000-00000000c0a1',
   'document', 'doc-comment', 'macro|[email protected]', '2024-01-05 10:00:00+00'),
  ('00000000-0000-0000-0000-00000000e0c3', 'message', '00000000-0000-0000-0000-00000000c0a3',
   'document', 'doc-comment', 'macro|[email protected]', '2024-01-05 12:00:00+00');

INSERT INTO comms_attachments (id, message_id, entity_type, entity_id, width, height, created_at) VALUES
  ('00000000-0000-0000-0000-00000000a0c2', '00000000-0000-0000-0000-00000000c0a2',
   'document', 'doc-comment', NULL, NULL, '2024-01-05 11:00:00+00');