mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-30 23:13:09 +08:00
Write assumed version to the index-scheduler version db when it is missing
This commit is contained in:
parent
c1eba66443
commit
182c3f4b80
@ -45,7 +45,17 @@ impl Versioning {
|
|||||||
let mut wtxn = env.write_txn()?;
|
let mut wtxn = env.write_txn()?;
|
||||||
let version = env.create_database(&mut wtxn, Some(db_name::VERSION))?;
|
let version = env.create_database(&mut wtxn, Some(db_name::VERSION))?;
|
||||||
let this = Self { version };
|
let this = Self { version };
|
||||||
let from = this.get_version(&wtxn)?.unwrap_or(db_version);
|
let from = match this.get_version(&wtxn)? {
|
||||||
|
Some(version) => version,
|
||||||
|
None => {
|
||||||
|
let assumed_version = match db_version {
|
||||||
|
(1, 12, _) => db_version,
|
||||||
|
_ => (1, 12, 7),
|
||||||
|
};
|
||||||
|
this.set_version(&mut wtxn, assumed_version)?;
|
||||||
|
assumed_version
|
||||||
|
}
|
||||||
|
};
|
||||||
wtxn.commit()?;
|
wtxn.commit()?;
|
||||||
|
|
||||||
let bin_major: u32 = versioning::VERSION_MAJOR.parse().unwrap();
|
let bin_major: u32 = versioning::VERSION_MAJOR.parse().unwrap();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user