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 = [
{
template_key: 'database_backup_failed',
subject_en: 'Database Backup Failed - Critical Alert',
subject_de: 'Datenbank-Backup fehlgeschlagen - Kritische Warnung',
body_html_en: `<h2>Database Backup Failed</h2>
subject: 'Database Backup Failed - Critical Alert',
body_html: `<h2>Database Backup Failed</h2>
<p>The scheduled database backup has failed and requires immediate attention.</p>
<p><strong>Error Details:</strong></p>
<ul>
@@ -107,24 +106,13 @@ async function up() {
<li>Error: {{error_message}}</li>
</ul>
<p>This is a critical issue that could affect disaster recovery. Please investigate immediately.</p>`,
body_html_de: `<h2>Datenbank-Backup fehlgeschlagen</h2>
<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.',
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.',
variables: JSON.stringify(['backup_type', 'timestamp', 'error_message'])
},
{
template_key: 'database_backup_completed',
subject_en: 'Database Backup Completed Successfully',
subject_de: 'Datenbank-Backup erfolgreich abgeschlossen',
body_html_en: `<h2>Database Backup Completed</h2>
subject: 'Database Backup Completed Successfully',
body_html: `<h2>Database Backup Completed</h2>
<p>The scheduled database backup has been completed successfully.</p>
<p><strong>Backup Summary:</strong></p>
<ul>
@@ -134,18 +122,7 @@ async function up() {
<li>Compression Ratio: {{compression_ratio}}</li>
<li>File Path: {{file_path}}</li>
</ul>`,
body_html_de: `<h2>Datenbank-Backup abgeschlossen</h2>
<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}}',
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}}',
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'
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:
build: ./backend
build:
context: ./backend
dockerfile: Dockerfile
container_name: picpeak-backend-dev
depends_on:
db:
condition: service_healthy
restart: unless-stopped
environment:
NODE_ENV: development
PORT: 3001
DATABASE_CLIENT: pg
DB_HOST: db
DB_PORT: 5432
DB_NAME: ${DB_NAME:-picpeak}
DB_USER: ${DB_USER:-picpeak}
DB_PASSWORD: ${DB_PASSWORD:-picpeak}
JWT_SECRET: ${JWT_SECRET:-dev-secret-DO-NOT-USE-IN-PRODUCTION}
ADMIN_URL: ${ADMIN_URL:-http://localhost:3005}
FRONTEND_URL: ${FRONTEND_URL:-http://localhost:3005}
BACKEND_URL: ${BACKEND_URL:-http://localhost:3001}
# Email via Mailhog
SMTP_HOST: mailhog
SMTP_PORT: 1025
SMTP_SECURE: "false"
SMTP_USER: ""
SMTP_PASS: ""
EMAIL_FROM: ${EMAIL_FROM:-noreply@localhost}
- NODE_ENV=development
- PORT=3001
- JWT_SECRET=${JWT_SECRET}
- ADMIN_USERNAME=${ADMIN_USERNAME:-admin}
- ADMIN_EMAIL=${ADMIN_EMAIL:-admin@example.com}
- DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWORD}@postgres:5432/${DB_NAME}
- DB_TYPE=postgresql
- DB_HOST=postgres
- DB_PORT=5432
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_NAME=${DB_NAME}
- SMTP_HOST=${SMTP_HOST}
- SMTP_PORT=${SMTP_PORT}
- SMTP_SECURE=${SMTP_SECURE:-false}
- SMTP_USER=${SMTP_USER}
- SMTP_PASS=${SMTP_PASS}
- EMAIL_FROM=${EMAIL_FROM:-noreply@picpeak.local}
- FRONTEND_URL=${FRONTEND_URL:-http://localhost:3000}
- ADMIN_URL=${ADMIN_URL:-http://localhost:3001}
- TZ=${TZ:-UTC}
volumes:
- ./backend:/app
- /app/node_modules # Prevent node_modules from being overwritten
- ./storage:/app/storage
- ./events:/app/events
- ./data:/app/data
- ./logs:/app/logs
- ./backup:/backup
ports:
- "3001:3001"
restart: unless-stopped
command: npm run dev
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001/api/health"]
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3001/api/health"]
interval: 30s
timeout: 10s
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:
build:
build:
context: ./frontend
dockerfile: Dockerfile.dev
args:
- VITE_API_URL=${VITE_API_URL:-http://localhost:3001/api}
- VITE_UMAMI_URL=${VITE_UMAMI_URL:-}
- VITE_UMAMI_WEBSITE_ID=${VITE_UMAMI_WEBSITE_ID:-}
- VITE_UMAMI_SHARE_URL=${VITE_UMAMI_SHARE_URL:-}
container_name: picpeak-frontend-dev
depends_on:
- backend
restart: unless-stopped
environment:
- VITE_API_URL=${VITE_API_URL:-http://localhost:3001/api}
- VITE_UMAMI_URL=${VITE_UMAMI_URL}
- VITE_UMAMI_WEBSITE_ID=${VITE_UMAMI_WEBSITE_ID}
- NODE_ENV=development
volumes:
- ./frontend:/app
- /app/node_modules # Prevent node_modules from being overwritten
- /app/node_modules
ports:
- "3005:3005"
restart: unless-stopped
command: npm run dev -- --host 0.0.0.0 --port 3005
# Mailhog - Email testing for development
mailhog:
image: mailhog/mailhog:latest
container_name: picpeak-mailhog
ports:
- "1025:1025" # SMTP server
- "8025:8025" # Web UI
restart: unless-stopped
- "3000:3000"
command: npm run dev
depends_on:
- backend
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:80"]
interval: 30s
timeout: 10s
retries: 3
networks:
- picpeak-network
volumes:
postgres_data_dev:
postgres-data:
driver: local
redis-data:
driver: local
networks:
default:
name: picpeak-dev-network
picpeak-network:
driver: bridge