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

12 lines341 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 time INTEGER NOT NULL,
8 repo_id TEXT,
9 actor TEXT,
10 data TEXT NOT NULL
11);
12CREATE INDEX events_repo ON events (repo_id, id);