summaryrefslogtreecommitdiff
path: root/src/login/repo.rs
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-10-30 01:25:04 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-10-30 01:25:04 -0400
commit70591c5ac10069a4ae649bd6f79d769da9e32a98 (patch)
treef9a4d155275975e4f37e063f331b7697f5c3cb07 /src/login/repo.rs
parentffba911ba5240f67cc616b2cc2eaf7c730ebbde8 (diff)
Remove `hi-recanonicalize`.
This utility was needed to support a database migration with existing data. I have it on good authority that no further databases exist that are in the state that made this tool necessary.
Diffstat (limited to 'src/login/repo.rs')
-rw-r--r--src/login/repo.rs32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/login/repo.rs b/src/login/repo.rs
index a972304..9439a25 100644
--- a/src/login/repo.rs
+++ b/src/login/repo.rs
@@ -143,38 +143,6 @@ impl<'c> Logins<'c> {
Ok(logins)
}
-
- pub async fn recanonicalize(&mut self) -> Result<(), sqlx::Error> {
- let logins = sqlx::query!(
- r#"
- select
- id as "id: Id",
- display_name as "display_name: String"
- from login
- "#,
- )
- .fetch_all(&mut *self.0)
- .await?;
-
- for login in logins {
- let name = Name::from(login.display_name);
- let canonical_name = name.canonical();
-
- sqlx::query!(
- r#"
- update login
- set canonical_name = $1
- where id = $2
- "#,
- canonical_name,
- login.id,
- )
- .execute(&mut *self.0)
- .await?;
- }
-
- Ok(())
- }
}
#[derive(Debug, thiserror::Error)]