Fix new(ish) db migration and add check

This commit is contained in:
Arjan H
2025-01-18 19:49:20 +01:00
parent 3116c85c2c
commit 131b8d3505
3 changed files with 34 additions and 0 deletions

View File

@@ -77,6 +77,20 @@ colorGoVersion2() {
echo "* $fileName:$res"
}
colorEqual() {
local first="$1"
local second="$2"
if [ "$first" = "$second" ]; then
res=$(echo $first | sed -e "s/$first/${COL_LIGHT_GREEN}$first${COL_NC}/")
echo " $res"
else
res=$(echo $first | sed -e "s/$first/${COL_LIGHT_RED}$first${COL_NC}/")
echo " $res, but have $second"
fi
}
echo
cd ../boulder
@@ -112,3 +126,9 @@ grep GO_VERSION ../boulder/docker-compose.yml | sed -e "s/\s*GO_VERSION:/ /"
colorGoVersion2 build/docker-compose.yml $goversion
echo
db_migrs=$(ls -1 ../boulder/sa/db/boulder_sa/ | wc -l)
db_patches=$(ls -1 ../labca/patches/db_migrations* | wc -l)
echo -n "Database migrations "
colorEqual $db_migrs $db_patches
echo