diff --git a/CHANGELOG.md b/CHANGELOG.md index 21a189d3..f2b2acf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/). # [0.29.2] - 2025-07-12 +⚠️ If you were using RC, please run the following commands in the console, otherwise read on. ⚠️ + +```ruby +# This will delete all tracks 👇 +Track.delete_all + +# This will remove all tracks relations from points 👇 +Point.update_all(track_id: nil) + +# This will create tracks for all users 👇 +User.find_each do |user| + Tracks::CreateJob.perform_later(user.id, start_at: nil, end_at: nil, mode: :bulk) +end +``` + ## Added - In the User Settings -> Background Jobs, you can now disable visits suggestions, which is enabled by default. It's a background task that runs every day around midnight. Disabling it might be useful if you don't want to receive visits suggestions or if you're using the Dawarich iOS app, which has its own visits suggestions. diff --git a/app/jobs/bulk_stats_calculating_job.rb b/app/jobs/bulk_stats_calculating_job.rb index 8cc2ba46..4311a361 100644 --- a/app/jobs/bulk_stats_calculating_job.rb +++ b/app/jobs/bulk_stats_calculating_job.rb @@ -4,7 +4,7 @@ class BulkStatsCalculatingJob < ApplicationJob queue_as :stats def perform - user_ids = User.pluck(:id) + user_ids = User.active.pluck(:id) user_ids.each do |user_id| Stats::BulkCalculator.new(user_id).call diff --git a/db/data/20250720171241_recalculate_stats_after_changing_distance_units.rb b/db/data/20250720171241_recalculate_stats_after_changing_distance_units.rb new file mode 100644 index 00000000..6b23deaf --- /dev/null +++ b/db/data/20250720171241_recalculate_stats_after_changing_distance_units.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class RecalculateStatsAfterChangingDistanceUnits < ActiveRecord::Migration[8.0] + def up + BulkStatsCalculatingJob.perform_later + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end diff --git a/db/data_schema.rb b/db/data_schema.rb index 0fac2063..bdbae245 100644 --- a/db/data_schema.rb +++ b/db/data_schema.rb @@ -1 +1 @@ -DataMigrate::Data.define(version: 20250709195003) +DataMigrate::Data.define(version: 20250720171241)