internal/store/migrations/0021_activity.up.sql

4a511e42574ead9c92dc73fd320f296cc4dbea07
gitbay/internal/store/migrations/0021_activity.up.sql

12 lines · 594 bytes

 1-- Commits as an activity signal: recorded when they land on the default
 2-- branch, attributed by verified author email, deduped by sha so rebases
 3-- and re-pushes never double-count. day is the author date (YYYY-MM-DD),
 4-- so imported history keeps its real timeline.
 5CREATE TABLE commit_activity (
 6    repo_id INTEGER NOT NULL REFERENCES repos(id) ON DELETE CASCADE,
 7    sha     TEXT NOT NULL,
 8    user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
 9    day     TEXT NOT NULL,
10    PRIMARY KEY (repo_id, sha)
11);
12CREATE INDEX commit_activity_user ON commit_activity(user_id, day);
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form