verifications will not be processed until their topic is active
[websub-hub] / src / db / postgres / sql / schema / 1.0.1 / revert.sql
diff --git a/src/db/postgres/sql/schema/1.0.1/revert.sql b/src/db/postgres/sql/schema/1.0.1/revert.sql
new file mode 100644 (file)
index 0000000..37813c6
--- /dev/null
@@ -0,0 +1,15 @@
+BEGIN;
+       CREATE OR REPLACE VIEW verification_needed AS
+               SELECT *
+               FROM verification
+               WHERE
+                       (topic_id, callback, created) IN (SELECT topic_id, callback, max(created) AS created FROM verification GROUP BY topic_id, callback)
+               AND
+                       (topic_id, callback) NOT IN (SELECT topic_id, callback FROM verification_in_progress_active)
+               AND
+                       next_attempt <= now()
+       ;
+
+       DELETE FROM _meta_schema_version WHERE major = 1 AND minor = 0 AND patch = 1;
+COMMIT;
+