| 1 | -- Phones that take alerts (oxygenhub-android#16): one per device sign-in, |
| 2 | -- gone with it when the token is revoked. The Cloud Messaging registration |
| 3 | -- token addresses the phone; alerts are sealed to its X25519 public key |
| 4 | -- (hex), so the push service sees only ciphertext. |
| 5 | ( |
| 6 | token_id INTEGER PRIMARY KEY REFERENCES tokens(id) ON DELETE CASCADE, |
| 7 | account_id INTEGER NOT NULL REFERENCES accounts(id) ON DELETE CASCADE, |
| 8 | fcm_token TEXT NOT NULL, |
| 9 | public_key TEXT NOT NULL, |
| 10 | created_ms INTEGER NOT NULL, |
| 11 | updated_ms INTEGER NOT NULL |
| 12 | ); |
| 13 | ON push_devices (account_id); |