From 0617663b249f9ca488e5de652108b17d67fbaf45 Mon Sep 17 00:00:00 2001
From: Vika <vika@fireburn.ru>
Date: Sat, 29 Jul 2023 21:59:56 +0300
Subject: Moved the entire Kittybox tree into the root

---
 migrations/webmention/0001_init.sql | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 migrations/webmention/0001_init.sql

(limited to 'migrations/webmention/0001_init.sql')

diff --git a/migrations/webmention/0001_init.sql b/migrations/webmention/0001_init.sql
new file mode 100644
index 0000000..9e7a192
--- /dev/null
+++ b/migrations/webmention/0001_init.sql
@@ -0,0 +1,15 @@
+CREATE SCHEMA IF NOT EXISTS kittybox_webmention;
+
+CREATE TABLE kittybox_webmention.incoming_webmention_queue (
+       id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
+       source TEXT NOT NULL,
+       target TEXT NOT NULL,
+       recv_timestamp TIMESTAMPTZ NOT NULL DEFAULT now(),
+       attempts INTEGER NOT NULL DEFAULT 0
+);
+
+CREATE INDEX webmention_jobs_by_attempts ON kittybox_webmention.incoming_webmention_queue (attempts);
+
+CREATE RULE notify_incoming_webmention AS
+ON INSERT TO kittybox_webmention.incoming_webmention_queue
+DO ALSO NOTIFY incoming_webmention;
-- 
cgit 1.4.1

