Skip to content
Discussion options

You must be logged in to vote

My first step has gone completely painlessly, though I anticipate that I might have some trouble with reverting and redoing migrations in future. I might have been overthinking the problem, though.

I made a setup.rs binary with the following code:

use diesel::prelude::*;
use diesel_migrations::MigrationHarness;
use common::server::get_database_url; 

use auth::backend::MIGRATIONS as AUTH_MIGRATIONS;
use app::backend::MIGRATIONS;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let db_url = get_database_url();
    let mut connection = PgConnection::establish(&db_url).expect("Unable to establish a databse connection");

    connection.run_pending_migrations(AUTH_MIGRATIONS).expect("…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@isosphere
Comment options

Comment options

You must be logged in to vote
3 replies
@weiznich
Comment options

@isosphere
Comment options

@weiznich
Comment options

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