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

Question: How should one deploy a new database to production when using beam-automigrate? #209

Open
augyg opened this issue May 27, 2023 · 1 comment

Comments

@augyg
Copy link

augyg commented May 27, 2023

A couple weeks ago I deployed a server where in local development beam automigrate complained about an unsafe edit. I was able to solve this locally by using gargoyle-postgresql /path/to/db but to my knowledge I cannot use gargoyle-postgresql through SSH to interact with the server's database so I ended up using scp to get the database on my local machine, applying edits and then scp-ing the server's db back to the server.

After some trial and error I learned that what worked best was to put the db back to the path specified by withDb and then immediately do the deployment so that nginx+backend-start aren't racing to write to this path, which had caused issues before in previous tries.

Of course this would not work if I had much higher traffic to the site and would need an immediate switchover (eg. new user signs up into db at path that would be replaced by me manually with the edited database).

So is there a better way to do this?

@alexfmpe
Copy link
Contributor

Related, I think: obsidiansystems/beam-automigrate#20

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