Files
FT546MWS/scripts/shadow-v3-uninstall.cmd
zgw 699310e61d fix(shadow): align outbound predicates with site data for v3.3
Use the business project and captured site predicates, validate single-stock proposals, and skip unsupported scopes without changing Legacy. Add the guarded V3.3 SQL upgrade, CMD operations, regression tests and deployment runbook.
2026-09-07 12:43:43 +08:00

36 lines
989 B
Batchfile

@echo off
setlocal EnableExtensions DisableDelayedExpansion
if "%~1"=="" goto :usage
if "%~2"=="" goto :usage
if "%~3"=="" goto :usage
if not "%~3"=="CONFIRM_UNINSTALL" goto :refuse
set "SQL_SERVER=%~1"
set "DATABASE=%~2"
set "SQL_FILE=%~dp0..\fortucky-algorithm\src\main\resources\db\sqlserver\uninstall-shadow.sql"
if not exist "%SQL_FILE%" (call :fail "uninstall SQL file is missing" & exit /b 1)
where sqlcmd >nul 2>nul
if errorlevel 1 (call :fail "sqlcmd is not available on PATH" & exit /b 1)
echo WARNING: export all alg.* evidence before uninstalling.
echo The shadow-enabled WMS must be stopped and the stable WMS instance restored first.
sqlcmd -S "%SQL_SERVER%" -d "%DATABASE%" -E -b -r1 -i "%SQL_FILE%"
if errorlevel 1 exit /b 1
echo UNINSTALL_OK
exit /b 0
:usage
echo Usage: %~nx0 SQL_SERVER DATABASE CONFIRM_UNINSTALL 1>&2
exit /b 2
:refuse
echo UNINSTALL_REFUSED third argument must be CONFIRM_UNINSTALL 1>&2
exit /b 3
:fail
echo UNINSTALL_FAILED %~1 1>&2
exit /b 1