-
Notifications
You must be signed in to change notification settings - Fork 2
feat: /review code review requests with claim workflow (#49) #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /** | ||
| * Migration 010 — Code Review Requests | ||
| * Creates the reviews table for the /review command. | ||
| * | ||
| * @see https://github.com/VolvoxLLC/volvox-bot/issues/49 | ||
| */ | ||
|
|
||
| 'use strict'; | ||
|
|
||
| /** | ||
| * @param {import('pg').Pool} pool | ||
| */ | ||
| async function up(pool) { | ||
| await pool.query(` | ||
| CREATE TABLE IF NOT EXISTS reviews ( | ||
| id SERIAL PRIMARY KEY, | ||
| guild_id TEXT NOT NULL, | ||
| requester_id TEXT NOT NULL, | ||
| reviewer_id TEXT, | ||
| url TEXT NOT NULL, | ||
| description TEXT NOT NULL, | ||
| language TEXT, | ||
| status TEXT DEFAULT 'open' CHECK (status IN ('open', 'claimed', 'completed', 'stale')), | ||
| message_id TEXT, | ||
| channel_id TEXT, | ||
| thread_id TEXT, | ||
| feedback TEXT, | ||
| created_at TIMESTAMPTZ DEFAULT NOW(), | ||
| claimed_at TIMESTAMPTZ, | ||
| completed_at TIMESTAMPTZ | ||
| ); | ||
|
|
||
| CREATE INDEX IF NOT EXISTS idx_reviews_guild ON reviews(guild_id); | ||
| CREATE INDEX IF NOT EXISTS idx_reviews_status ON reviews(guild_id, status); | ||
| `); | ||
BillChirico marked this conversation as resolved.
Show resolved
Hide resolved
BillChirico marked this conversation as resolved.
Show resolved
Hide resolved
BillChirico marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
+10
to
+35
|
||
| } | ||
|
|
||
| /** | ||
| * @param {import('pg').Pool} pool | ||
| */ | ||
| async function down(pool) { | ||
| await pool.query(` | ||
| DROP INDEX IF EXISTS idx_reviews_status; | ||
| DROP INDEX IF EXISTS idx_reviews_guild; | ||
| DROP TABLE IF EXISTS reviews; | ||
| `); | ||
| } | ||
BillChirico marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| module.exports = { up, down }; | ||
Uh oh!
There was an error while loading. Please reload this page.