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

View File

@@ -33,6 +33,7 @@ $SUDO patch -p1 < $cloneDir/patches/db_migrations.patch
$SUDO patch -p1 < $cloneDir/patches/db_migrations2.patch
$SUDO patch -p1 < $cloneDir/patches/db_migrations3.patch
$SUDO patch -p1 < $cloneDir/patches/db_migrations4.patch
$SUDO patch -p1 < $cloneDir/patches/db_migrations5.patch
$SUDO patch -p1 < $cloneDir/patches/errors_errors.patch
$SUDO patch -p1 < $cloneDir/patches/expiration-mailer_main.patch
$SUDO patch -p1 < $cloneDir/patches/issuance_crl.patch

View File

@@ -0,0 +1,13 @@
diff --git a/sa/db/boulder_sa/20240514000000_Paused.sql b/sa/db/boulder_sa/20240514000000_Paused.sql
index 9f5890cad..1707916ba 100644
--- a/sa/db/boulder_sa/20240514000000_Paused.sql
+++ b/sa/db/boulder_sa/20240514000000_Paused.sql
@@ -5,7 +5,7 @@
-- partition it. This table expected to be < 800K rows initially and grow at a
-- rate of ~18% per year.
-CREATE TABLE `paused` (
+CREATE TABLE IF NOT EXISTS `paused` (
`registrationID` bigint(20) UNSIGNED NOT NULL,
`identifierType` tinyint(4) NOT NULL,
`identifierValue` varchar(255) NOT NULL,