internal/store/migrations/0063_push_tokens.up.sql

v1.43.1
gitbay/internal/store/migrations/0063_push_tokens.up.sql history · blame · raw

10 lines · 482 bytes

 1-- One row per receive-pack in flight. The hook names its push by the
 2-- token; hookd answers only a live one. Only the SHA-256 is stored.
 3CREATE TABLE push_tokens (
 4    token_hash TEXT PRIMARY KEY,
 5    repo_id    INTEGER NOT NULL REFERENCES repos(id) ON DELETE CASCADE,
 6    user_id    INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
 7    scope      TEXT NOT NULL,
 8    created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')),
 9    expires_at TEXT NOT NULL
10);