This commit is contained in:
alexbelgium
2025-05-29 15:39:59 +02:00
parent 59abd5534e
commit fa1c830f80
4 changed files with 22 additions and 5 deletions

View File

@@ -1,5 +1,3 @@
## 15.7-32 (29-05-2025)
- Use vectorchord0.4.1 + pgvectors0.3.0 (for migration)
## 15.7-31 (28-05-2025)
- BREAKING CHANGE : please backup your database before updating

View File

@@ -1,7 +1,7 @@
{
"build_from": {
"aarch64": "ghcr.io/immich-app/postgres:15-vectorchord0.4.1-pgvectors0.3.0",
"amd64": "ghcr.io/immich-app/postgres:15-vectorchord0.4.1-pgvectors0.3.0",
"aarch64": "ghcr.io/immich-app/postgres:15-vectorchord0.3.0-pgvectors0.3.0",
"amd64": "ghcr.io/immich-app/postgres:15-vectorchord0.3.0-pgvectors0.3.0",
"armv7": "postgres:15-alpine"
},
"codenotary": {

View File

@@ -11,6 +11,7 @@
"CONFIG_LOCATION": "/config/postgresql.conf",
"PGDATA": "/config/database"
},
"hassio_api": true,
"image": "ghcr.io/alexbelgium/postgres-{arch}",
"init": false,
"map": [
@@ -38,5 +39,5 @@
"slug": "postgres",
"udev": true,
"url": "https://github.com/alexbelgium/hassio-addons/tree/master/postgres",
"version": "15.7-29"
"version": "15.7-36"
}

View File

@@ -102,6 +102,23 @@ compare_versions() {
return 1
}
show_db_extensions() {
bashio::log.info "==== PostgreSQL databases and enabled extensions ===="
for db in $(get_user_databases); do
bashio::log.info "Database: $db"
exts=$(psql "postgres://$DB_USERNAME:$DB_PASSWORD@$DB_HOSTNAME:$DB_PORT/$db" -tAc \
"SELECT extname || ' (v' || extversion || ')' FROM pg_extension ORDER BY extname;")
if [ -n "$exts" ]; then
while read -r ext; do
[ -n "$ext" ] && bashio::log.info " - $ext"
done <<< "$exts"
else
bashio::log.info " (no extensions enabled)"
fi
done
bashio::log.info "=============================================="
}
# --------- Main logic ----------
upgrade_postgres_if_needed() {
@@ -136,6 +153,7 @@ upgrade_postgres_if_needed() {
wait_for_postgres
else
bashio::log.info "PostgreSQL data directory version ($CLUSTER_VERSION) matches image version ($IMAGE_VERSION)."
show_db_extensions
fi
}