|
|
@@ -263,6 +263,10 @@ ALTER TABLE media_items ADD COLUMN IF NOT EXISTS contributors_search TEXT[];
|
|
|
|
ALTER TABLE media_items ADD COLUMN IF NOT EXISTS narrators TEXT[] NOT NULL DEFAULT '{}';
|
|
|
|
ALTER TABLE media_items ADD COLUMN IF NOT EXISTS narrators TEXT[] NOT NULL DEFAULT '{}';
|
|
|
|
ALTER TABLE media_items ADD COLUMN IF NOT EXISTS narrators_search TEXT[] NOT NULL DEFAULT '{}';
|
|
|
|
ALTER TABLE media_items ADD COLUMN IF NOT EXISTS narrators_search TEXT[] NOT NULL DEFAULT '{}';
|
|
|
|
ALTER TABLE media_items ADD COLUMN IF NOT EXISTS abridged BOOLEAN NOT NULL DEFAULT FALSE;
|
|
|
|
ALTER TABLE media_items ADD COLUMN IF NOT EXISTS abridged BOOLEAN NOT NULL DEFAULT FALSE;
|
|
|
|
|
|
|
|
-- audio_metadata is declared in the CREATE TABLE above, which only fresh
|
|
|
|
|
|
|
|
-- installs ever see — this ALTER is the upgrade path for pre-A2 installs
|
|
|
|
|
|
|
|
-- (its absence 42703'd every scan and archive pass on upgraded deployments).
|
|
|
|
|
|
|
|
ALTER TABLE media_items ADD COLUMN IF NOT EXISTS audio_metadata JSONB;
|
|
|
|
|
|
|
|
|
|
|
|
-- Per-field user-override tracking (idempotent backfill for existing
|
|
|
|
-- Per-field user-override tracking (idempotent backfill for existing
|
|
|
|
-- installs; the column is also declared in the media_items table
|
|
|
|
-- installs; the column is also declared in the media_items table
|
|
|
@@ -371,6 +375,11 @@ CREATE TABLE IF NOT EXISTS reading_progress (
|
|
|
|
conflict_resolved BOOLEAN DEFAULT TRUE
|
|
|
|
conflict_resolved BOOLEAN DEFAULT TRUE
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- audio_offset_seconds upgrade path: declared in the CREATE TABLE above
|
|
|
|
|
|
|
|
-- (Batch A) with no ALTER, so pre-A installs lacked the column and every
|
|
|
|
|
|
|
|
-- progress save — the shared upsert names it — failed with SQLSTATE 42703.
|
|
|
|
|
|
|
|
ALTER TABLE reading_progress ADD COLUMN IF NOT EXISTS audio_offset_seconds INTEGER CHECK (audio_offset_seconds >= 0);
|
|
|
|
|
|
|
|
|
|
|
|
-- Create media_ratings table
|
|
|
|
-- Create media_ratings table
|
|
|
|
CREATE TABLE IF NOT EXISTS media_ratings (
|
|
|
|
CREATE TABLE IF NOT EXISTS media_ratings (
|
|
|
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
|
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
|
|