db update to get rid of bogus activitypub xchans which got created due to a bug in the pubcrawl addon

This commit is contained in:
Mario Vavti
2018-08-29 13:57:36 +02:00
parent 74d80473df
commit 42093aedcf
2 changed files with 27 additions and 1 deletions

26
Zotlabs/Update/_1219.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
namespace Zotlabs\Update;
class _1219 {
function run() {
q("START TRANSACTION");
$r = q("DELETE FROM xchan WHERE
xchan_hash like '%s' AND
xchan_network = 'activitypub'",
dbesc(z_root()) . '%'
);
if($r) {
q("COMMIT");
return UPDATE_SUCCESS;
}
else {
q("ROLLBACK");
return UPDATE_FAILED;
}
}
}