internal/store/migrations/0008_statuses.up.sql

727e9773591679858f7e89e6a9b2942db20cc2d2
gitbay/internal/store/migrations/0008_statuses.up.sql

14 lines · 715 bytes

 1CREATE TABLE commit_statuses (
 2    id          INTEGER PRIMARY KEY,
 3    repo_id     INTEGER NOT NULL REFERENCES repos(id) ON DELETE CASCADE,
 4    commit_sha  TEXT NOT NULL,
 5    context     TEXT NOT NULL,
 6    state       TEXT NOT NULL CHECK (state IN ('pending','success','failure','error')),
 7    description TEXT NOT NULL DEFAULT '',
 8    target_url  TEXT NOT NULL DEFAULT '',
 9    creator_id  INTEGER REFERENCES users(id) ON DELETE SET NULL,
10    created_at  TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')),
11    updated_at  TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')),
12    UNIQUE (repo_id, commit_sha, context)
13);
14CREATE INDEX commit_statuses_sha ON commit_statuses(repo_id, commit_sha);
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