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/daily_active_users.sql

14 lines
394 B
MySQL
Raw Normal View History

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);