Poller: the Supabase schema of the conversations (tables, checkpoint, attachments bucket)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-24 16:42:09 +01:00
1 parent 00487fc424
commit b0b7e3411d
4 files changed
+474

No files matched your search

@@ -0,0 +1,35 @@
-- The LibreDesk conversations, copied by poller/poll.py (docs/superpowers/specs/2026-11-24-conversations-supabase-design.md).
-- raw: LibreDesk's response as is; the other columns are taken from it, for searching.
create table conversations (
uuid text primary key,
reference_number text,
subject text,
status text,
inbox_name text,
contact_email text,
created_at timestamptz,
updated_at timestamptz not null,
raw jsonb not null
);
create index conversations_updated_at on conversations (updated_at desc);
create table messages (
uuid text primary key,
conversation_uuid text not null references conversations (uuid),
type text,
sender_type text,
private boolean,
created_at timestamptz,
raw jsonb not null
);
create index messages_conversation on messages (conversation_uuid, created_at);
-- The checkpoint of the last complete run (the equivalent of pumped.json).
create table checkpoints (name text primary key, until timestamptz not null);
alter table conversations enable row level security;
alter table messages enable row level security;
alter table checkpoints enable row level security;
grant all on conversations, messages, checkpoints to service_role;
insert into storage.buckets (id, name, public) values ('attachments', 'attachments', false);