24 lines
600 B
PowerShell
24 lines
600 B
PowerShell
param([switch]$Force)
|
|
|
|
. "$PSScriptRoot\lib\common.ps1"
|
|
|
|
if (-not $Force) {
|
|
throw "This deletes the local Cortex database volume. Re-run with -Force to continue."
|
|
}
|
|
|
|
Write-Step "Resetting local PostgreSQL data"
|
|
Assert-Docker
|
|
Invoke-CortexCompose stop cortex-app cortex-db
|
|
Invoke-CortexCompose rm -f cortex-db
|
|
|
|
$volumeName = "cortex_cortex-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-CortexCompose up -d cortex-db
|