fix(infra): install pgvector and uuid-ossp extensions in mosaic-db-init
Mosaic Stack API schema requires both vector (pgvector) and uuid-ossp extensions. The mosaic user cannot CREATE EXTENSION (requires superuser), so extensions must be installed by the admin user during db-init before Prisma runs migrations. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -91,6 +91,10 @@ services:
|
|||||||
psql -h openbrain_brain-db -U $${PGUSER} -tc "SELECT 1 FROM pg_database WHERE datname='$${MOSAIC_DB}'" | grep -q 1 || \
|
psql -h openbrain_brain-db -U $${PGUSER} -tc "SELECT 1 FROM pg_database WHERE datname='$${MOSAIC_DB}'" | grep -q 1 || \
|
||||||
psql -h openbrain_brain-db -U $${PGUSER} -c "CREATE DATABASE $${MOSAIC_DB} OWNER $${MOSAIC_USER} ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE template0;"
|
psql -h openbrain_brain-db -U $${PGUSER} -c "CREATE DATABASE $${MOSAIC_DB} OWNER $${MOSAIC_USER} ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE template0;"
|
||||||
|
|
||||||
|
echo "Enabling required extensions in $${MOSAIC_DB}..."
|
||||||
|
psql -h openbrain_brain-db -U $${PGUSER} -d $${MOSAIC_DB} -c "CREATE EXTENSION IF NOT EXISTS vector;"
|
||||||
|
psql -h openbrain_brain-db -U $${PGUSER} -d $${MOSAIC_DB} -c "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";"
|
||||||
|
|
||||||
echo "Mosaic database ready: $${MOSAIC_DB}"
|
echo "Mosaic database ready: $${MOSAIC_DB}"
|
||||||
networks:
|
networks:
|
||||||
- openbrain-brain-internal
|
- openbrain-brain-internal
|
||||||
|
|||||||
Reference in New Issue
Block a user