Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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

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

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

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

2 changes: 2 additions & 0 deletions apps/labrinth/fixtures/labrinth-seed-data-202508052143.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1104,5 +1104,7 @@ COPY public.users (id, github_id, username, email, avatar_url, bio, created, rol
103587649610509 \N Default admin user admin@modrinth.invalid https://avatars.githubusercontent.com/u/106493074 $ chmod 777 labrinth 2020-07-18 16:03:00.000000+00 admin 0 0.00000000000000000000 \N \N \N \N \N $argon2i$v=19$m=4096,t=3,p=1$c2FsdEl0V2l0aFNhbHQ$xTGvQNICqetaNA0Wu1GwFmYhQjAreRcjBz6ornhaFXA t \N \N \N \N \N \N https://avatars.githubusercontent.com/u/106493074 t
\.

INSERT INTO sessions (id, session, user_id, created, last_login, expires, refresh_expires, city, country, ip, os, platform, user_agent)
VALUES (93083445641246, 'mra_admin', 103587649610509, '2025-10-20 14:58:53.128901+00', '2025-10-20 14:58:53.128901+00', '2025-11-03 14:58:53.128901+00', '2025-12-19 14:58:53.128901+00', '', '', '127.0.0.1', 'Linux', 'Chrome', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36');

COMMIT;
40 changes: 40 additions & 0 deletions apps/labrinth/src/database/models/user_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,46 @@ impl DBUser {
.execute(&mut **transaction)
.await?;

sqlx::query!(
"
UPDATE affiliate_codes
SET created_by = $1
WHERE created_by = $2",
deleted_user as DBUserId,
id as DBUserId,
)
.execute(&mut **transaction)
.await?;

sqlx::query!(
"
DELETE FROM affiliate_codes
WHERE affiliate = $1",
id as DBUserId,
)
.execute(&mut **transaction)
.await?;

sqlx::query!(
"
UPDATE payouts_values
SET user_id = $1
WHERE user_id = $2",
deleted_user as DBUserId,
id as DBUserId,
)
.execute(&mut **transaction)
.await?;

sqlx::query!(
"
DELETE FROM payouts_values_notifications
WHERE user_id = $1",
id as DBUserId,
)
.execute(&mut **transaction)
.await?;

let open_subscriptions =
DBUserSubscription::get_all_user(id, &mut **transaction)
.await?;
Expand Down