-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from iMattPro/persistpushes
Support receiving push notifications if not logged in
- Loading branch information
Showing
4 changed files
with
138 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* | ||
* phpBB Browser Push Notifications. An extension for the phpBB Forum Software package. | ||
* | ||
* @copyright (c) 2024, phpBB Limited <https://www.phpbb.com> | ||
* @license GNU General Public License, version 2 (GPL-2.0) | ||
* | ||
*/ | ||
|
||
namespace phpbb\webpushnotifications\migrations; | ||
|
||
use phpbb\db\migration\migration; | ||
|
||
class add_webpush_token extends migration | ||
{ | ||
public static function depends_on() | ||
{ | ||
return ['\phpbb\webpushnotifications\migrations\add_webpush']; | ||
} | ||
|
||
public function effectively_installed(): bool | ||
{ | ||
return $this->db_tools->sql_column_exists($this->table_prefix . 'wpn_notification_push', 'push_token'); | ||
} | ||
|
||
public function update_schema(): array | ||
{ | ||
return [ | ||
'add_columns' => [ | ||
$this->table_prefix . 'wpn_notification_push' => [ | ||
'push_token' => ['VCHAR', ''], | ||
], | ||
], | ||
]; | ||
} | ||
|
||
public function revert_schema(): array | ||
{ | ||
return [ | ||
'drop_columns' => [ | ||
$this->table_prefix . 'wpn_notification_push' => [ | ||
'push_token', | ||
], | ||
], | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters