about summary refs log tree commit diff stats
path: root/yt/src/storage/migrate/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--yt/src/storage/migrate/mod.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/yt/src/storage/migrate/mod.rs b/yt/src/storage/migrate/mod.rs
index da6b0be..122170c 100644
--- a/yt/src/storage/migrate/mod.rs
+++ b/yt/src/storage/migrate/mod.rs
@@ -79,8 +79,11 @@ pub enum DbVersion {
 
     /// Introduced: 2025-02-18.
     Two,
+
+    /// Introduced: 2025-03-21.
+    Three,
 }
-const CURRENT_VERSION: DbVersion = DbVersion::Two;
+const CURRENT_VERSION: DbVersion = DbVersion::Three;
 
 async fn add_error_context(
     function: impl Future<Output = Result<()>>,
@@ -130,6 +133,7 @@ impl DbVersion {
             DbVersion::Zero => 0,
             DbVersion::One => 1,
             DbVersion::Two => 2,
+            DbVersion::Three => 3,
 
             DbVersion::Empty => unreachable!("A empty version does not have an associated integer"),
         }
@@ -140,10 +144,12 @@ impl DbVersion {
             (0, "yt") => Ok(DbVersion::Zero),
             (1, "yt") => Ok(DbVersion::One),
             (2, "yt") => Ok(DbVersion::Two),
+            (3, "yt") => Ok(DbVersion::Three),
 
             (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}'"),
 
             (other, "yt") => bail!("Got unkown version for 'yt' namespace: {other}"),
             (num, nasp) => bail!("Got unkown version number ({num}) and namespace ('{nasp}')"),
@@ -169,8 +175,12 @@ impl DbVersion {
                 make_upgrade! {app, Self::One, Self::Two, "./sql/2_One_to_Two.sql"}
             }
 
-            // This is the current_version
             Self::Two => {
+                make_upgrade! {app, Self::Two, Self::Three, "./sql/3_Two_to_Three.sql"}
+            }
+
+            // This is the current_version
+            Self::Three => {
                 assert_eq!(self, CURRENT_VERSION);
                 assert_eq!(self, get_version(app).await?);
                 Ok(())