mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-07 17:26:56 +00:00
06625bfe94
Some checks are pending
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Release Notes: - N/A --------- Co-authored-by: Marshall <marshall@zed.dev> Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
19 lines
708 B
SQL
19 lines
708 B
SQL
create table usage_measures (
|
|
id serial primary key,
|
|
name text not null
|
|
);
|
|
|
|
create unique index uix_usage_measures_on_name on usage_measures (name);
|
|
|
|
create table if not exists usages (
|
|
id serial primary key,
|
|
user_id integer not null,
|
|
model_id integer not null references models (id) on delete cascade,
|
|
measure_id integer not null references usage_measures (id) on delete cascade,
|
|
timestamp timestamp without time zone not null,
|
|
buckets bigint[] not null
|
|
);
|
|
|
|
create index ix_usages_on_user_id on usages (user_id);
|
|
create index ix_usages_on_model_id on usages (model_id);
|
|
create unique index uix_usages_on_user_id_model_id_measure_id on usages (user_id, model_id, measure_id);
|