db update for changing default access group

This commit is contained in:
Mike Macgirvin 2023-08-17 21:43:02 +10:00
parent 1e6eda1c0d
commit ed82a9e0a7
2 changed files with 28 additions and 1 deletions

27
Code/Update/_1269.php Normal file
View file

@ -0,0 +1,27 @@
<?php
namespace Code\Update;
class _1269
{
public function run()
{
$channels = q("select * from channel where true");
if ($channels) {
foreach ($channels as $channel) {
if ($channel['allow_gid']) {
$channel['allow_gid'] = '<' . 'connections:' . $channel['channel_hash'] . '>';
q("update channel set allow_gid = '%s' where channel_id = %d",
dbesc($channel['allow_gid']),
(int)$channel['channel_id']
);
}
}
}
}
public function verify()
{
return true;
}
}

View file

@ -26,7 +26,7 @@ use Code\Lib\Url;
*/
const REPOSITORY_ID = 'streams';
const DB_UPDATE_VERSION = 1268;
const DB_UPDATE_VERSION = 1269;
const PROJECT_BASE = __DIR__;
const ACTIVITYPUB_ENABLED = true;
const NOMAD_PROTOCOL_VERSION = '11.0';