Release Memby 0.2.64
This commit is contained in:
@@ -657,3 +657,42 @@ CREATE TABLE IF NOT EXISTS integration_deliveries (
|
||||
|
||||
CREATE INDEX IF NOT EXISTS integration_deliveries_idx
|
||||
ON integration_deliveries (integration_id, attempted_at DESC);
|
||||
|
||||
-- A viewer's report about one concrete Emby movie or episode. A replacement is a
|
||||
-- separate state on the report so an ordinary playback complaint can never start a
|
||||
-- download. The uniqueness constraint is the first duplicate guard: one open workflow
|
||||
-- owns an item until an operator resolves or dismisses it.
|
||||
CREATE TABLE IF NOT EXISTS media_reports (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
emby_item_id TEXT NOT NULL,
|
||||
media_type TEXT NOT NULL, -- movie | episode
|
||||
title TEXT NOT NULL,
|
||||
series_title TEXT NOT NULL DEFAULT '',
|
||||
season_number INT NOT NULL DEFAULT 0,
|
||||
episode_number INT NOT NULL DEFAULT 0,
|
||||
reason TEXT NOT NULL,
|
||||
comment TEXT NOT NULL DEFAULT '',
|
||||
reported_by_user_id TEXT NOT NULL,
|
||||
reported_by_username TEXT NOT NULL,
|
||||
reported_by_device TEXT NOT NULL DEFAULT '',
|
||||
replacement_requested BOOLEAN NOT NULL DEFAULT false,
|
||||
replacement_status TEXT NOT NULL DEFAULT '',
|
||||
status TEXT NOT NULL DEFAULT 'new',
|
||||
arr_item_id INT NOT NULL DEFAULT 0,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
||||
);
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS media_reports_open_item_idx
|
||||
ON media_reports (emby_item_id) WHERE status IN ('new', 'acknowledged', 'replacement_requested', 'downloading');
|
||||
CREATE INDEX IF NOT EXISTS media_reports_created_idx ON media_reports (created_at DESC);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS media_report_actions (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
report_id BIGINT NOT NULL REFERENCES media_reports(id) ON DELETE CASCADE,
|
||||
action TEXT NOT NULL,
|
||||
detail TEXT NOT NULL DEFAULT '',
|
||||
actor TEXT NOT NULL DEFAULT '',
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS media_report_actions_report_idx
|
||||
ON media_report_actions (report_id, created_at ASC);
|
||||
|
||||
Reference in New Issue
Block a user