Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' # Load shared utilities $utilsPath = Join-Path $PSScriptRoot '..\lib\utils.ps1' . $utilsPath $starterPath = Join-Path $PSScriptRoot 'starter.ps1' . $starterPath if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } $useDocker = Test-Path '.env' $useNative = Test-Path '.venv' if (-not $useDocker -and -not $useNative) { Write-Warning-Custom "Neither .env (Docker) nor .venv (native) found. Please set up your environment first." exit 1 } Write-Step "Applying migration files..." if ($useDocker) { docker compose exec app uv run manage.py migrate } elseif ($useNative) { & .\.venv\Scripts\python.exe manage.py migrate } if ($LASTEXITCODE -ne 0) { Write-Error-Custom "Failed to apply migration files" exit $LASTEXITCODE } Write-Success "Migration files applied successfully!" Write-Result "Database is now up to date"