schon/scripts/Unix/make-migrations.sh
Egor fureunoir Gorbunov b5e303e7a5 feat(email): add multilingual support and image handling to email templates
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.
2026-01-26 15:35:30 +03:00

40 lines
911 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 "Generating migration files..."
if [ "$use_docker" = true ]; then
if ! docker compose exec app uv run manage.py makemigrations; then
log_error "Failed to generate migration files"
exit 1
fi
elif [ "$use_native" = true ]; then
if ! .venv/bin/python manage.py makemigrations; then
log_error "Failed to generate migration files"
exit 1
fi
fi
log_success "Migration files created successfully!"
echo
log_result "You can now use migrate.sh script or run: make migrate"