diff options
Diffstat (limited to 'crates/yt/src/storage/migrate/mod.rs')
-rw-r--r-- | crates/yt/src/storage/migrate/mod.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/crates/yt/src/storage/migrate/mod.rs b/crates/yt/src/storage/migrate/mod.rs index e2d93bd..418c893 100644 --- a/crates/yt/src/storage/migrate/mod.rs +++ b/crates/yt/src/storage/migrate/mod.rs @@ -94,8 +94,11 @@ pub(crate) enum DbVersion { /// Introduced: 2025-07-05. Four, + + /// Introduced: 2025-07-20. + Five, } -const CURRENT_VERSION: DbVersion = DbVersion::Four; +const CURRENT_VERSION: DbVersion = DbVersion::Five; async fn add_error_context( function: impl Future<Output = Result<()>>, @@ -147,6 +150,7 @@ impl DbVersion { DbVersion::Two => 2, DbVersion::Three => 3, DbVersion::Four => 4, + DbVersion::Five => 5, DbVersion::Empty => unreachable!("A empty version does not have an associated integer"), } @@ -159,12 +163,14 @@ impl DbVersion { (2, "yt") => Ok(DbVersion::Two), (3, "yt") => Ok(DbVersion::Three), (4, "yt") => Ok(DbVersion::Four), + (5, "yt") => Ok(DbVersion::Five), (0, other) => bail!("Db version is Zero, but got unknown namespace: '{other}'"), (1, other) => bail!("Db version is One, but got unknown namespace: '{other}'"), (2, other) => bail!("Db version is Two, but got unknown namespace: '{other}'"), (3, other) => bail!("Db version is Three, but got unknown namespace: '{other}'"), (4, other) => bail!("Db version is Four, but got unknown namespace: '{other}'"), + (5, other) => bail!("Db version is Five, but got unknown namespace: '{other}'"), (other, "yt") => bail!("Got unkown version for 'yt' namespace: {other}"), (num, nasp) => bail!("Got unkown version number ({num}) and namespace ('{nasp}')"), @@ -198,8 +204,12 @@ impl DbVersion { make_upgrade! {app, Self::Three, Self::Four, "./sql/4_Three_to_Four.sql"} } - // This is the current_version Self::Four => { + make_upgrade! {app, Self::Four, Self::Five, "./sql/5_Four_to_Five.sql"} + } + + // This is the current_version + Self::Five => { assert_eq!(self, CURRENT_VERSION); assert_eq!(self, get_version(app).await?); Ok(()) |