feat: SAM integration, deployment scripts, and audio response enhancements

- Add SAM (Sistema de Administración Académica) integration with sync endpoints
- Add deployment automation (deploy.sh, remote-setup.sh, setup-nginx-ssl.sh)
- Add nginx proxy configuration for SSL with Let's Encrypt
- Add audio response support for student lessons (migrations, handlers)
- Add audio evaluations admin page
- Update CORS to support wildcard subdomains for norteamericano.cl
- Add comprehensive deployment documentation (DESPLIEGUE.md, ManualDeConfiguracion.md)
- Update docker-compose.yml with nginx-proxy and acme-companion services
- Remove outdated documentation files

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
2026-03-27 09:20:23 -03:00
parent 995065df4f
commit e4866c6dee
50 changed files with 4866 additions and 5371 deletions
@@ -1,7 +1,29 @@
-- AI Usage Logs: Update log_ai_usage function to include prompt and response
-- Note: prompt and response columns already exist from previous migration
-- AI Usage Logs: Add prompt and response columns
-- First, add columns if they don't exist
-- Update log_ai_usage function to accept prompt and response
-- Add prompt column
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name = 'ai_usage_logs' AND column_name = 'prompt'
) THEN
ALTER TABLE ai_usage_logs ADD COLUMN prompt TEXT;
END IF;
END $$;
-- Add response column
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name = 'ai_usage_logs' AND column_name = 'response'
) THEN
ALTER TABLE ai_usage_logs ADD COLUMN response TEXT;
END IF;
END $$;
-- Update log_ai_usage function to include prompt and response
CREATE OR REPLACE FUNCTION log_ai_usage(
p_user_id UUID,
p_org_id UUID,