2022-04-18 15:44:36 +08:00
|
|
|
create table logs
|
|
|
|
(
|
2022-04-21 13:31:29 +08:00
|
|
|
id varchar(21) not null,
|
2022-12-20 13:47:12 +08:00
|
|
|
key varchar(128) not null,
|
2022-04-21 13:31:29 +08:00
|
|
|
payload jsonb /* @use ArbitraryObject */ not null default '{}'::jsonb,
|
|
|
|
created_at timestamptz not null default (now()),
|
2022-04-18 15:44:36 +08:00
|
|
|
primary key (id)
|
|
|
|
);
|
|
|
|
|
2022-12-20 13:47:12 +08:00
|
|
|
create index logs__key on logs (key);
|
2022-04-18 15:44:36 +08:00
|
|
|
create index logs__created_at on logs (created_at);
|
2022-05-25 12:59:35 +08:00
|
|
|
create index logs__user_id on logs ((payload->>'user_id') nulls last);
|
|
|
|
create index logs__application_id on logs ((payload->>'application_id') nulls last);
|