From 56576e8f59e819e9a4c2c5d992f31c5da90f20f9 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 4 May 2017 14:16:09 +0300 Subject: [PATCH] Update prune data script --- app/Console/Commands/PruneData.php | 2 ++ 1 file changed, 2 insertions(+) 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