Skip to content

How to create migrations with specific pgvector-enabled docker image? #3013

Answered by leomorpho
leomorpho asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks, yes, it was an ancient version and I did not realize...my bad.

Sharing a solution I used to create migrations against a pgvector-enabled image.

In my makefile:

# Define variables
PGVECTOR_IMAGE_NAME = custom-pgvector-for-atlas
PGVECTOR_IMAGE_TAG = latest
PGVECTOR_IMAGE_DIR = pgvector-image

.PHONY: migrate_diff
makemigrations: build-image ## Create a migration
	@echo "Running Atlas migrate diff..."
	atlas migrate diff "$(name)" \
	  --dir "file://ent/migrate/migrations" \
	  --to "ent://ent/schema" \
	  --dev-url "docker+postgres://_/custom-pgvector:latest/dev?search_path=public&sslmode=disable"

And then in pgvector-image/Dockerfile:

# Use the pgvector base image
FROM ankane/pgvec…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@leomorpho
Comment options

@a8m
Comment options

a8m Jul 31, 2024
Maintainer

@rotemtam
Comment options

@leomorpho
Comment options

Answer selected by leomorpho
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants