fix: Fix processing for vector attributres table
This commit is contained in:
@@ -211,6 +211,24 @@ func (r *DatasetRepository) SetGeoJSON(ctx context.Context, id uuid.UUID, geojso
|
||||
return nil
|
||||
}
|
||||
|
||||
// ClearGeometryAndGeoJSON nulls out a dataset's stored geometry and persisted
|
||||
// GeoJSON. Used before re-enqueuing a dataset's processing job so a stale
|
||||
// (possibly incorrect) geometry/GeoJSON is never served while the job is
|
||||
// pending; the async worker repopulates both once it completes.
|
||||
func (r *DatasetRepository) ClearGeometryAndGeoJSON(ctx context.Context, id uuid.UUID) error {
|
||||
tag, err := r.pool.Exec(ctx,
|
||||
`UPDATE datasets SET geometry = NULL, geojson = NULL, updated_at = now() WHERE id = $1`,
|
||||
id,
|
||||
)
|
||||
if err != nil {
|
||||
return mapError(err)
|
||||
}
|
||||
if tag.RowsAffected() == 0 {
|
||||
return domain.ErrNotFound
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ReplaceObservations atomically replaces all observations for a dataset.
|
||||
func (r *DatasetRepository) ReplaceObservations(ctx context.Context, datasetID uuid.UUID, obs []domain.Observation) error {
|
||||
tx, err := r.pool.Begin(ctx)
|
||||
|
||||
Reference in New Issue
Block a user