1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Update prune data script

This commit is contained in:
Hillel Coren 2017-05-04 14:16:09 +03:00
parent 0e21863f8c
commit 56576e8f59

View File

@ -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