diff --git a/app/Console/Commands/PruneData.php b/app/Console/Commands/PruneData.php index 1d350e1933e1..adc67edc7f18 100644 --- a/app/Console/Commands/PruneData.php +++ b/app/Console/Commands/PruneData.php @@ -39,6 +39,8 @@ class PruneData extends Command left join expenses e on e.account_id = a.id left join users u on u.account_id = a.id and u.registered = 1 where c.created_at < DATE_SUB(now(), INTERVAL 6 MONTH) + and c.trial_started is null + and c.plan is null group by c.id having count(cl.id) = 0 and count(t.id) = 0