mirror of
https://github.com/logto-io/logto.git
synced 2024-12-23 20:33:16 -05:00
13 lines
410 B
SQL
13 lines
410 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 default (now()),
|
|
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);
|