mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
add REFRESH_ERROR to the status of subscriptions and add a new column refreshed_at
This commit is contained in:
parent
1550a43b81
commit
9e966bb269
2 changed files with 32 additions and 0 deletions
19
packages/db/migrations/0159.do.alter_subscriptions.sql
Executable file
19
packages/db/migrations/0159.do.alter_subscriptions.sql
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
-- Type: DO
|
||||
-- Name: alter_subscriptions
|
||||
-- Description: Alter omnivore.subscriptions table to add a new state and date column
|
||||
|
||||
BEGIN;
|
||||
|
||||
ALTER TYPE subscription_status_type
|
||||
ADD VALUE IF NOT EXISTS 'REFRESH_ERROR';
|
||||
|
||||
ALTER TABLE omnivore.subscriptions
|
||||
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;
|
||||
13
packages/db/migrations/0159.undo.alter_subscriptions.sql
Executable file
13
packages/db/migrations/0159.undo.alter_subscriptions.sql
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
-- Type: UNDO
|
||||
-- Name: alter_subscriptions
|
||||
-- Description: Alter omnivore.subscriptions table to add a new state and date column
|
||||
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE omnivore.subscriptions
|
||||
RENAME COLUMN most_recent_item_date TO last_fetched_at;
|
||||
|
||||
ALTER TABLE omnivore.subscriptions
|
||||
DROP COLUMN refreshed_at;
|
||||
|
||||
COMMIT;
|
||||
Loading…
Reference in a new issue