Skip to content

Refuse to start server if there are diesel migrations that haven't been run? #638

Open
@carols10cents

Description

@carols10cents

I'm used to the behavior in rails whereupon if you try to start your server and there are migrations that haven't been made to the database yet, the server will bail right away and tell you to go run them.

Right now, if I forget to run migrations, I may or may not get an error immediately, depending on if I happen to make a request that expects the database to be different or not. I've also been bitten by this enough that now I know "oh hey i probably just need to run migrations", but in the past (especially with rails' reloading where you don't have to restart the server when you get new code) I and other people have gone on wild goose chases when getting weird database errors that were caused by outstanding migrations.

In production, the procfile runs migrations just before starting the server every time, and the tests automatically run outstanding migrations, so this is mostly for development.

Is this possible/easy with diesel, @sgrif ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-internal 🔧Category: Nonessential work that would make the codebase more consistent or clear

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions