-- ============================================================================
-- Migration 003: Enable multiple file attachments per event
-- Date: 2025-01-12
-- Description: Enable JSON array format for percorso_file column
--              to support multiple attachments per event
-- ============================================================================

-- STRATEGY:
-- Keep existing percorso_file TEXT column (already supports JSON storage)
-- No schema changes needed - TEXT column can store JSON arrays
-- New inserts will use array format: ["path1", "path2", "path3"]
-- Empty/NULL remains valid for events without attachments

-- SCHEMA DOCUMENTATION:
-- LogAggiornamenti.percorso_file (TEXT, nullable)
--   - NULL: No attachments
--   - JSON array: ["C:\\path\\file1.pdf", "C:\\path\\file2.docx", ...]
--   - SQLite TEXT type supports JSON storage natively

-- No migration commands needed - database can be zeroed for clean start

-- Verification query (run after implementation):
-- SELECT id_aggiornamento, percorso_file,
--        json_array_length(percorso_file) as num_files
-- FROM LogAggiornamenti
-- WHERE percorso_file IS NOT NULL
-- LIMIT 10;
