Skip to content

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

Open
@augyg

Description

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?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions