From ccadc5cdf328229254a91b16635a7716fca7cd6a Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 26 May 2025 09:24:56 +0200 Subject: [PATCH] Check for vectors --- immich/rootfs/etc/cont-init.d/99-run.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/immich/rootfs/etc/cont-init.d/99-run.sh b/immich/rootfs/etc/cont-init.d/99-run.sh index 1cb8f01a0..6bd43a34c 100755 --- a/immich/rootfs/etc/cont-init.d/99-run.sh +++ b/immich/rootfs/etc/cont-init.d/99-run.sh @@ -150,6 +150,20 @@ EOF bashio::log.info "Database setup completed successfully." } +# Function to check if vectors extension is enabled +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." + exit 0 + else + bashio::log.warning "❌ 'vectors' extension is NOT enabled." + return 1 + fi +} + # Function to check if vchord extension is enabled check_vchord_extension() { echo "Checking if 'vchord' extension is enabled..." @@ -160,7 +174,7 @@ check_vchord_extension() { exit 0 else bashio::log.warning "❌ 'vchord' extension is NOT enabled." - return 1 + check_vector_extension fi }