aboutsummaryrefslogtreecommitdiffhomepage
path: root/bin/cleandb
diff options
context:
space:
mode:
authorwinter2024-12-20 18:22:42 +0000
committerwinter2024-12-20 18:22:42 +0000
commitd9ae605537792e93a535851c32d14393a645fc75 (patch)
treebc25c1726a7f4cf667434a5aa98c4bcb6dc377a4 /bin/cleandb
parente560599a738c0b30a5046798a30e3ac85330dbf1 (diff)
script to permadelete deleted objects
Diffstat (limited to 'bin/cleandb')
-rwxr-xr-xbin/cleandb13
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/cleandb b/bin/cleandb
new file mode 100755
index 0000000..94873bf
--- /dev/null
+++ b/bin/cleandb
@@ -0,0 +1,13 @@
+#!/usr/bin/env php
+<?php
+
+require __DIR__ . '/../vendor/autoload.php';
+
+$db = Digitigrade\Db::getInstance()->getPdo();
+$db->beginTransaction();
+$db->exec(<<<END
+DELETE FROM actor WHERE deleted = true;
+DELETE FROM note WHERE deleted = true;
+DELETE FROM interaction WHERE deleted = true;
+END);
+$db->commit(); \ No newline at end of file