omnivore/packages/db/migrations/0159.do.alter_subscriptions.sql

18 lines
463 B
MySQL
Raw Permalink Normal View History

-- Type: DO
-- Name: alter_subscriptions
-- Description: Alter omnivore.subscriptions table to add a new state and date column
BEGIN;
ALTER TABLE omnivore.subscriptions
2024-01-24 06:54:39 +00:00
ADD COLUMN failed_at timestamptz,
ADD COLUMN refreshed_at timestamptz;
UPDATE omnivore.subscriptions
SET refreshed_at = last_fetched_at
WHERE last_fetched_at IS NOT NULL;
ALTER TABLE omnivore.subscriptions
RENAME COLUMN last_fetched_at TO most_recent_item_date;
COMMIT;