mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Merge branch 'dev' into feature/bucket-import-export
This commit is contained in:
commit
07ad244e99
6 changed files with 30 additions and 13 deletions
|
|
@ -1 +1 @@
|
||||||
0.25.3
|
0.25.4
|
||||||
|
|
|
||||||
|
|
@ -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/)
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
|
||||||
# 0.25.4 - 2025-04-02
|
# 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.
|
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 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.
|
- 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
|
# 0.25.3 - 2025-03-22
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class Api::V1::PointsController < ApiController
|
||||||
def update
|
def update
|
||||||
point = current_api_user.tracked_points.find(params[:id])
|
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
|
render json: point_serializer.new(point).call
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -501,10 +501,11 @@ export default class extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
deletePoint(id, apiKey) {
|
deletePoint(id, apiKey) {
|
||||||
fetch(`/api/v1/points/${id}?api_key=${apiKey}`, {
|
fetch(`/api/v1/points/${id}`, {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': `Bearer ${apiKey}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<div class="w-full mx-auto my-5">
|
<div class="w-full mx-auto my-5">
|
||||||
<div class="flex justify-between items-center mt-5 mb-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="hero-content text-center">
|
||||||
<div class="max-w-md">
|
<div class="max-w-md">
|
||||||
<h1 class="text-5xl font-bold">
|
<h1 class="text-5xl font-bold">
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,25 @@ namespace :points do
|
||||||
task migrate_to_lonlat: :environment do
|
task migrate_to_lonlat: :environment do
|
||||||
puts 'Updating points to use lonlat...'
|
puts 'Updating points to use lonlat...'
|
||||||
|
|
||||||
# Use PostGIS functions to properly create geography type
|
ActiveRecord::Base.connection.execute('REINDEX TABLE points;')
|
||||||
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
|
|
||||||
|
|
||||||
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
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue