Introduce `EmailImage`, `EmailTemplate`, and `EmailCampaign` models for enhanced email management, including campaign tracking and one-click unsubscribe tokens. Added multilingual fields for email templates and improved accessibility with image alt text. Also adapted `Post` content fields to support translations.
40 lines
861 B
Bash
40 lines
861 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
source ./scripts/Unix/starter.sh
|
|
|
|
# Detect environment: Docker or native
|
|
use_docker=false
|
|
use_native=false
|
|
|
|
if [ -f .env ]; then
|
|
use_docker=true
|
|
fi
|
|
|
|
if [ -d .venv ]; then
|
|
use_native=true
|
|
fi
|
|
|
|
if [ "$use_docker" = false ] && [ "$use_native" = false ]; then
|
|
log_error "Neither .env (Docker) nor .venv (native) found. Please set up your environment first."
|
|
exit 1
|
|
fi
|
|
|
|
log_step "Applying migration files..."
|
|
|
|
if [ "$use_docker" = true ]; then
|
|
if ! docker compose exec app uv run manage.py migrate; then
|
|
log_error "Failed to apply migration files"
|
|
exit 1
|
|
fi
|
|
elif [ "$use_native" = true ]; then
|
|
if ! .venv/bin/python manage.py migrate; then
|
|
log_error "Failed to apply migration files"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
log_success "Migration files applied successfully!"
|
|
|
|
echo
|
|
log_result "Database is now up to date"
|