From 0dcf5df6d0197635ee3a6c837c21022e630f657f Mon Sep 17 00:00:00 2001
From: Tor Andersson <tor@ccxvii.net>
Date: Wed, 14 Dec 2022 17:19:10 +0100
Subject: Add Webhook notifications.

---
 schema.sql | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'schema.sql')

diff --git a/schema.sql b/schema.sql
index d4a6864..e2ca8a4 100644
--- a/schema.sql
+++ b/schema.sql
@@ -54,6 +54,13 @@ create table if not exists last_notified (
 	primary key (game_id, user_id)
 ) without rowid;
 
+create table if not exists webhooks (
+	user_id integer primary key,
+	url text,
+	prefix text,
+	error text
+);
+
 drop view if exists user_view;
 create view user_view as
 	select
@@ -427,6 +434,7 @@ create trigger trigger_delete_on_users after delete on users
 begin
 	delete from logins where user_id = old.user_id;
 	delete from tokens where user_id = old.user_id;
+	delete from webhooks where user_id = old.user_id;
 	delete from user_last_seen where user_id = old.user_id;
 	delete from last_notified where user_id = old.user_id;
 	delete from read_threads where user_id = old.user_id;
-- 
cgit v1.2.3

