Ensure postgresql is upgraded to 15.

Some apps required pg 16, so pg_upgradecluster tries to upgrade 13 to 16 and fails (cluster already exists)
This commit is contained in:
Salamandar 2024-07-16 23:02:25 +02:00
parent 443eac47ca
commit 03a5c3d144

View file

@ -56,7 +56,7 @@ class MyMigration(Migration):
"LC_ALL=C pg_dropcluster --stop 15 main || true" "LC_ALL=C pg_dropcluster --stop 15 main || true"
) # We do not trigger an exception if the command fails because that probably means cluster 15 doesn't exists, which is fine because it's created during the pg_upgradecluster) ) # We do not trigger an exception if the command fails because that probably means cluster 15 doesn't exists, which is fine because it's created during the pg_upgradecluster)
time.sleep(3) time.sleep(3)
self.runcmd("LC_ALL=C pg_upgradecluster -m upgrade 13 main") self.runcmd("LC_ALL=C pg_upgradecluster -m upgrade 13 main -v 15")
self.runcmd("LC_ALL=C pg_dropcluster --stop 13 main") self.runcmd("LC_ALL=C pg_dropcluster --stop 13 main")
self.runcmd("systemctl start postgresql") self.runcmd("systemctl start postgresql")