botserver/migrations/6.0.5.sql
Rodrigo Rodriguez (Pragmatismo) 0f842adf69 feat(automation): update logging and script handling
- Update RUST_LOG environment variable in launch.json to exclude more verbose crates
- Change automation kind from 3 to 0 in migrations/6.0.5.sql
- Replace debug with trace logging for schedule evaluation in automation service
- Modify script path resolution to use .ast extension instead of .bas
- Improve error message when script reading fails
- Remove MinIO download fallback for scripts (simplifying script handling)

These changes improve logging verbosity control and simplify script handling by removing the MinIO fallback mechanism. The trace-level
2025-11-02 19:03:52 -03:00

25 lines
964 B
SQL

-- Migration 6.0.5: Add update-summary.bas scheduled automation
-- Description: Creates a scheduled automation that runs every minute to update summaries
-- This replaces the announcements system in legacy mode
-- Note: Bots are now created dynamically during bootstrap based on template folders
-- Add name column to system_automations if it doesn't exist
ALTER TABLE public.system_automations ADD COLUMN IF NOT EXISTS name VARCHAR(255);
-- Insert update-summary automation (runs every minute)
-- kind = 3 (Scheduled trigger)
-- schedule format: minute hour day month weekday
-- "* * * * *" = every minute
INSERT INTO public.system_automations (name, kind, target, param, schedule, is_active)
VALUES (
'Update Summary',
0,
NULL,
'update-summary.bas',
'* * * * *',
true
)
ON CONFLICT DO NOTHING;
-- Create index on name column for faster lookups
CREATE INDEX IF NOT EXISTS idx_system_automations_name ON public.system_automations(name);