Add an API that returns the most active users and the projects where they've been active

This commit is contained in:
Max Brunsfeld 2022-06-20 19:39:48 -07:00
parent bc3287e5d0
commit 44160869eb
7 changed files with 376 additions and 43 deletions

View file

@ -0,0 +1,9 @@
CREATE TABLE IF NOT EXISTS "project_activity_periods" (
"id" SERIAL PRIMARY KEY,
"duration_millis" INTEGER NOT NULL,
"ended_at" TIMESTAMP NOT NULL,
"user_id" INTEGER REFERENCES users (id) NOT NULL,
"project_id" INTEGER
);
CREATE INDEX "index_project_activity_periods_on_ended_at" ON "project_activity_periods" ("ended_at");