Add data migration to create tracks from points

This commit is contained in:
Eugene Burmakin 2025-07-06 13:49:53 +02:00
parent 15be46b604
commit 7619feff69
5 changed files with 18 additions and 2 deletions

View file

@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Don't check for new version in production.
- Area popup styles are now more consistent.
- Notification about Photon API load is now disabled.
## Fixed

View file

@ -4,7 +4,7 @@ class OwnTracks::Params
attr_reader :params
def initialize(params)
@params = params.to_h.deep_symbolize_keys
@params = Oj.load(params).to_h.deep_symbolize_keys
end
# rubocop:disable Metrics/MethodLength

View file

@ -2,6 +2,8 @@
class CreatePhotonLoadNotification < ActiveRecord::Migration[8.0]
def up
return
User.find_each do |user|
Notifications::Create.new(
user:, kind: :info, title: '⚠️ Photon API is under heavy load', content: notification_content

View file

@ -0,0 +1,13 @@
# frozen_string_literal: true
class CreateTracksFromPoints < ActiveRecord::Migration[8.0]
def up
User.find_each do |user|
Tracks::CreateJob.perform_later(user.id)
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
end

View file

@ -1 +1 @@
DataMigrate::Data.define(version: 20250518174305)
DataMigrate::Data.define(version: 20250704185707)