fix: resolve language-specific column issues in core migrations
Mirror to GitHub / mirror (push) Successful in 26s
Test and Lint / backend-test (push) Successful in 1m20s
continuous-integration/drone/push Build is passing
Test and Lint / frontend-test (push) Successful in 2m0s
Version and Release / version-bump (push) Failing after 34s
Version and Release / trigger-drone (push) Has been skipped

- Fixed migration 030 to use standard email_templates columns (subject, body_html, body_text)
- Removed language-specific columns that don't exist in base schema
- Updated docker-compose.dev.yml for development environment

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-07-25 14:09:26 +02:00
parent 1cbeb75094
commit 62617f627f
2 changed files with 107 additions and 102 deletions
@@ -96,9 +96,8 @@ async function up() {
const databaseBackupEmailTemplates = [ const databaseBackupEmailTemplates = [
{ {
template_key: 'database_backup_failed', template_key: 'database_backup_failed',
subject_en: 'Database Backup Failed - Critical Alert', subject: 'Database Backup Failed - Critical Alert',
subject_de: 'Datenbank-Backup fehlgeschlagen - Kritische Warnung', body_html: `<h2>Database Backup Failed</h2>
body_html_en: `<h2>Database Backup Failed</h2>
<p>The scheduled database backup has failed and requires immediate attention.</p> <p>The scheduled database backup has failed and requires immediate attention.</p>
<p><strong>Error Details:</strong></p> <p><strong>Error Details:</strong></p>
<ul> <ul>
@@ -107,24 +106,13 @@ async function up() {
<li>Error: {{error_message}}</li> <li>Error: {{error_message}}</li>
</ul> </ul>
<p>This is a critical issue that could affect disaster recovery. Please investigate immediately.</p>`, <p>This is a critical issue that could affect disaster recovery. Please investigate immediately.</p>`,
body_html_de: `<h2>Datenbank-Backup fehlgeschlagen</h2> body_text: 'Database Backup Failed\n\nThe scheduled database backup has failed.\n\nBackup Type: {{backup_type}}\nTimestamp: {{timestamp}}\nError: {{error_message}}\n\nThis is critical - please investigate immediately.',
<p>Das geplante Datenbank-Backup ist fehlgeschlagen und erfordert sofortige Aufmerksamkeit.</p>
<p><strong>Fehlerdetails:</strong></p>
<ul>
<li>Backup-Typ: {{backup_type}}</li>
<li>Zeitstempel: {{timestamp}}</li>
<li>Fehler: {{error_message}}</li>
</ul>
<p>Dies ist ein kritisches Problem, das die Disaster-Recovery beeinträchtigen könnte. Bitte untersuchen Sie es sofort.</p>`,
body_text_en: 'Database Backup Failed\n\nThe scheduled database backup has failed.\n\nBackup Type: {{backup_type}}\nTimestamp: {{timestamp}}\nError: {{error_message}}\n\nThis is critical - please investigate immediately.',
body_text_de: 'Datenbank-Backup fehlgeschlagen\n\nDas geplante Datenbank-Backup ist fehlgeschlagen.\n\nBackup-Typ: {{backup_type}}\nZeitstempel: {{timestamp}}\nFehler: {{error_message}}\n\nDies ist kritisch - bitte sofort untersuchen.',
variables: JSON.stringify(['backup_type', 'timestamp', 'error_message']) variables: JSON.stringify(['backup_type', 'timestamp', 'error_message'])
}, },
{ {
template_key: 'database_backup_completed', template_key: 'database_backup_completed',
subject_en: 'Database Backup Completed Successfully', subject: 'Database Backup Completed Successfully',
subject_de: 'Datenbank-Backup erfolgreich abgeschlossen', body_html: `<h2>Database Backup Completed</h2>
body_html_en: `<h2>Database Backup Completed</h2>
<p>The scheduled database backup has been completed successfully.</p> <p>The scheduled database backup has been completed successfully.</p>
<p><strong>Backup Summary:</strong></p> <p><strong>Backup Summary:</strong></p>
<ul> <ul>
@@ -134,18 +122,7 @@ async function up() {
<li>Compression Ratio: {{compression_ratio}}</li> <li>Compression Ratio: {{compression_ratio}}</li>
<li>File Path: {{file_path}}</li> <li>File Path: {{file_path}}</li>
</ul>`, </ul>`,
body_html_de: `<h2>Datenbank-Backup abgeschlossen</h2> body_text: 'Database Backup Completed\n\nThe scheduled database backup has been completed successfully.\n\nBackup Type: {{backup_type}}\nDuration: {{duration}}\nFile Size: {{file_size}}\nCompression Ratio: {{compression_ratio}}\nFile Path: {{file_path}}',
<p>Das geplante Datenbank-Backup wurde erfolgreich abgeschlossen.</p>
<p><strong>Backup-Zusammenfassung:</strong></p>
<ul>
<li>Backup-Typ: {{backup_type}}</li>
<li>Dauer: {{duration}}</li>
<li>Dateigröße: {{file_size}}</li>
<li>Komprimierungsverhältnis: {{compression_ratio}}</li>
<li>Dateipfad: {{file_path}}</li>
</ul>`,
body_text_en: 'Database Backup Completed\n\nThe scheduled database backup has been completed successfully.\n\nBackup Type: {{backup_type}}\nDuration: {{duration}}\nFile Size: {{file_size}}\nCompression Ratio: {{compression_ratio}}\nFile Path: {{file_path}}',
body_text_de: 'Datenbank-Backup abgeschlossen\n\nDas geplante Datenbank-Backup wurde erfolgreich abgeschlossen.\n\nBackup-Typ: {{backup_type}}\nDauer: {{duration}}\nDateigröße: {{file_size}}\nKomprimierungsverhältnis: {{compression_ratio}}\nDateipfad: {{file_path}}',
variables: JSON.stringify(['backup_type', 'duration', 'file_size', 'compression_ratio', 'file_path']) variables: JSON.stringify(['backup_type', 'duration', 'file_size', 'compression_ratio', 'file_path'])
} }
]; ];
+101 -73
View File
@@ -1,100 +1,128 @@
# docker-compose.dev.yml - Development configuration with Mailhog
version: '3.8' version: '3.8'
services: services:
# PostgreSQL Database
db:
image: postgres:15-alpine
container_name: picpeak-postgres-dev
environment:
POSTGRES_DB: ${DB_NAME:-picpeak}
POSTGRES_USER: ${DB_USER:-picpeak}
POSTGRES_PASSWORD: ${DB_PASSWORD:-picpeak}
volumes:
- postgres_data_dev:/var/lib/postgresql/data
ports:
- "5432:5432" # Expose for local development tools
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-picpeak}"]
interval: 10s
timeout: 5s
retries: 5
# Backend API
backend: backend:
build: ./backend build:
context: ./backend
dockerfile: Dockerfile
container_name: picpeak-backend-dev container_name: picpeak-backend-dev
depends_on: restart: unless-stopped
db:
condition: service_healthy
environment: environment:
NODE_ENV: development - NODE_ENV=development
PORT: 3001 - PORT=3001
DATABASE_CLIENT: pg - JWT_SECRET=${JWT_SECRET}
DB_HOST: db - ADMIN_USERNAME=${ADMIN_USERNAME:-admin}
DB_PORT: 5432 - ADMIN_EMAIL=${ADMIN_EMAIL:-admin@example.com}
DB_NAME: ${DB_NAME:-picpeak} - DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWORD}@postgres:5432/${DB_NAME}
DB_USER: ${DB_USER:-picpeak} - DB_TYPE=postgresql
DB_PASSWORD: ${DB_PASSWORD:-picpeak} - DB_HOST=postgres
JWT_SECRET: ${JWT_SECRET:-dev-secret-DO-NOT-USE-IN-PRODUCTION} - DB_PORT=5432
ADMIN_URL: ${ADMIN_URL:-http://localhost:3005} - DB_USER=${DB_USER}
FRONTEND_URL: ${FRONTEND_URL:-http://localhost:3005} - DB_PASSWORD=${DB_PASSWORD}
BACKEND_URL: ${BACKEND_URL:-http://localhost:3001} - DB_NAME=${DB_NAME}
# Email via Mailhog - SMTP_HOST=${SMTP_HOST}
SMTP_HOST: mailhog - SMTP_PORT=${SMTP_PORT}
SMTP_PORT: 1025 - SMTP_SECURE=${SMTP_SECURE:-false}
SMTP_SECURE: "false" - SMTP_USER=${SMTP_USER}
SMTP_USER: "" - SMTP_PASS=${SMTP_PASS}
SMTP_PASS: "" - EMAIL_FROM=${EMAIL_FROM:-noreply@picpeak.local}
EMAIL_FROM: ${EMAIL_FROM:-noreply@localhost} - FRONTEND_URL=${FRONTEND_URL:-http://localhost:3000}
- ADMIN_URL=${ADMIN_URL:-http://localhost:3001}
- TZ=${TZ:-UTC}
volumes: volumes:
- ./backend:/app - ./events:/app/events
- /app/node_modules # Prevent node_modules from being overwritten
- ./storage:/app/storage
- ./data:/app/data - ./data:/app/data
- ./logs:/app/logs
- ./backup:/backup
ports: ports:
- "3001:3001" - "3001:3001"
restart: unless-stopped depends_on:
command: npm run dev postgres:
condition: service_healthy
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001/api/health"] test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3001/api/health"]
interval: 30s interval: 30s
timeout: 10s timeout: 10s
retries: 3 retries: 3
start_period: 40s
networks:
- picpeak-network
postgres:
image: postgres:15-alpine
container_name: picpeak-postgres-dev
restart: unless-stopped
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
- PGDATA=/var/lib/postgresql/data/pgdata
- TZ=${TZ:-UTC}
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
networks:
- picpeak-network
redis:
image: redis:7-alpine
container_name: picpeak-redis-dev
restart: unless-stopped
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:-picpeak_redis_pass}
volumes:
- redis-data:/data
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 10s
timeout: 5s
retries: 3
networks:
- picpeak-network
# Frontend
frontend: frontend:
build: build:
context: ./frontend context: ./frontend
dockerfile: Dockerfile.dev dockerfile: Dockerfile.dev
container_name: picpeak-frontend-dev args:
depends_on:
- backend
environment:
- VITE_API_URL=${VITE_API_URL:-http://localhost:3001/api} - VITE_API_URL=${VITE_API_URL:-http://localhost:3001/api}
- VITE_UMAMI_URL=${VITE_UMAMI_URL} - VITE_UMAMI_URL=${VITE_UMAMI_URL:-}
- VITE_UMAMI_WEBSITE_ID=${VITE_UMAMI_WEBSITE_ID} - VITE_UMAMI_WEBSITE_ID=${VITE_UMAMI_WEBSITE_ID:-}
- VITE_UMAMI_SHARE_URL=${VITE_UMAMI_SHARE_URL:-}
container_name: picpeak-frontend-dev
restart: unless-stopped
environment:
- NODE_ENV=development
volumes: volumes:
- ./frontend:/app - ./frontend:/app
- /app/node_modules # Prevent node_modules from being overwritten - /app/node_modules
ports: ports:
- "3005:3005" - "3000:3000"
restart: unless-stopped command: npm run dev
command: npm run dev -- --host 0.0.0.0 --port 3005 depends_on:
- backend
# Mailhog - Email testing for development healthcheck:
mailhog: test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:80"]
image: mailhog/mailhog:latest interval: 30s
container_name: picpeak-mailhog timeout: 10s
ports: retries: 3
- "1025:1025" # SMTP server networks:
- "8025:8025" # Web UI - picpeak-network
restart: unless-stopped
volumes: volumes:
postgres_data_dev: postgres-data:
driver: local
redis-data:
driver: local
networks: networks:
default: picpeak-network:
name: picpeak-dev-network driver: bridge