App-Erinnerungen per Web-Push (VAPID) ergaenzen
This commit is contained in:
parent
af9bb67331
commit
6e30fea4e6
12 changed files with 1160 additions and 19 deletions
23
tools/migration_push_subscriptions.sql
Normal file
23
tools/migration_push_subscriptions.sql
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
-- Push-Abos für Smartphone-Erinnerungen (Feature "App-Erinnerung").
|
||||
-- Einmalig auf der Live-DB ausführen. Idempotent: ein zweiter Lauf ändert nichts.
|
||||
--
|
||||
-- mysql -h <host> -u <user> -p <db> < tools/migration_push_subscriptions.sql
|
||||
--
|
||||
-- Pro Gerät eine Zeile; ein Spieler kann mehrere Geräte haben. Der
|
||||
-- Endpunkt-Hash verhindert doppelte Zeilen, wenn dasselbe Gerät später mit
|
||||
-- einem anderen Konto angemeldet wird (der Push-Dienst liefert denselben
|
||||
-- Endpunkt erneut).
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `push_subscriptions` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int(10) unsigned NOT NULL,
|
||||
`endpoint` varchar(1000) NOT NULL,
|
||||
`endpoint_hash` char(64) NOT NULL,
|
||||
`p256dh` varchar(120) NOT NULL,
|
||||
`auth` varchar(40) NOT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `push_subscriptions_endpoint_hash_unique` (`endpoint_hash`),
|
||||
KEY `push_subscriptions_user_id_index` (`user_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
Loading…
Add table
Add a link
Reference in a new issue