mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
bump version (#1871)
This commit is contained in:
@@ -16,8 +16,9 @@ mod v0_3_1;
|
||||
mod v0_3_1_1;
|
||||
mod v0_3_1_2;
|
||||
mod v0_3_2;
|
||||
mod v0_3_2_1;
|
||||
|
||||
pub type Current = v0_3_2::Version;
|
||||
pub type Current = v0_3_2_1::Version;
|
||||
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
|
||||
#[serde(untagged)]
|
||||
@@ -30,6 +31,7 @@ enum Version {
|
||||
V0_3_1_1(Wrapper<v0_3_1_1::Version>),
|
||||
V0_3_1_2(Wrapper<v0_3_1_2::Version>),
|
||||
V0_3_2(Wrapper<v0_3_2::Version>),
|
||||
V0_3_2_1(Wrapper<v0_3_2_1::Version>),
|
||||
Other(emver::Version),
|
||||
}
|
||||
|
||||
@@ -53,6 +55,7 @@ impl Version {
|
||||
Version::V0_3_1_1(Wrapper(x)) => x.semver(),
|
||||
Version::V0_3_1_2(Wrapper(x)) => x.semver(),
|
||||
Version::V0_3_2(Wrapper(x)) => x.semver(),
|
||||
Version::V0_3_2_1(Wrapper(x)) => x.semver(),
|
||||
Version::Other(x) => x.clone(),
|
||||
}
|
||||
}
|
||||
@@ -187,6 +190,7 @@ pub async fn init<Db: DbHandle>(
|
||||
Version::V0_3_1_1(v) => v.0.migrate_to(&Current::new(), db, receipts).await?,
|
||||
Version::V0_3_1_2(v) => v.0.migrate_to(&Current::new(), db, receipts).await?,
|
||||
Version::V0_3_2(v) => v.0.migrate_to(&Current::new(), db, receipts).await?,
|
||||
Version::V0_3_2_1(v) => v.0.migrate_to(&Current::new(), db, receipts).await?,
|
||||
Version::Other(_) => {
|
||||
return Err(Error::new(
|
||||
eyre!("Cannot downgrade"),
|
||||
@@ -227,6 +231,7 @@ mod tests {
|
||||
Just(Version::V0_3_1_1(Wrapper(v0_3_1_1::Version::new()))),
|
||||
Just(Version::V0_3_1_2(Wrapper(v0_3_1_2::Version::new()))),
|
||||
Just(Version::V0_3_2(Wrapper(v0_3_2::Version::new()))),
|
||||
Just(Version::V0_3_2_1(Wrapper(v0_3_2_1::Version::new()))),
|
||||
em_version().prop_map(Version::Other),
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
use emver::VersionRange;
|
||||
|
||||
use crate::config::util::MergeWith;
|
||||
use crate::hostname::{generate_id, get_hostname, sync_hostname};
|
||||
use crate::ErrorKind;
|
||||
|
||||
use super::v0_3_0::V0_3_0_COMPAT;
|
||||
use super::*;
|
||||
|
||||
26
backend/src/version/v0_3_2_1.rs
Normal file
26
backend/src/version/v0_3_2_1.rs
Normal file
@@ -0,0 +1,26 @@
|
||||
use super::v0_3_0::V0_3_0_COMPAT;
|
||||
use super::*;
|
||||
|
||||
const V0_3_2_1: emver::Version = emver::Version::new(0, 3, 2, 1);
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Version;
|
||||
#[async_trait]
|
||||
impl VersionT for Version {
|
||||
type Previous = v0_3_2::Version;
|
||||
fn new() -> Self {
|
||||
Version
|
||||
}
|
||||
fn semver(&self) -> emver::Version {
|
||||
V0_3_2_1
|
||||
}
|
||||
fn compat(&self) -> &'static emver::VersionRange {
|
||||
&*V0_3_0_COMPAT
|
||||
}
|
||||
async fn up<Db: DbHandle>(&self, db: &mut Db) -> Result<(), Error> {
|
||||
Ok(())
|
||||
}
|
||||
async fn down<Db: DbHandle>(&self, _db: &mut Db) -> Result<(), Error> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user