This commit is contained in:
alexbelgium
2025-05-25 16:11:02 +02:00
parent 0665a8d7b6
commit ea8f9d83d4
5 changed files with 60 additions and 56 deletions

View File

@@ -150,16 +150,16 @@ 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';")
# Function to check if vectorchord extension is enabled
check_vectorchord_extension() {
echo "Checking if 'vectorchord' extension is enabled..."
RESULT=$(psql "postgres://$DB_USERNAME:$DB_PASSWORD@$DB_HOSTNAME:$DB_PORT" -tAc "SELECT extname FROM pg_extension WHERE extname = 'vectorchord';")
if [[ "$RESULT" == "vectors" ]]; then
echo "✅ 'vectors' extension is enabled."
if [[ "$RESULT" == "vectorchord" ]]; then
echo "✅ 'vectorchord' extension is enabled."
exit 0
else
bashio::log.warning "❌ 'vectors' extension is NOT enabled."
bashio::log.warning "❌ 'vectorchord' extension is NOT enabled."
return 1
fi
}
@@ -185,4 +185,4 @@ export_db_env
setup_root_user
setup_database
check_vector_extension
check_vectorchord_extension