Dashboard-Automatizase/docs/sql/03-add-credential-name.sql
Luis 1391fe6216 feat: enhance Google Calendar integration and update Dockerfile for environment variables
- Updated Dockerfile to include hardcoded environment variables for Next.js build.
- Enhanced Google Calendar API integration by extracting user email from id_token and adding scopes for OpenID and email access.
- Modified credential management to delete existing credentials before creating new ones in n8n.
- Updated dashboard to display connected Google Calendar email and credential details.

Story: 4.2 - Melhorar integração com Google Calendar e atualizar Dockerfile

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-10-12 21:16:21 -03:00

17 lines
829 B
SQL

-- Migration: Adicionar coluna n8n_credential_name na tabela integrations
-- Story: 3.4 - Gerenciar Credenciais Google OAuth via API do n8n
-- Data: 2025-10-12
-- Objetivo: Armazenar o nome da credencial (sempre "refugio") para controle e validação
-- Adicionar coluna para armazenar nome da credencial no n8n
ALTER TABLE portal.integrations
ADD COLUMN IF NOT EXISTS n8n_credential_name VARCHAR(100) DEFAULT 'refugio';
-- Comentário para documentação
COMMENT ON COLUMN portal.integrations.n8n_credential_name IS 'Nome da credencial Google OAuth2 no n8n (sempre "refugio" para não quebrar workflows)';
-- Atualizar registros existentes (se houver) para garantir que tenham o nome "refugio"
UPDATE portal.integrations
SET n8n_credential_name = 'refugio'
WHERE provider = 'google_calendar' AND n8n_credential_name IS NULL;