groceries stats: quote day alias in shrinkflation query
All checks were successful
Deploy production / deploy (push) Successful in 1m10s

This commit is contained in:
2026-10-25 20:42:32 +00:00
parent a6ef263c7e
commit 8e35a58095

View File

@@ -969,7 +969,7 @@ async function sizes(tx: Tx, scope: StatsScope, record: boolean) {
from groceries.item_sizes s window w as (partition by s.item_id order by s.observed_on) from groceries.item_sizes s window w as (partition by s.item_id order by s.observed_on)
) )
select i.id, i.store_id s, i.name, s.size_text size, i.price_cents p, i.unit_price_cents up, select i.id, i.store_id s, i.name, s.size_text size, i.price_cents p, i.unit_price_cents up,
i.unit, i.url, s.observed_on::text day, s.pa::float8 from_amount, s.unit_amount::float8 to_amount, i.unit, i.url, s.observed_on::text as day, s.pa::float8 from_amount, s.unit_amount::float8 to_amount,
s.pp from_price, s.price_cents to_price s.pp from_price, s.price_cents to_price
from s join groceries.items i on i.id = s.item_id from s join groceries.items i on i.id = s.item_id
where s.pu = s.unit and s.unit_amount < s.pa * 0.99 and s.price_cents >= s.pp * 0.99 where s.pu = s.unit and s.unit_amount < s.pa * 0.99 and s.price_cents >= s.pp * 0.99