Eric Bower
·
2025-12-17
20251217_add_access_logs_table.sql
1CREATE TABLE IF NOT EXISTS access_logs (
2 id uuid NOT NULL DEFAULT uuid_generate_v4(),
3 user_id uuid NOT NULL,
4 service character varying(255) NOT NULL,
5 pubkey text NOT NULL DEFAULT '',
6 identity text NOT NULL DEFAULT '',
7 data jsonb NOT NULL DEFAULT '{}'::jsonb,
8 created_at timestamp without time zone NOT NULL DEFAULT NOW(),
9 CONSTRAINT access_logs_pkey PRIMARY KEY (id),
10 CONSTRAINT fk_access_logs_app_users
11 FOREIGN KEY(user_id)
12 REFERENCES app_users(id)
13 ON DELETE CASCADE
14 ON UPDATE CASCADE
15);