0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-23 20:33:16 -05:00
logto/packages/schemas/tables/hooks.sql
Gao Sun fa85b7d0eb
refactor: remove withtyped in core (#3375)
Keeping withtyped will introduce an additional database pool per tenant,
which is not good for performance and it should be more like all-or-nothing choice.
So remove it for core, but keep it in cloud.
2023-03-13 04:01:14 +00:00

13 lines
443 B
SQL

create table hooks (
tenant_id varchar(21) not null
references tenants (id) on update cascade on delete cascade,
id varchar(21) not null,
event varchar(128) /* @use HookEvent */ not null,
config jsonb /* @use HookConfig */ not null,
created_at timestamptz not null default(now()),
primary key (id)
);
create index hooks__id on hooks (tenant_id, id);
create index hooks__event on hooks (tenant_id, event);