1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

[ticket/17010] Switch to using table for tracking push subscriptions

PHPBB3-17010
This commit is contained in:
Marc Alexander
2022-09-18 21:29:25 +02:00
parent af31080445
commit ec3dc28b51
4 changed files with 64 additions and 20 deletions

View File

@@ -43,13 +43,18 @@ class add_webpush extends migration
],
'PRIMARY_KEY' => ['notification_type_id', 'item_id', 'item_parent_id', 'user_id'],
],
],
'add_columns' => [
$this->table_prefix . 'users' => [
$this->table_prefix . 'push_subscriptions' => [
'COLUMNS' => [
'user_push_subscriptions' => ['MTEXT_UNI', '']
'subscription_id' => ['ULINT', null, 'auto_increment'],
'user_id' => ['ULINT', 0],
'device_name' => ['VCHAR:64', ''],
'endpoint' => ['TEXT', ''],
'p256dh' => ['VCHAR', ''],
'auth' => ['VCHAR', ''],
'encoding' => ['VCHAR:32', ''],
],
],
'PRIMARY_KEY' => ['subscription_id', 'user_id'],
]
],
];
}
@@ -57,7 +62,10 @@ class add_webpush extends migration
public function revert_schema(): array
{
return [
'drop_tables' => [$this->table_prefix . 'notification_push'],
'drop_tables' => [
$this->table_prefix . 'notification_push',
$this->table_prefix . 'push_subscriptions',
],
];
}