Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use pgroll for database migrations #683

Open
davemaier opened this issue Nov 19, 2023 · 2 comments
Open

Can't use pgroll for database migrations #683

davemaier opened this issue Nov 19, 2023 · 2 comments

Comments

@davemaier
Copy link

Hi! I fell a bit in love with your project to be honest. Thanks for the great work so far.

Anyway. I'm trying to create a template to make project setup for my future projects easier. I wanted to use pgroll for database migrations and I'm a bit stuck there.

The problem is that pgroll doesn't seem to like the proxy. It applies the migrations if I use it directly on the database, but it gives me an error if I use it on the proxy.

The logs of the proxy also don't seem to be very helpful.

I first initialized pgroll using the pgroll init command directly on the database (gives the same error if used on the proxy)

Then I run the following command:

pgroll --postgres-url "postgresql://postgres:proxy_password@localhost:65432/postgres?sslmode=disable" start example.json

And I get this error

Error: driver: bad connection

Logs of the proxy service look like this:

offshore-stack-electric-1  | 08:57:12.122 pid=<0.3418.0> proxy_session_id=5 [warning] Not validating user "postgres"
offshore-stack-electric-1  | 08:57:12.122 pid=<0.3418.0> proxy_session_id=5 [info] Initialising injector in capture mode %Electric.Postgres.Proxy.Injector.Electric{}
offshore-stack-electric-1  | 08:57:12.127 pid=<0.3418.0> proxy_session_id=5 [info] Upstream connection is ready to accept queries

This repo can be used to reproduce:
https://github.com/davemaier/offshore-template/tree/bug/pgroll-not-working

Thanks!

@davemaier davemaier changed the title Can't use pgroll for database migrations Can't use pgroll for database migrations Nov 19, 2023
@gorbak25
Copy link

@davemaier pgroll uses shadow columns(https://news.ycombinator.com/item?id=37753511) in a similar way to #668 special support would be needed to support that in the proxy.

@davemaier
Copy link
Author

Thanks for checking that. I'll be watching the other issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants