Skip to content

Commit bdbd14d

Browse files
committed
HwHostPhase1Slot -> HwM2Slot
1 parent e2f233c commit bdbd14d

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

nexus/db-model/src/inventory.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,26 +160,26 @@ impl From<HwRotSlot> for RotSlot {
160160

161161
// See [`M2Slot`].
162162
impl_enum_type!(
163-
HwHostPhase1SlotEnum:
163+
HwM2SlotEnum:
164164

165165
#[derive(Copy, Clone, Debug, AsExpression, FromSqlRow, PartialEq)]
166-
pub enum HwHostPhase1Slot;
166+
pub enum HwM2Slot;
167167

168168
// Enum values
169169
A => b"A"
170170
B => b"B"
171171
);
172172

173-
impl From<HwHostPhase1Slot> for M2Slot {
174-
fn from(value: HwHostPhase1Slot) -> Self {
173+
impl From<HwM2Slot> for M2Slot {
174+
fn from(value: HwM2Slot) -> Self {
175175
match value {
176-
HwHostPhase1Slot::A => Self::A,
177-
HwHostPhase1Slot::B => Self::B,
176+
HwM2Slot::A => Self::A,
177+
HwM2Slot::B => Self::B,
178178
}
179179
}
180180
}
181181

182-
impl From<M2Slot> for HwHostPhase1Slot {
182+
impl From<M2Slot> for HwM2Slot {
183183
fn from(value: M2Slot) -> Self {
184184
match value {
185185
M2Slot::A => Self::A,
@@ -791,7 +791,7 @@ pub struct InvHostPhase1FlashHash {
791791
pub time_collected: DateTime<Utc>,
792792
pub source: String,
793793

794-
pub slot: HwHostPhase1Slot,
794+
pub slot: HwM2Slot,
795795
pub hash: ArtifactHash,
796796
}
797797

nexus/db-queries/src/db/datastore/inventory.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use nexus_db_errors::ErrorHandler;
3131
use nexus_db_errors::public_error_from_diesel;
3232
use nexus_db_errors::public_error_from_diesel_lookup;
3333
use nexus_db_model::ArtifactHash;
34-
use nexus_db_model::HwHostPhase1Slot;
34+
use nexus_db_model::HwM2Slot;
3535
use nexus_db_model::InvCaboose;
3636
use nexus_db_model::InvClickhouseKeeperMembership;
3737
use nexus_db_model::InvCockroachStatus;
@@ -72,7 +72,7 @@ use nexus_db_model::{
7272
};
7373
use nexus_db_model::{HwPowerState, InvZoneManifestNonBoot};
7474
use nexus_db_model::{HwRotSlot, InvMupdateOverrideNonBoot};
75-
use nexus_db_schema::enums::HwHostPhase1SlotEnum;
75+
use nexus_db_schema::enums::HwM2SlotEnum;
7676
use nexus_db_schema::enums::HwRotSlotEnum;
7777
use nexus_db_schema::enums::RotImageErrorEnum;
7878
use nexus_db_schema::enums::RotPageWhichEnum;
@@ -699,8 +699,8 @@ impl DataStore {
699699
phase1.source
700700
.clone()
701701
.into_sql::<diesel::sql_types::Text>(),
702-
HwHostPhase1Slot::from(phase1.slot)
703-
.into_sql::<HwHostPhase1SlotEnum>(),
702+
HwM2Slot::from(phase1.slot)
703+
.into_sql::<HwM2SlotEnum>(),
704704
ArtifactHash(phase1.hash)
705705
.into_sql::<diesel::sql_types::Text>(),
706706
))

nexus/db-schema/src/enums.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ define_enums! {
3939
DownstairsClientStopRequestReasonEnum => "downstairs_client_stop_request_reason_type",
4040
DownstairsClientStoppedReasonEnum => "downstairs_client_stopped_reason_type",
4141
FailureDomainEnum => "failure_domain",
42-
HwHostPhase1SlotEnum => "hw_host_phase_1_slot",
42+
HwM2SlotEnum => "hw_m2_slot",
4343
HwPowerStateEnum => "hw_power_state",
4444
HwRotSlotEnum => "hw_rot_slot",
4545
IdentityProviderTypeEnum => "provider_type",

nexus/db-schema/src/schema.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ table! {
15641564
time_collected -> Timestamptz,
15651565
source -> Text,
15661566

1567-
slot -> crate::enums::HwHostPhase1SlotEnum,
1567+
slot -> crate::enums::HwM2SlotEnum,
15681568
hash -> Text,
15691569
}
15701570
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CREATE TYPE IF NOT EXISTS omicron.public.hw_host_phase_1_slot AS ENUM (
1+
CREATE TYPE IF NOT EXISTS omicron.public.hw_m2_slot AS ENUM (
22
'A',
33
'B'
44
);

schema/crdb/add-inv-host-phase-1-flash-hash/up2.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ CREATE TABLE IF NOT EXISTS omicron.public.inv_host_phase_1_flash_hash (
33
hw_baseboard_id UUID NOT NULL,
44
time_collected TIMESTAMPTZ NOT NULL,
55
source TEXT NOT NULL,
6-
slot omicron.public.hw_host_phase_1_slot NOT NULL,
6+
slot omicron.public.hw_m2_slot NOT NULL,
77
hash STRING(64) NOT NULL,
88
PRIMARY KEY (inv_collection_id, hw_baseboard_id, slot)
99
);

schema/crdb/dbinit.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3506,7 +3506,7 @@ CREATE TABLE IF NOT EXISTS omicron.public.inv_root_of_trust (
35063506
);
35073507

35083508
-- host phase 1 slots
3509-
CREATE TYPE IF NOT EXISTS omicron.public.hw_host_phase_1_slot AS ENUM (
3509+
CREATE TYPE IF NOT EXISTS omicron.public.hw_m2_slot AS ENUM (
35103510
'A',
35113511
'B'
35123512
);
@@ -3527,7 +3527,7 @@ CREATE TABLE IF NOT EXISTS omicron.public.inv_host_phase_1_flash_hash (
35273527
source TEXT NOT NULL,
35283528

35293529
-- phase 1 slot for this hash
3530-
slot omicron.public.hw_host_phase_1_slot NOT NULL,
3530+
slot omicron.public.hw_m2_slot NOT NULL,
35313531
-- the actual hash of the contents
35323532
hash STRING(64) NOT NULL,
35333533

0 commit comments

Comments
 (0)