diff --git a/nexus/db-model/src/inventory.rs b/nexus/db-model/src/inventory.rs index 7f1e160d46..0a903e817e 100644 --- a/nexus/db-model/src/inventory.rs +++ b/nexus/db-model/src/inventory.rs @@ -21,7 +21,7 @@ impl_enum_type!( pub struct HwPowerStateEnum; #[derive(Copy, Clone, Debug, AsExpression, FromSqlRow, PartialEq)] - #[diesel(sql_type = HwRotSlotEnum)] + #[diesel(sql_type = HwPowerStateEnum)] pub enum HwPowerState; // Enum values diff --git a/nexus/db-queries/src/db/datastore/inventory.rs b/nexus/db-queries/src/db/datastore/inventory.rs index cf42f2cc2a..910d4d5f49 100644 --- a/nexus/db-queries/src/db/datastore/inventory.rs +++ b/nexus/db-queries/src/db/datastore/inventory.rs @@ -115,15 +115,19 @@ impl DataStore { baseboard_dsl::id, sp.time_collected .into_sql::(), - sp.source.into_sql::(), + sp.source + .clone() + .into_sql::(), i64::from(sp.baseboard_revision) .into_sql::(), sp.hubris_archive + .clone() .into_sql::(), - HwPowerState::from(sp.power_state).into_sql(), + HwPowerState::from(sp.power_state) + .into_sql::(), )); - diesel::insert_into( + let _ = diesel::insert_into( db::schema::inv_service_processor::table, ) .values(selection) diff --git a/nexus/inventory/src/builder.rs b/nexus/inventory/src/builder.rs index e52f1b77c8..1c19f0a987 100644 --- a/nexus/inventory/src/builder.rs +++ b/nexus/inventory/src/builder.rs @@ -84,6 +84,7 @@ impl CollectionBuilder { baseboard: baseboard.clone(), time_collected: Utc::now(), source: source.to_owned(), + baseboard_revision: sp_state.revision, hubris_archive: sp_state.hubris_archive_id, power_state: sp_state.power_state, rot,