botserver/migrations/20250710000001_add_manifest_json/up.sql
Rodrigo Rodriguez (Pragmatismo) 86ac5ca8f5 Fix panic: check if item_groups is empty before iterating
Prevents 'index out of bounds: the len is 0 but the index is 0' error
in complete_item_group_range when item_groups is empty.
2026-01-02 12:54:54 -03:00

5 lines
338 B
SQL

-- Add manifest_json column to store the full task manifest for historical viewing
ALTER TABLE auto_tasks ADD COLUMN IF NOT EXISTS manifest_json JSONB;
-- Add an index for faster lookups when manifest exists
CREATE INDEX IF NOT EXISTS idx_auto_tasks_manifest_json ON auto_tasks USING gin (manifest_json) WHERE manifest_json IS NOT NULL;