aboutsummaryrefslogtreecommitdiff
path: root/src/model/key_table.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-03-10 16:38:31 +0100
committerAlex Auvolat <alex@adnab.me>2021-03-10 16:38:31 +0100
commit445912dc6a3b65d0726b9378b3542b4061272cf4 (patch)
treebf1ac419b305254b71b9e17857f1e926ef6c2844 /src/model/key_table.rs
parent0fd7df8fa0741caa622b2bae979aac867f443154 (diff)
downloadgarage-445912dc6a3b65d0726b9378b3542b4061272cf4.tar.gz
garage-445912dc6a3b65d0726b9378b3542b4061272cf4.zip
Remove migration paths from 0.1 branch
Diffstat (limited to 'src/model/key_table.rs')
-rw-r--r--src/model/key_table.rs28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/model/key_table.rs b/src/model/key_table.rs
index 6d8cc6c0..b4ab65b6 100644
--- a/src/model/key_table.rs
+++ b/src/model/key_table.rs
@@ -3,8 +3,6 @@ use serde::{Deserialize, Serialize};
use garage_table::crdt::*;
use garage_table::*;
-use model010::key_table as prev;
-
#[derive(PartialEq, Clone, Debug, Serialize, Deserialize)]
pub struct Key {
// Primary key
@@ -103,30 +101,4 @@ impl TableSchema for KeyTable {
fn matches_filter(entry: &Self::E, filter: &Self::Filter) -> bool {
filter.apply(entry.deleted.get())
}
-
- fn try_migrate(bytes: &[u8]) -> Option<Self::E> {
- let old = match rmp_serde::decode::from_read_ref::<_, prev::Key>(bytes) {
- Ok(x) => x,
- Err(_) => return None,
- };
- let mut new = Self::E {
- key_id: old.key_id.clone(),
- secret_key: old.secret_key.clone(),
- name: crdt::LWW::migrate_from_raw(old.name_timestamp, old.name.clone()),
- deleted: crdt::Bool::new(old.deleted),
- authorized_buckets: crdt::LWWMap::new(),
- };
- for ab in old.authorized_buckets() {
- let it = crdt::LWWMap::migrate_from_raw_item(
- ab.bucket.clone(),
- ab.timestamp,
- PermissionSet {
- allow_read: ab.allow_read,
- allow_write: ab.allow_write,
- },
- );
- new.authorized_buckets.merge(&it);
- }
- Some(new)
- }
}