| 1 | -- What a person hears when chat moves, kept with their account so a phone, |
| 2 | -- a laptop and the desktop app all sound the same: whether sounds play, which |
| 3 | -- set, how loud, each cue on or off (`sound_cues` is a JSON object such as |
| 4 | -- {"message":true,"sent":false}), and whether an open tab shows a system |
| 5 | -- notification while its window is not in front. A person with no row has |
| 6 | -- the defaults. Do not disturb is not here: it is the person's presence |
| 7 | -- (services/notify). See src/sounds.rs. |
| 8 | CREATE TABLE sound_settings ( |
| 9 | user_id TEXT PRIMARY KEY REFERENCES users (id) ON DELETE CASCADE, |
| 10 | sounds_enabled INTEGER NOT NULL DEFAULT 1, |
| 11 | sound_set TEXT NOT NULL DEFAULT 'soft', |
| 12 | sound_volume INTEGER NOT NULL DEFAULT 60, |
| 13 | sound_cues TEXT NOT NULL DEFAULT '{}', |
| 14 | desktop_toasts INTEGER NOT NULL DEFAULT 0, |
| 15 | updated_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) |
| 16 | ); |