chore: add db migration helper scripts
This commit is contained in:
23
migrate.bat
Normal file
23
migrate.bat
Normal file
@@ -0,0 +1,23 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
if "%~1"=="" (
|
||||
echo Usage: migrate.bat path\to\migration.sql
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
set SQL_FILE=%~1
|
||||
|
||||
if not exist "%SQL_FILE%" (
|
||||
echo Error: File "%SQL_FILE%" does not exist.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo Running %SQL_FILE% against pragativeer_db...
|
||||
docker exec -i pragativeer_db psql -U pragativeer_admin -d pragativeer_prod < "%SQL_FILE%"
|
||||
|
||||
if %ERRORLEVEL% equ 0 (
|
||||
echo Migration applied successfully!
|
||||
) else (
|
||||
echo Migration failed!
|
||||
)
|
||||
Reference in New Issue
Block a user