internal/store/migrations/0043_bookmarks.up.sql

0666c9f622171df00f8e2c79a13d011522039624
gitbay/internal/store/migrations/0043_bookmarks.up.sql

10 lines · 568 bytes

 1-- Bookmarks are a public "saved for later", separate from pins: a pin is
 2-- private quick access to your own work, a bookmark says a repository is
 3-- worth coming back to and its count is a signal of that.
 4CREATE TABLE repo_bookmarks (
 5    user_id      INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
 6    repo_id      INTEGER NOT NULL REFERENCES repos(id) ON DELETE CASCADE,
 7    bookmarked_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')),
 8    PRIMARY KEY (user_id, repo_id)
 9);
10CREATE INDEX repo_bookmarks_by_repo ON repo_bookmarks (repo_id);
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