Merge branch 'dev' into feature/bucket-import-export

This commit is contained in:
Evgenii Burmakin 2025-04-02 21:00:20 +02:00 committed by GitHub
commit 07ad244e99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 30 additions and 13 deletions

View file

@ -1 +1 @@
0.25.3
0.25.4

View file

@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
# 0.25.4 - 2025-04-02
In this release we're changing the way import files are being stored. Previously, they were being stored in the `raw_data` column of the `imports` table. Now, they are being attached to the import record. All new imports will be using the new storage, to migrate existing imports, you can use the `rake imports:migrate_to_new_storage` task. Run it in the container shell.
@ -20,6 +21,11 @@ If your hardware doesn't have enough memory to migrate the imports, you can dele
- Export files are now being attached to the export record instead of being stored in the file system.
- Export files can now be stored in S3-compatible storage.
## Fixed
- Moving points on the map now works correctly. #957
- `rake points:migrate_to_lonlat` task now also reindexes the points table.
# 0.25.3 - 2025-03-22

View file

@ -32,7 +32,7 @@ class Api::V1::PointsController < ApiController
def update
point = current_api_user.tracked_points.find(params[:id])
point.update(point_params)
point.update(lonlat: "POINT(#{point_params[:longitude]} #{point_params[:latitude]})")
render json: point_serializer.new(point).call
end

View file

@ -501,10 +501,11 @@ export default class extends BaseController {
}
deletePoint(id, apiKey) {
fetch(`/api/v1/points/${id}?api_key=${apiKey}`, {
fetch(`/api/v1/points/${id}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`
}
})
.then(response => {

View file

@ -1,6 +1,6 @@
<div class="w-full mx-auto my-5">
<div class="flex justify-between items-center mt-5 mb-5">
<div class="hero h-fit bg-base-200 py-20" style="background-image: url(<%= '/images/bg-image.jpg' %>);">
<div class="hero h-fit bg-base-200 py-20">
<div class="hero-content text-center">
<div class="max-w-md">
<h1 class="text-5xl font-bold">

View file

@ -5,15 +5,25 @@ namespace :points do
task migrate_to_lonlat: :environment do
puts 'Updating points to use lonlat...'
# Use PostGIS functions to properly create geography type
result = ActiveRecord::Base.connection.execute(<<~SQL)
UPDATE points
SET lonlat = ST_SetSRID(ST_MakePoint(longitude, latitude), 4326)::geography
WHERE lonlat IS NULL
AND longitude IS NOT NULL
AND latitude IS NOT NULL;
SQL
ActiveRecord::Base.connection.execute('REINDEX TABLE points;')
puts "Successfully updated #{result.cmd_tuples} points with lonlat values"
ActiveRecord::Base.transaction do
ActiveRecord::Base.connection.execute('ALTER TABLE points DISABLE TRIGGER ALL;')
# Update the data
result = ActiveRecord::Base.connection.execute(<<~SQL)
UPDATE points
SET lonlat = ST_SetSRID(ST_MakePoint(longitude, latitude), 4326)::geography
WHERE lonlat IS NULL
AND longitude IS NOT NULL
AND latitude IS NOT NULL;
SQL
ActiveRecord::Base.connection.execute('ALTER TABLE points ENABLE TRIGGER ALL;')
puts "Successfully updated #{result.cmd_tuples} points with lonlat values"
end
ActiveRecord::Base.connection.execute('ANALYZE points;')
end
end