Skip to content

Commit f643dee

Browse files
committed
Migration fix #1113
1 parent 3c9400e commit f643dee

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

lib/src/db/v1_types.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,13 @@ pub fn propvals_v1_to_v2(propvals: PropValsV1) -> crate::resources::PropVals {
8484
impl From<SubResourceV1> for crate::values::SubResource {
8585
fn from(sub_resource: SubResourceV1) -> Self {
8686
match sub_resource {
87-
SubResourceV1::Resource(_resource) => panic!("ResourceV1 is not supported"),
87+
SubResourceV1::Resource(resource) => {
88+
tracing::warn!(
89+
"Named SubResource found, converting to Subject {}",
90+
resource.subject
91+
);
92+
return Self::Subject(resource.subject);
93+
}
8894
SubResourceV1::Nested(propvals) => Self::Nested(propvals_v1_to_v2(propvals)),
8995
SubResourceV1::Subject(subject) => Self::Subject(subject),
9096
}
@@ -115,8 +121,12 @@ impl From<ValueV1> for crate::values::Value {
115121
crate::db::v1_types::ValueV1::NestedResource(sub_resource_v1) => {
116122
Self::NestedResource(sub_resource_v1.into())
117123
}
118-
crate::db::v1_types::ValueV1::Resource(_resource_v1) => {
119-
panic!("ResourceV1 is not supported")
124+
crate::db::v1_types::ValueV1::Resource(resource_v1) => {
125+
tracing::warn!(
126+
"Named SubResource found, converting to Subject {}",
127+
resource_v1.subject
128+
);
129+
return Self::AtomicUrl(resource_v1.subject);
120130
}
121131
crate::db::v1_types::ValueV1::Boolean(v) => Self::Boolean(v),
122132
crate::db::v1_types::ValueV1::Unsupported(unsupported_value) => {

0 commit comments

Comments
 (0)