Skip to content

Commit 76450a8

Browse files
fix db field typo
1 parent cec9ea0 commit 76450a8

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

mobile_verifier/migrations/38_radio_location_estimates.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ CREATE TABLE IF NOT EXISTS radio_location_estimates (
66
hex BIGINT NOT NULL,
77
grid_distance BIGINT NOT NULL,
88
confidence DECIMAL NOT NULL,
9-
invalided_at TIMESTAMPTZ DEFAULT NULL,
9+
invalidated_at TIMESTAMPTZ DEFAULT NULL,
1010
inserted_at TIMESTAMPTZ DEFAULT now(),
1111
PRIMARY KEY (hashed_key)
12-
);
12+
);

mobile_verifier/src/radio_location_estimates.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ async fn invalidate_old_estimates(
216216
sqlx::query(
217217
r#"
218218
UPDATE radio_location_estimates
219-
SET invalided_at = now()
219+
SET invalidated_at = now()
220220
WHERE radio_key = $1
221221
AND received_timestamp < $2;
222222
"#,
@@ -284,8 +284,8 @@ pub async fn clear_invalided(
284284
sqlx::query(
285285
r#"
286286
DELETE FROM radio_location_estimates
287-
WHERE invalided_at IS NOT NULL
288-
AND invalided_at < $1
287+
WHERE invalidated_at IS NOT NULL
288+
AND invalidated_at < $1
289289
"#,
290290
)
291291
.bind(timestamp)
@@ -305,7 +305,7 @@ pub async fn clear_invalided(
305305
// FROM radio_location_estimates
306306
// WHERE radio_key = $1
307307
// AND confidence >= $2
308-
// AND invalided_at IS NULL
308+
// AND invalidated_at IS NULL
309309
// ORDER BY radius DESC, confidence DESC
310310
// "#,
311311
// )

mobile_verifier/tests/integrations/radio_location_estimates.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ fn compare_report_and_estimate(
190190
assert_eq!(report.report.estimates[0].confidence, estimate.confidence);
191191

192192
if should_be_valid {
193-
assert!(estimate.invalided_at.is_none());
193+
assert!(estimate.invalidated_at.is_none());
194194
} else {
195-
assert!(estimate.invalided_at.is_some());
195+
assert!(estimate.invalidated_at.is_some());
196196
}
197197
}
198198

@@ -204,7 +204,7 @@ pub struct RadioLocationEstimateDB {
204204
pub hex: CellIndex,
205205
pub grid_distance: u32,
206206
pub confidence: rust_decimal::Decimal,
207-
pub invalided_at: Option<DateTime<Utc>>,
207+
pub invalidated_at: Option<DateTime<Utc>>,
208208
}
209209

210210
pub async fn select_radio_location_estimates(
@@ -232,7 +232,7 @@ pub async fn select_radio_location_estimates(
232232
hex,
233233
grid_distance: row.get::<i64, _>("grid_distance") as u32,
234234
confidence: row.get("confidence"),
235-
invalided_at: row.try_get("invalided_at").ok(),
235+
invalidated_at: row.try_get("invalidated_at").ok(),
236236
}
237237
})
238238
.collect();

0 commit comments

Comments
 (0)