mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-23 11:21:32 +00:00
don't assume that migrations are already sorted
This commit is contained in:
parent
7fcaca0cb1
commit
2ef89bddb9
1 changed files with 7 additions and 1 deletions
|
@ -275,7 +275,13 @@ fn run_selected_migrations(
|
||||||
.enable_diff_check
|
.enable_diff_check
|
||||||
.then(|| diesel::migration::MigrationSource::<Pg>::migrations(&migrations()))
|
.then(|| diesel::migration::MigrationSource::<Pg>::migrations(&migrations()))
|
||||||
.transpose()?
|
.transpose()?
|
||||||
.and_then(|migrations| Some(migrations.last()?.name().to_string())),
|
// Get the migration with the highest version
|
||||||
|
.and_then(|migrations| {
|
||||||
|
migrations
|
||||||
|
.into_iter()
|
||||||
|
.map(|migration| migration.name().to_string())
|
||||||
|
.max()
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
if options.revert {
|
if options.revert {
|
||||||
|
|
Loading…
Reference in a new issue