From bd0bdcca6c39c5669800ad60fda6e3e007cdf5a0 Mon Sep 17 00:00:00 2001 From: Sam Chau Date: Wed, 31 Dec 2025 00:15:51 +1030 Subject: [PATCH] feat: add custom format testing table for validating format matching --- CHANGELOG.md | 8 ++++++++ ops/0.schema.sql | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddd344f..c97b56d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,3 +40,11 @@ All schema changes will be documented in this file. - delay_profiles: protocol preference, delays, bypass conditions - delay_profile_tags: junction table for tag associations - CHECK constraints for protocol/delay validation + +## 31-12-25 + +- Add custom format testing table + - custom_format_tests: stores test cases for validating custom format matching + - Each test specifies a release title and whether it should match the format + - Supports movie/series type differentiation for parser context + - Unique constraint on (custom_format_id, title, type) prevents duplicate tests \ No newline at end of file diff --git a/ops/0.schema.sql b/ops/0.schema.sql index 2e30bf7..9c37b2a 100644 --- a/ops/0.schema.sql +++ b/ops/0.schema.sql @@ -262,6 +262,24 @@ CREATE TABLE condition_years ( FOREIGN KEY (custom_format_condition_id) REFERENCES custom_format_conditions(id) ON DELETE CASCADE ); +-- ============================================================================ +-- CUSTOM FORMAT TESTING +-- ============================================================================ + +-- Test cases for validating custom format matching logic +-- Each test belongs to a custom format and specifies whether a title should match +CREATE TABLE custom_format_tests ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + custom_format_id INTEGER NOT NULL, + title TEXT NOT NULL, -- Release title to test against + type VARCHAR(20) NOT NULL, -- 'movie' or 'series' + should_match INTEGER NOT NULL, -- 1 = should match, 0 = should not match + description TEXT, -- Why this test exists / edge case covered + created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, + UNIQUE(custom_format_id, title, type), + FOREIGN KEY (custom_format_id) REFERENCES custom_formats(id) ON DELETE CASCADE +); + -- ============================================================================ -- MEDIA MANAGEMENT TABLES -- ============================================================================