2 DROP INDEX subscription_latest_content_delivered_idx
;
3 DROP VIEW subscription_delivery_needed
;
4 ALTER TABLE subscription
5 DROP COLUMN latest_content_delivered
7 CREATE INDEX subscription_content_delivered_idx
ON subscription(content_delivered
);
8 CREATE VIEW subscription_delivery_needed
AS
10 FROM subscription s
JOIN topic t
ON s.topic_id
= t.
id
12 s.expires
> strftime('%s', 'now')
14 s.content_delivered
< t.content_updated
16 s.delivery_next_attempt
< strftime('%s', 'now')
18 s.
id NOT IN (SELECT id FROM subscription_delivery_in_progress_active
)
20 DELETE FROM _meta_schema_version
WHERE major
= 1 AND minor
= 0 AND patch
= 2;