Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(cdp): add the email attachments table to cyclotron (#127995)

Michael Reichenbach0f6013579a68
diff --git a/rust/cyclotron-node-migrations/20261103000001_add_email_attachments.sql b/rust/cyclotron-node-migrations/20261103000001_add_email_attachments.sql
new file mode 100644
index 000000000000..d80c9387e095
--- /dev/null
+++ b/rust/cyclotron-node-migrations/20261103000001_add_email_attachments.sql
@@ -0,0 +1,19 @@
+CREATE TABLE IF NOT EXISTS cyclotron_email_attachments (
+ id UUID PRIMARY KEY,
+ job_id UUID NOT NULL,
+ team_id BIGINT NOT NULL,
+ position SMALLINT NOT NULL,
+ filename TEXT NOT NULL,
+ content_type TEXT,
+ content_id TEXT,
+ content BYTEA NOT NULL,
+ size_bytes INT NOT NULL,
+ sha256 TEXT NOT NULL,
+ created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+
+CREATE INDEX IF NOT EXISTS idx_cyclotron_email_attachments_job_id
+ ON cyclotron_email_attachments (job_id);
+
+CREATE INDEX IF NOT EXISTS idx_cyclotron_email_attachments_created_at
+ ON cyclotron_email_attachments (created_at);