db: add user_actions view.

Add a user_actions view. This view unions together a bunch of tables to
produce an event log of every action taken by a user.

Also add a bunch of indexes to make queries on this table efficient.
Even though the view is an enormous query combining together about 30
different tables, queries are very efficient as long as every table has
`created_at` and `(user_id, created)` indexes.
This commit is contained in:
evazion
2022-09-13 20:33:53 -05:00
parent abf493794f
commit 0830af49a7
3 changed files with 849 additions and 48 deletions

File diff suppressed because it is too large Load Diff