Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Remove name field (and remove existing data)
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically committed Jul 2, 2024
1 parent 5148e27 commit 658701a
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 138 deletions.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions migrations/20240701213559_remove-user-names.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE users DROP COLUMN name;
1 change: 0 additions & 1 deletion src/auth/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ where
let user = User {
id: UserId::from(db_user.id),
username: db_user.username,
name: db_user.name,
email: db_user.email,
email_verified: Some(db_user.email_verified),
avatar_url: db_user.avatar_url,
Expand Down
9 changes: 3 additions & 6 deletions src/database/models/user_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ pub struct User {
pub totp_secret: Option<String>,

pub username: String,
pub name: Option<String>,
pub email: Option<String>,
pub email_verified: bool,
pub avatar_url: Option<String>,
Expand All @@ -56,7 +55,7 @@ impl User {
sqlx::query!(
"
INSERT INTO users (
id, username, name, email,
id, username, email,
avatar_url, bio, created,
github_id, discord_id, gitlab_id, google_id, steam_id, microsoft_id,
email_verified, password, paypal_id, paypal_country, paypal_email,
Expand All @@ -66,12 +65,11 @@ impl User {
$1, $2, $3, $4, $5,
$6, $7,
$8, $9, $10, $11, $12, $13,
$14, $15, $16, $17, $18, $19
$14, $15, $16, $17, $18
)
",
self.id as UserId,
&self.username,
self.name.as_ref(),
self.email.as_ref(),
self.avatar_url.as_ref(),
self.bio.as_ref(),
Expand Down Expand Up @@ -164,7 +162,7 @@ impl User {

let users = sqlx::query!(
"
SELECT id, name, email,
SELECT id, email,
avatar_url, username, bio,
created, role, badges,
balance,
Expand All @@ -187,7 +185,6 @@ impl User {
google_id: u.google_id,
steam_id: u.steam_id,
microsoft_id: u.microsoft_id,
name: u.name,
email: u.email,
email_verified: u.email_verified,
avatar_url: u.avatar_url,
Expand Down
2 changes: 1 addition & 1 deletion src/models/v2/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl From<crate::models::v3::users::User> for LegacyUser {
Self {
id: data.id,
username: data.username,
name: data.name,
name: None,
email: data.email,
email_verified: data.email_verified,
avatar_url: data.avatar_url,
Expand Down
2 changes: 0 additions & 2 deletions src/models/v3/users.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ impl Default for Badges {
pub struct User {
pub id: UserId,
pub username: String,
pub name: Option<String>,
pub avatar_url: Option<String>,
pub bio: Option<String>,
pub created: DateTime<Utc>,
Expand Down Expand Up @@ -73,7 +72,6 @@ impl From<DBUser> for User {
Self {
id: data.id.into(),
username: data.username,
name: data.name,
email: None,
email_verified: None,
avatar_url: data.avatar_url,
Expand Down
4 changes: 2 additions & 2 deletions src/queue/payouts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ impl PayoutsQueue {
pub id: String,
pub category: String,
pub name: String,
pub description: String,
pub disclosure: String,
// pub description: String,
// pub disclosure: String,
pub skus: Vec<Sku>,
pub currency_codes: Vec<String>,
pub countries: Vec<ProductCountry>,
Expand Down
Loading

0 comments on commit 658701a

Please sign in to comment.