Publier Globinours 1.0.0-rc.3

This commit is contained in:
Alexandre NOEL 2026-09-03 12:39:15 +02:00
commit 9a2b4068da
325 changed files with 38230 additions and 20 deletions

View file

@ -0,0 +1,16 @@
CREATE VIEW IF NOT EXISTS v_animals_weight_trend AS
SELECT
a.id AS animal_id,
(SELECT m.value
FROM measurements m
WHERE m.animal_id = a.id AND m.type = 'weight'
ORDER BY datetime(m.measured_at) DESC
LIMIT 1) AS last_weight,
(SELECT m.value
FROM measurements m
WHERE m.animal_id = a.id AND m.type = 'weight'
ORDER BY datetime(m.measured_at) DESC
LIMIT 1 OFFSET 1) AS prev_weight
FROM animals a;