Immich: address Copilot PR review findings

- Fix check_vchord_extension (and check_vector_extension) to query
  pg_available_extensions against the actual immich database instead of
  pg_extension on the default connection database. Immich creates the vchord
  extension itself on first startup, so checking pg_extension before Immich
  ever runs produced a false warning on every fresh install; checking
  pg_available_extensions reports whether the server CAN provide the
  extension, which is what the startup diagnostic actually needs.
- Drop the vestigial `services: - mysql:want` Supervisor service-discovery
  hint from the four Immich config.yaml files: nothing in the add-on reads
  it, and the scripts are hard-coded to PostgreSQL via psql — Immich has
  never supported MySQL. Also fix the matching misleading line in the base
  README.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PcbbgB7A5LLbPuPRjLUouk
This commit is contained in:
Claude
2026-07-04 14:12:14 +00:00
parent 275def9fb1
commit 1d9ace0337
6 changed files with 16 additions and 21 deletions

View File

@@ -46,7 +46,7 @@ See the official [v3 migration guide](https://immich.app/blog/v3-migration) for
## Configuration
Webui can be found at `<your-ip>:8080`. PostgreSQL/MySQL can be either internal or external.
Webui can be found at `<your-ip>:8080`. PostgreSQL can be either internal or external.
### Options

View File

@@ -137,8 +137,6 @@ schema:
localdisks: str?
networkdisks: str?
skip_permissions_check: bool?
services:
- mysql:want
slug: immich
udev: true
url: https://github.com/alexbelgium/hassio-addons

View File

@@ -144,28 +144,31 @@ EOF
bashio::log.info "Database setup completed successfully."
}
# Function to check if vectors extension is enabled
# Function to check if the vectors (pgvecto.rs) extension is available on the server
check_vector_extension() {
echo "Checking if 'vectors' extension is enabled..."
RESULT=$(psql "postgres://$DB_USERNAME:$DB_PASSWORD@$DB_HOSTNAME:$DB_PORT" -tAc "SELECT extname FROM pg_extension WHERE extname = 'vectors';")
if [[ "$RESULT" == "vectors" ]]; then
echo "✅ 'vectors' extension is enabled."
echo "Checking if 'vectors' extension is available for database '${DB_DATABASE_NAME}'..."
RESULT=$(psql "postgres://$DB_USERNAME:$DB_PASSWORD@$DB_HOSTNAME:$DB_PORT/${DB_DATABASE_NAME}" -tAc "SELECT 1 FROM pg_available_extensions WHERE name = 'vectors';")
if [[ "$RESULT" == "1" ]]; then
echo "✅ 'vectors' extension is available."
return 0
else
bashio::log.warning "❌ 'vectors' extension is NOT enabled."
bashio::log.warning "❌ 'vectors' extension is NOT available."
return 1
fi
}
# Function to check if vchord extension is enabled
# Function to check if the VectorChord (vchord) extension is available on the server.
# Uses pg_available_extensions (whether the extension CAN be created) rather than
# pg_extension (whether it has already been created), since Immich creates the extension
# itself on first startup; checking pg_extension would false-warn on every fresh install.
check_vchord_extension() {
echo "Checking if 'vchord' extension is enabled..."
RESULT=$(psql "postgres://$DB_USERNAME:$DB_PASSWORD@$DB_HOSTNAME:$DB_PORT" -tAc "SELECT extname FROM pg_extension WHERE extname = 'vchord';")
if [[ "$RESULT" == "vchord" ]]; then
echo "✅ 'vchord' extension is enabled."
echo "Checking if 'vchord' extension is available for database '${DB_DATABASE_NAME}'..."
RESULT=$(psql "postgres://$DB_USERNAME:$DB_PASSWORD@$DB_HOSTNAME:$DB_PORT/${DB_DATABASE_NAME}" -tAc "SELECT 1 FROM pg_available_extensions WHERE name = 'vchord';")
if [[ "$RESULT" == "1" ]]; then
echo "✅ 'vchord' extension is available."
return 0
else
bashio::log.warning "❌ 'vchord' extension is NOT enabled."
bashio::log.warning "❌ 'vchord' extension is NOT available."
return 1
fi
}

View File

@@ -135,8 +135,6 @@ schema:
localdisks: str?
networkdisks: str?
skip_permissions_check: bool?
services:
- mysql:want
slug: immich_cuda
udev: true
url: https://github.com/alexbelgium/hassio-addons

View File

@@ -136,8 +136,6 @@ schema:
localdisks: str?
networkdisks: str?
skip_permissions_check: bool?
services:
- mysql:want
slug: immich_noml
udev: true
url: https://github.com/alexbelgium/hassio-addons

View File

@@ -136,8 +136,6 @@ schema:
localdisks: str?
networkdisks: str?
skip_permissions_check: bool?
services:
- mysql:want
slug: immich_openvino
udev: true
url: https://github.com/alexbelgium/hassio-addons