Replace Apple Health ingest with iPhone location geofences
POST /api/v1/location/{arrive,leave} records place intervals (home or a
named place, and away in between) from Shortcuts automations. A stale
"leave" for a place the device has already left is ignored. The Health
Auto Export endpoint and its normalizer are removed.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
-- +goose Up
|
||||
-- A device has at most one open location interval: the place it is in now.
|
||||
-- Open intervals are stored with ended_at = started_at and read as ending now.
|
||||
CREATE UNIQUE INDEX activities_open_location_idx ON activities (device_id)
|
||||
WHERE source = 'location' AND attrs ? 'open';
|
||||
|
||||
-- +goose Down
|
||||
DROP INDEX activities_open_location_idx;
|
||||
Reference in New Issue
Block a user