docs: add shadow v3 field operations package
This commit is contained in:
34
scripts/shadow-v3-install.cmd
Normal file
34
scripts/shadow-v3-install.cmd
Normal file
@@ -0,0 +1,34 @@
|
||||
@echo off
|
||||
setlocal EnableExtensions DisableDelayedExpansion
|
||||
|
||||
if "%~1"=="" goto :usage
|
||||
if "%~2"=="" goto :usage
|
||||
if "%~3"=="" goto :usage
|
||||
|
||||
set "SQL_SERVER=%~1"
|
||||
set "DATABASE=%~2"
|
||||
set "MODE=%~3"
|
||||
set "SQL_FILE="
|
||||
|
||||
if /I "%~3"=="upgrade" set "SQL_FILE=%~dp0..\fortucky-algorithm\src\main\resources\db\sqlserver\upgrade-shadow-v2-to-v3.sql"
|
||||
if /I "%~3"=="clean" set "SQL_FILE=%~dp0..\fortucky-algorithm\src\main\resources\db\sqlserver\install-shadow.sql"
|
||||
if not defined SQL_FILE (call :fail "mode must be upgrade or clean" & exit /b 1)
|
||||
if not exist "%SQL_FILE%" (call :fail "SQL package 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 Installing FT546WMS shadow v3 in %MODE% mode...
|
||||
sqlcmd -S "%SQL_SERVER%" -d "%DATABASE%" -E -b -r1 -i "%SQL_FILE%"
|
||||
if errorlevel 1 exit /b 1
|
||||
|
||||
echo INSTALL_OK mode=%MODE%
|
||||
exit /b 0
|
||||
|
||||
:usage
|
||||
echo Usage: %~nx0 SQL_SERVER DATABASE upgrade^|clean 1>&2
|
||||
exit /b 2
|
||||
|
||||
:fail
|
||||
echo INSTALL_FAILED %~1 1>&2
|
||||
exit /b 1
|
||||
Reference in New Issue
Block a user