0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00
logto/packages/schemas/tables/daily_active_users.sql

13 lines
394 B
SQL

create table daily_active_users (
id varchar(21) not null,
tenant_id varchar(21) not null
references tenants (id) on update cascade on delete cascade,
user_id varchar(21) not null,
date timestamptz not null,
primary key (id),
constraint daily_active_users__user_id_date
unique (user_id, date)
);
create index daily_active_users__id
on daily_active_users (tenant_id, id);