move to anther profile

This commit is contained in:
Mateusz Gruszczyński
2026-06-20 17:01:48 +02:00
parent e6733d6a27
commit fc03b7755b
12 changed files with 201 additions and 14 deletions
+19
View File
@@ -113,6 +113,25 @@ CREATE TABLE IF NOT EXISTS rtorrent_profiles (
);
CREATE INDEX IF NOT EXISTS idx_rtorrent_profiles_user_default_name ON rtorrent_profiles(user_id, is_default, name COLLATE NOCASE);
CREATE TABLE IF NOT EXISTS profile_runtime_stats (
profile_id INTEGER PRIMARY KEY,
user_id INTEGER NOT NULL,
torrent_count INTEGER DEFAULT 0,
total_size_bytes INTEGER DEFAULT 0,
completed_bytes INTEGER DEFAULT 0,
downloaded_bytes INTEGER DEFAULT 0,
uploaded_bytes INTEGER DEFAULT 0,
active_count INTEGER DEFAULT 0,
seeding_count INTEGER DEFAULT 0,
downloading_count INTEGER DEFAULT 0,
stopped_count INTEGER DEFAULT 0,
updated_at TEXT NOT NULL,
FOREIGN KEY(user_id) REFERENCES users(id),
FOREIGN KEY(profile_id) REFERENCES rtorrent_profiles(id) ON DELETE CASCADE
);
CREATE INDEX IF NOT EXISTS idx_profile_runtime_stats_user ON profile_runtime_stats(user_id, profile_id);
CREATE TABLE IF NOT EXISTS jobs (
id TEXT PRIMARY KEY,
user_id INTEGER NOT NULL,