Eric Bower
·
2025-03-19
20250319_add_tuns_event_logs_table.sql
1CREATE TABLE IF NOT EXISTS tuns_event_logs (
2 id uuid NOT NULL DEFAULT uuid_generate_v4(),
3 user_id uuid NOT NULL,
4 server_id text NOT NULL,
5 remote_addr text NOT NULL,
6 event_type text NOT NULL,
7 tunnel_type text NOT NULL,
8 connection_type text NOT NULL,
9 tunnel_addrs text[] NOT NULL,
10 created_at timestamp without time zone NOT NULL DEFAULT NOW(),
11 CONSTRAINT tuns_event_logs_pkey PRIMARY KEY (id),
12 CONSTRAINT fk_tuns_event_logs_user
13 FOREIGN KEY(user_id)
14 REFERENCES app_users(id)
15 ON DELETE CASCADE
16 ON UPDATE CASCADE
17);