Fix: Corregir inserción de tenant y relaciones en PostgreSQL usando formato -c en psql

- Cambiar de heredoc (<<EOF) a formato -c para ejecutar comandos SQL
- Agregar cast explícito 'SHARED'::tenanttype para el campo type del tenant
- Arreglar inserción de company para que se ejecute correctamente
- Arreglar inserción de relación usuario-tenant en table user_tenants
- Mejora en ejecución de comandos PostgreSQL dentro de docker exec

El problema era que los heredocs no interpolaban correctamente las variables
en el contexto de docker exec. Usar -c con sentencias SQL en una línea resuelve
el problema y asegura que los INSERTs se ejecuten correctamente.
This commit is contained in:
KevinMrkz3221
2025-11-13 20:18:10 -06:00
parent 35dd4423c1
commit dd77a80408
5 changed files with 40 additions and 47 deletions

View File

@@ -162,7 +162,7 @@ services:
- KEYCLOAK_REALM=${KEYCLOAK_REALM:-master}
- KEYCLOAK_CLIENT_ID=${KEYCLOAK_CLIENT_ID:-anexo76-backend}
- KEYCLOAK_CLIENT_SECRET=${KEYCLOAK_CLIENT_SECRET:-dev-secret}
- CORS_ORIGINS=${CORS_ORIGINS:-http://localhost:5180,http://localhost:3000}
- CORS_ORIGINS=${CORS_ORIGINS:-http://localhost:5173,http://localhost:3000}
ports:
- "8000:8000"
depends_on:
@@ -219,7 +219,7 @@ services:
- KEYCLOAK_CLIENT_ID=${KEYCLOAK_CLIENT_ID:-anexo76-backend}
- KEYCLOAK_CLIENT_SECRET=${KEYCLOAK_CLIENT_SECRET:-zRU5NuvUFtBSOuh7Kdc372AItoWGLgz9}
ports:
- "5180:5180"
- "5173:5173"
depends_on:
backend:
condition: service_healthy
@@ -234,7 +234,7 @@ services:
restart: unless-stopped
command: ["pnpm", "run", "dev", "--", "--host", "0.0.0.0"]
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:5180/ || exit 1"]
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:5173/ || exit 1"]
interval: 15s
timeout: 5s
retries: 5