Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f913da0b1 | ||
|
|
0799cca3e6 |
No files matched your search
@@ -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_search TEXT[] NOT NULL DEFAULT '{}';
|
||||
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
|
||||
-- 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
|
||||
);
|
||||
|
||||
-- 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 TABLE IF NOT EXISTS media_ratings (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
|
||||
@@ -25,6 +25,9 @@ func init() {
|
||||
"/app/database/schema/schema.sql",
|
||||
"../database/schema/schema.sql",
|
||||
"../../database/schema/schema.sql",
|
||||
// Integration tests run with CWD=cmd/server/tests, three levels
|
||||
// below the repo root — two up only reaches cmd/.
|
||||
"../../../database/schema/schema.sql",
|
||||
}
|
||||
|
||||
var content []byte
|
||||
|
||||
Reference in new issue
Block a user