-- Migration 047: CSV-Vorlagen — optionale Zeilenaggregation (group_by + aggregates) vor DB-Schreiben

ALTER TABLE csv_field_mappings
ADD COLUMN IF NOT EXISTS import_row_processing JSONB;

COMMENT ON COLUMN csv_field_mappings.import_row_processing IS
'Optional: { "group_by": ["date"], "aggregates": { "kcal": "sum" } } — siehe csv_parser/import_row_processing.py';
