Migrate to VectorChord and match upstream

Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
This commit is contained in:
Juhyung Park
2025-10-16 22:41:36 +09:00
parent b7f3133f9e
commit 0a7774ff12
3 changed files with 19 additions and 1 deletions

View File

@@ -38,6 +38,8 @@ pgvector is included in the official PostgreSQL's APT repository:
sudo apt install postgresql(-17)-pgvector
```
* [VectorChord](https://docs.vectorchord.ai/vectorchord/getting-started/installation.html)
* [FFmpeg](https://github.com/FFmpeg/FFmpeg)
Immich uses FFmpeg to process media.
@@ -114,6 +116,7 @@ postgres=# create user immich with encrypted password 'YOUR_STRONG_RANDOM_PW';
postgres=# grant all privileges on database immich to immich;
postgres=# ALTER USER immich WITH SUPERUSER;
postgres=# CREATE EXTENSION IF NOT EXISTS vector;
postgres=# CREATE EXTENSION IF NOT EXISTS vchord CASCADE;
postgres=# \q
```

1
env
View File

@@ -9,7 +9,6 @@ NODE_ENV=production
DB_USERNAME=immich
DB_DATABASE_NAME=immich
DB_VECTOR_EXTENSION=pgvector
# The location where your uploaded files are stored
UPLOAD_LOCATION=./library

View File

@@ -37,6 +37,22 @@ if [[ "$USER" != "immich" ]]; then
exit 0
fi
# Sanity check, users should have VectorChord enabled
if psql -U immich -c "SELECT 1;" > /dev/null 2>&1; then
# Immich is installed, check VectorChord
if ! psql -U immich -c "SELECT * FROM pg_extension;" | grep "vchord" > /dev/null 2>&1; then
echo "VectorChord is not enabled for Immich."
echo "Please read https://github.com/immich-app/immich/blob/main/docs/docs/administration/postgres-standalone.md"
exit 1
fi
fi
if [ -e "$IMMICH_PATH/env" ]; then
if grep -q DB_VECTOR_EXTENSION "$IMMICH_PATH/env"; then
echo "Please remove DB_VECTOR_EXTENSION from your env file"
exit 1
fi
fi
BASEDIR=$(dirname "$0")
umask 077