verifications will not be processed until their topic is active
[websub-hub] / src / db / sqlite / sql / schema / 1.0.1 / revert.sql
diff --git a/src/db/sqlite/sql/schema/1.0.1/revert.sql b/src/db/sqlite/sql/schema/1.0.1/revert.sql
new file mode 100644 (file)
index 0000000..bff18bf
--- /dev/null
@@ -0,0 +1,16 @@
+BEGIN;
+       DROP VIEW verification_needed;
+       CREATE 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 <= (strftime('%s', 'now'))
+       ;
+
+       DELETE FROM _meta_schema_version WHERE major = 1 AND minor = 0 AND patch = 1;
+COMMIT;
+