From 0883470f17e3353346595e3c2f676af382c7e00d Mon Sep 17 00:00:00 2001 From: Sam Chau Date: Sat, 3 Jan 2026 05:50:34 +1030 Subject: [PATCH] feat: add quality profile testing tables for enhanced testing capabilities --- CHANGELOG.md | 8 +++++++- ops/0.schema.sql | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57324e2..5143365 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,4 +48,10 @@ All schema changes will be documented in this file. - Supports movie/series type differentiation for parser context - Unique constraint on (custom_format_id, title, type) prevents duplicate tests - Add include_in_rename column to custom_formats table - - Controls whether custom format name appears in renamed filenames \ No newline at end of file + - Controls whether custom format name appears in renamed filenames + +## 3-1-26 +- Add quality profile testing tables + - test_entities: stores movies/series from TMDB for testing quality profiles + - test_releases: stores sample releases attached to test entities + - Supports languages, indexers, and flags as JSON arrays for release metadata \ No newline at end of file diff --git a/ops/0.schema.sql b/ops/0.schema.sql index a64ca69..63bbe63 100644 --- a/ops/0.schema.sql +++ b/ops/0.schema.sql @@ -398,6 +398,39 @@ CREATE TABLE delay_profile_tags ( FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE ); +-- ============================================================================ +-- QUALITY PROFILE TESTING +-- ============================================================================ + +-- Test entities (movies/series for quality profile testing) +CREATE TABLE test_entities ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + type TEXT NOT NULL CHECK (type IN ('movie', 'series')), + tmdb_id INTEGER NOT NULL, + title TEXT NOT NULL, + year INTEGER, + poster_path TEXT, + created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, + UNIQUE(type, tmdb_id) +); + +-- Test releases attached to entities +CREATE TABLE test_releases ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + test_entity_id INTEGER NOT NULL, + title TEXT NOT NULL, + size_bytes INTEGER, + languages TEXT NOT NULL DEFAULT '[]', + indexers TEXT NOT NULL DEFAULT '[]', + flags TEXT NOT NULL DEFAULT '[]', + created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (test_entity_id) REFERENCES test_entities(id) ON DELETE CASCADE +); + +CREATE INDEX idx_test_releases_entity ON test_releases(test_entity_id); + -- ============================================================================ -- INDEXES AND CONSTRAINTS -- ============================================================================