MemberDataSheet: Show area com buckets of current year (regardless of season)

This commit is contained in:
2024-02-21 15:10:27 +01:00
parent 99ca12b276
commit 8732141e6b
5 changed files with 26 additions and 14 deletions

View File

@ -0,0 +1,12 @@
-- schema version 16 to 17
CREATE VIEW v_virtual_season AS
SELECT year, max_kg_per_ha
FROM season
UNION
SELECT strftime('%Y', date()) + 0, (SELECT max_kg_per_ha FROM season ORDER BY year DESC LIMIT 1);
PRAGMA writable_schema = ON;
UPDATE sqlite_schema SET sql = REPLACE(sql, 'season s', 'v_virtual_season s')
WHERE type = 'view' AND name = 'v_area_commitment_bucket_strict';
PRAGMA writable_schema = OFF;