origin/main added 140_user_permissions at the same version this branch
had used for podcast_feeds. Renumber ours to 157 (next free above the
collections-unify migration at 156) so 140 is free for the upstream
migration. schema_versions on the running database is updated in lockstep
so the migrator sees podcast_feeds as already applied at its new version.
Same pattern as d59c1cb (renumber 139_abs_sessions to 147 for the prior
main merge). Pending migrations after this rename: 132 (downloaded
subtitles admin index, main), 140 (user_permissions, main), and 156
(unify_user_collections, this branch).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
24 lines
1.0 KiB
SQL
24 lines
1.0 KiB
SQL
-- RSS-feed metadata for subscribed podcasts. One row per podcast
|
|
-- media_items row; the feed refresher polls feed_url every
|
|
-- refresh_interval_seconds and upserts new episodes into the existing
|
|
-- episodes table.
|
|
|
|
CREATE TABLE IF NOT EXISTS public.podcast_feeds (
|
|
media_item_id text PRIMARY KEY
|
|
REFERENCES public.media_items(content_id) ON DELETE CASCADE,
|
|
feed_url text NOT NULL,
|
|
etag text,
|
|
last_modified text,
|
|
last_refreshed_at timestamp with time zone,
|
|
last_refresh_error text,
|
|
refresh_interval_seconds integer NOT NULL DEFAULT 600,
|
|
created_at timestamp with time zone NOT NULL DEFAULT now(),
|
|
updated_at timestamp with time zone NOT NULL DEFAULT now()
|
|
);
|
|
|
|
CREATE UNIQUE INDEX IF NOT EXISTS idx_podcast_feeds_feed_url
|
|
ON public.podcast_feeds (feed_url);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_podcast_feeds_due_for_refresh
|
|
ON public.podcast_feeds (last_refreshed_at);
|