From 684675bd84597b7cf6f2270cdb600173585b53c9 Mon Sep 17 00:00:00 2001 From: susdiv Date: Fri, 5 Jun 2020 17:57:22 +0000 Subject: [PATCH] [SCRIPTS] Fix postgres incompatible query in clean_profiles.php --- scripts/clean_profiles.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/clean_profiles.php b/scripts/clean_profiles.php index 245b2ef5c7..0dd1895b1f 100755 --- a/scripts/clean_profiles.php +++ b/scripts/clean_profiles.php @@ -47,10 +47,11 @@ if (!have_option('y', 'yes')) { } print "Deleting"; +$user_table = common_database_tablename('user'); $profile = new Profile(); $profile->query('SELECT * FROM profile WHERE ' . 'NOT (SELECT COUNT(*) FROM notice WHERE profile_id=profile.id) ' . - 'AND NOT (SELECT COUNT(*) FROM user WHERE user.id=profile.id) ' . + "AND NOT (SELECT COUNT(*) FROM {$user_table} WHERE user.id=profile.id) " . 'AND NOT (SELECT COUNT(*) FROM user_group WHERE user_group.profile_id=profile.id) ' . 'AND NOT (SELECT COUNT(*) FROM subscription WHERE subscriber=profile.id OR subscribed=profile.id) '); while ($profile->fetch()) {