fix profile-scoped backups and shared profile rules

This commit is contained in:
Mateusz Gruszczyński
2026-06-07 23:12:00 +02:00
parent 51e00a4e37
commit 8990f2b404
10 changed files with 264 additions and 86 deletions
+6
View File
@@ -263,6 +263,8 @@ CREATE INDEX IF NOT EXISTS idx_ratio_history_profile_created ON ratio_history(pr
CREATE INDEX IF NOT EXISTS idx_ratio_history_user_profile_id ON ratio_history(user_id, profile_id, id);
CREATE INDEX IF NOT EXISTS idx_ratio_assignments_profile_status ON ratio_assignments(profile_id, last_status);
CREATE INDEX IF NOT EXISTS idx_ratio_groups_user_profile_enabled ON ratio_groups(user_id, profile_id, enabled);
CREATE INDEX IF NOT EXISTS idx_ratio_groups_profile_enabled ON ratio_groups(profile_id, enabled, name);
CREATE INDEX IF NOT EXISTS idx_labels_profile_name ON labels(profile_id, name);
CREATE TABLE IF NOT EXISTS app_backups (
id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -273,6 +275,8 @@ CREATE TABLE IF NOT EXISTS app_backups (
payload_json TEXT NOT NULL,
created_at TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_app_backups_profile_type_created ON app_backups(profile_id, backup_type, created_at);
CREATE INDEX IF NOT EXISTS idx_app_backups_user_type_created ON app_backups(user_id, backup_type, created_at);
CREATE TABLE IF NOT EXISTS smart_queue_settings (
profile_id INTEGER NOT NULL,
@@ -450,6 +454,7 @@ CREATE TABLE IF NOT EXISTS download_plan_settings (
updated_at TEXT NOT NULL,
PRIMARY KEY(user_id, profile_id)
);
CREATE INDEX IF NOT EXISTS idx_download_plan_settings_profile ON download_plan_settings(profile_id, updated_at);
CREATE TABLE IF NOT EXISTS download_plan_paused (
profile_id INTEGER NOT NULL,
@@ -508,6 +513,7 @@ CREATE TABLE IF NOT EXISTS operation_log_settings (
updated_at TEXT NOT NULL,
PRIMARY KEY(user_id, profile_id)
);
CREATE INDEX IF NOT EXISTS idx_operation_log_settings_profile ON operation_log_settings(profile_id, updated_at);
CREATE TABLE IF NOT EXISTS tracker_favicon_cache (
domain TEXT PRIMARY KEY,
source_url TEXT,