19 lines
804 B
SQL
19 lines
804 B
SQL
-- Device details of panel sessions (Profile → Signed-in devices).
|
|
ALTER TABLE sessions ADD COLUMN user_agent TEXT NOT NULL DEFAULT '';
|
|
ALTER TABLE sessions ADD COLUMN last_seen INTEGER NOT NULL DEFAULT 0;
|
|
|
|
-- Finished viewing sessions (statistics: most watched channels, who watched how long).
|
|
CREATE TABLE IF NOT EXISTS watch_history (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
channel_id INTEGER,
|
|
channel_name TEXT NOT NULL,
|
|
kind TEXT NOT NULL,
|
|
who TEXT NOT NULL DEFAULT '',
|
|
ip TEXT NOT NULL DEFAULT '',
|
|
device TEXT NOT NULL DEFAULT '',
|
|
started INTEGER NOT NULL,
|
|
ended INTEGER NOT NULL,
|
|
bytes INTEGER NOT NULL DEFAULT 0
|
|
);
|
|
CREATE INDEX IF NOT EXISTS watch_history_started ON watch_history(started);
|