summaryrefslogtreecommitdiffstats
path: root/lib/sql/migration/014-cleanup-people.sql
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sql/migration/014-cleanup-people.sql')
-rw-r--r--lib/sql/migration/014-cleanup-people.sql7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sql/migration/014-cleanup-people.sql b/lib/sql/migration/014-cleanup-people.sql
new file mode 100644
index 0000000..7c10278
--- /dev/null
+++ b/lib/sql/migration/014-cleanup-people.sql
@@ -0,0 +1,7 @@
+BEGIN;
+DELETE FROM patchwork_person WHERE id NOT IN (
+ SELECT submitter_id FROM patchwork_patch
+ UNION
+ SELECT submitter_id FROM patchwork_comment)
+ AND user_id IS NULL;
+COMMIT;