#!/usr/bin/env pwsh
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'

.\scripts\Windows\starter.ps1
if ($LASTEXITCODE -ne 0) {
    exit $LASTEXITCODE
}

Write-Host "Starting database backup process..." -ForegroundColor Magenta
docker compose exec app uv run python manage.py dbbackup
if ($LASTEXITCODE -ne 0) {
    exit $LASTEXITCODE
}
Write-Host "Database backup created under ./dbbackup" -ForegroundColor Green

Write-Host "Starting media backup process..." -ForegroundColor Magenta
docker compose exec app uv run python manage.py mediabackup
if ($LASTEXITCODE -ne 0) {
    exit $LASTEXITCODE
}
Write-Host "Media backup created under ./dbbackup" -ForegroundColor Green