Add Discord outbound posting (#14)
Stacks on #13. Adds discord_post_links and a subscriber that posts roots into a public thread, replies into that thread, and edits the linked Discord message. Unset Discord env leaves the site unchanged. Reviewed-on: #14 Co-authored-by: codegirl-007 <s.raide@gmail.com>
This commit was merged in pull request #14.
This commit is contained in:
+11
@@ -65,6 +65,17 @@ CREATE TABLE IF NOT EXISTS post_votes (
|
||||
CREATE INDEX IF NOT EXISTS idx_post_votes_post_id
|
||||
ON post_votes(post_id);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS discord_post_links (
|
||||
post_id TEXT PRIMARY KEY REFERENCES posts(id) ON DELETE CASCADE,
|
||||
discord_message_id TEXT NOT NULL UNIQUE,
|
||||
discord_thread_id TEXT NOT NULL DEFAULT '',
|
||||
created_at TEXT NOT NULL
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS discord_post_links_thread_uidx
|
||||
ON discord_post_links (discord_thread_id)
|
||||
WHERE discord_thread_id <> '';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS sessions (
|
||||
token TEXT PRIMARY KEY,
|
||||
data BYTEA NOT NULL,
|
||||
|
||||
Reference in New Issue
Block a user