pr_01m47d24b0e6n91zwymwxg0vpx/services/events/migrations/0001_init.sql

14 lines368 bytesCodeBlame
1-- Append-only log of every event published on the bus. Ids are
2-- time-sortable, so ordering by id is ordering by time.
3CREATE TABLE events (
4 id TEXT PRIMARY KEY,
5 type TEXT NOT NULL,
6 source TEXT NOT NULL,
7 -- RFC 3339 UTC.
8 time TEXT NOT NULL,
9 repo_id TEXT,
10 actor TEXT,
11 -- JSON.
12 data TEXT NOT NULL
13);
14CREATE INDEX events_repo ON events (repo_id, id);