diff options
author | Alex <alex@adnab.me> | 2024-03-08 13:43:42 +0000 |
---|---|---|
committer | Alex <alex@adnab.me> | 2024-03-08 13:43:42 +0000 |
commit | 2128b5febd97eb6c95e3bdd380dcba39b860c0e3 (patch) | |
tree | f37726dda012541cf8f2be81a0197fdf0b889a8b /src/model/s3/object_table.rs | |
parent | 1ace34adbb05bb10cf7a2c8d0d2b84769ca797df (diff) | |
parent | f537f76681760e9b2b3cc095a6031ebb59ca4733 (diff) | |
download | garage-2128b5febd97eb6c95e3bdd380dcba39b860c0e3.tar.gz garage-2128b5febd97eb6c95e3bdd380dcba39b860c0e3.zip |
Merge pull request 'Remove migration path from Garage v0.5' (#766) from rm-migration into next-0.10
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/766
Diffstat (limited to 'src/model/s3/object_table.rs')
-rw-r--r-- | src/model/s3/object_table.rs | 43 |
1 files changed, 2 insertions, 41 deletions
diff --git a/src/model/s3/object_table.rs b/src/model/s3/object_table.rs index f2d21493..eedb9615 100644 --- a/src/model/s3/object_table.rs +++ b/src/model/s3/object_table.rs @@ -17,7 +17,7 @@ pub const OBJECTS: &str = "objects"; pub const UNFINISHED_UPLOADS: &str = "unfinished_uploads"; pub const BYTES: &str = "bytes"; -mod v05 { +mod v08 { use garage_util::data::{Hash, Uuid}; use serde::{Deserialize, Serialize}; use std::collections::BTreeMap; @@ -26,7 +26,7 @@ mod v05 { #[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)] pub struct Object { /// The bucket in which the object is stored, used as partition key - pub bucket: String, + pub bucket_id: Uuid, /// The key at which the object is stored in its bucket, used as sorting key pub key: String, @@ -92,45 +92,6 @@ mod v05 { impl garage_util::migrate::InitialFormat for Object {} } -mod v08 { - use garage_util::data::Uuid; - use serde::{Deserialize, Serialize}; - - use super::v05; - - pub use v05::{ - ObjectVersion, ObjectVersionData, ObjectVersionHeaders, ObjectVersionMeta, - ObjectVersionState, - }; - - /// An object - #[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)] - pub struct Object { - /// The bucket in which the object is stored, used as partition key - pub bucket_id: Uuid, - - /// The key at which the object is stored in its bucket, used as sorting key - pub key: String, - - /// The list of currenty stored versions of the object - pub(super) versions: Vec<ObjectVersion>, - } - - impl garage_util::migrate::Migrate for Object { - type Previous = v05::Object; - - fn migrate(old: v05::Object) -> Object { - use garage_util::data::blake2sum; - - Object { - bucket_id: blake2sum(old.bucket.as_bytes()), - key: old.key, - versions: old.versions, - } - } - } -} - mod v09 { use garage_util::data::Uuid; use serde::{Deserialize, Serialize}; |