internal/store/migrations/0066_push_token_hash.up.sql

bd49b87fce895e9f0a7588152548fb6e1821ac7d
gitbay/internal/store/migrations/0066_push_token_hash.up.sql history · blame · raw

6 lines · 368 bytes

1-- APNs tokens are sealed with a random nonce (internal/seal), so two
2-- stores of one token differ; lookups and the re-registration upsert go
3-- by this SHA-256 of the token instead. Rows from before it are filled
4-- by Store.ResealSecrets.
5ALTER TABLE push_devices ADD COLUMN token_hash TEXT;
6CREATE UNIQUE INDEX push_devices_token_hash ON push_devices(token_hash);