Files

24 lines
652 B
PowerShell

param([switch]$Force)
. "$PSScriptRoot\lib\common.ps1"
if (-not $Force) {
throw "This deletes the local Cortex test database volume. Re-run with -Force to continue."
}
Write-Step "Resetting local Cortex test database"
Assert-Docker
Invoke-CortexTestCompose stop cortex-test-app cortex-test-db
Invoke-CortexTestCompose rm -f cortex-test-db
$volumeName = "cortex-test_cortex-test-postgres-data"
docker volume inspect $volumeName *> $null
if ($LASTEXITCODE -eq 0) {
docker volume rm $volumeName
if ($LASTEXITCODE -ne 0) {
throw "Could not remove Docker volume '$volumeName'."
}
}
Invoke-CortexTestCompose up -d cortex-test-db