Skip to content

Commit

Permalink
bugfix: workaround for issue where migrator sees an applied migration…
Browse files Browse the repository at this point in the history
… but doesn't detect the file
  • Loading branch information
a5huynh committed Jul 24, 2022
1 parent afc85f8 commit f3320a4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions crates/spyglass/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
match rt.block_on(Migrator::up(&state.db, None)) {
Ok(_) => {}
Err(e) => {
// Ruh-oh something went wrong
log::error!("Unable to migrate database - {:?}", e);
// Exit from app
return Ok(());
let msg = e.to_string();
// This is ok, just the migrator being funky
if !msg.contains("been applied but its file is missing") {
// Ruh-oh something went wrong
log::error!("Unable to migrate database - {}", e.to_string());
// Exit from app
return Ok(());
}
}
}

Expand Down

0 comments on commit f3320a4

Please sign in to comment.