verifications will not be processed until their topic is active
[websub-hub] / src / db / postgres / sql / schema / 1.0.1 / apply.sql
1 BEGIN;
2 -- Ignore verifications with topics which are not yet active.
3 CREATE OR REPLACE VIEW verification_needed AS
4 SELECT v.*
5 FROM verification v JOIN topic t ON v.topic_id = t.id
6 WHERE
7 t.is_active
8 AND
9 (v.topic_id, v.callback, v.created) IN (SELECT topic_id, callback, max(created) AS created FROM verification GROUP BY topic_id, callback)
10 AND
11 (v.topic_id, v.callback) NOT IN (SELECT topic_id, callback FROM verification_in_progress_active)
12 AND
13 v.next_attempt <= now()
14 ;
15
16 INSERT INTO _meta_schema_version (major, minor, patch) VALUES (1, 0, 1);
17 COMMIT;
18