fix: make quality groups unique and not reusable across profiles

This commit is contained in:
Sam Chau
2025-11-03 03:54:15 +10:30
parent 63a75fcda2
commit 2c93386cb0
2 changed files with 13 additions and 8 deletions
+1
View File
@@ -23,3 +23,4 @@ All schema changes will be documented in this file.
## 3-11-25 ## 3-11-25
- Better profile langauge procesing - Better profile langauge procesing
- Make quality groups unique and not reusable across profiles
+12 -8
View File
@@ -41,14 +41,6 @@ CREATE TABLE qualities (
updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP
); );
-- Quality groups combine multiple qualities treated as equivalent
CREATE TABLE quality_groups (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name VARCHAR(100) UNIQUE NOT NULL,
created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- Custom formats define patterns and conditions for media matching -- Custom formats define patterns and conditions for media matching
CREATE TABLE custom_formats ( CREATE TABLE custom_formats (
id INTEGER PRIMARY KEY AUTOINCREMENT, id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -75,6 +67,18 @@ CREATE TABLE quality_profiles (
updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP
); );
-- Quality groups combine multiple qualities treated as equivalent
-- Each group is specific to a quality profile (profiles do not share groups)
CREATE TABLE quality_groups (
id INTEGER PRIMARY KEY AUTOINCREMENT,
quality_profile_id INTEGER NOT NULL,
name VARCHAR(100) NOT NULL,
created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE(quality_profile_id, name),
FOREIGN KEY (quality_profile_id) REFERENCES quality_profiles(id) ON DELETE CASCADE
);
-- Conditions define the matching logic for custom formats -- Conditions define the matching logic for custom formats
-- Each condition has a type and corresponding data in a type-specific table -- Each condition has a type and corresponding data in a type-specific table
CREATE TABLE custom_format_conditions ( CREATE TABLE custom_format_conditions (