aboutsummaryrefslogtreecommitdiffhomepage
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cleandb6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/cleandb b/bin/cleandb
index 94873bf..b33f994 100755
--- a/bin/cleandb
+++ b/bin/cleandb
@@ -6,8 +6,14 @@ require __DIR__ . '/../vendor/autoload.php';
$db = Digitigrade\Db::getInstance()->getPdo();
$db->beginTransaction();
$db->exec(<<<END
+
+-- permanently delete anything marked for deletion
DELETE FROM actor WHERE deleted = true;
DELETE FROM note WHERE deleted = true;
DELETE FROM interaction WHERE deleted = true;
+
+-- remove old timeline items
+DELETE FROM home_timeline_item WHERE modified < (current_timestamp - interval '6 months');
+
END);
$db->commit(); \ No newline at end of file