mirror of
https://github.com/neocities/neocities.git
synced 2025-08-05 17:18:02 +02:00
ensure stats for supporter children are retained
This commit is contained in:
parent
10018c5124
commit
3057eda4b0
2 changed files with 9 additions and 2 deletions
|
@ -12,8 +12,9 @@ class Stat < Sequel::Model
|
|||
class << self
|
||||
def prune!
|
||||
DB[
|
||||
"DELETE FROM stats WHERE created_at < ? AND site_id NOT IN (SELECT id FROM sites WHERE plan_type IS NOT NULL OR plan_type != 'free')",
|
||||
(FREE_RETAINMENT_DAYS-1).days.ago.to_date.to_s
|
||||
"DELETE FROM stats WHERE created_at < ? AND site_id NOT IN ?",
|
||||
(FREE_RETAINMENT_DAYS-1).days.ago.to_date.to_s,
|
||||
Site.supporter_ids
|
||||
].first
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue