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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- Backfill: legacy rows had lowercase social_type ('google', 'naver', 'kakao').
-- Current write paths (config/social/*.ts, auth.service.ts) always store uppercase,
-- so this one-shot normalization aligns historical data with the code contract.
UPDATE `User`
SET `social_type` = UPPER(`social_type`)
WHERE `social_type` IN ('google', 'naver', 'kakao');
2 changes: 1 addition & 1 deletion src/stats/services/admin-stats.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const getMemberStats = async (): Promise<MemberStatsResponse> => {
let total = 0;

for (const row of grouped) {
const channel = SOCIAL_TYPE_TO_CHANNEL[row.social_type];
const channel = SOCIAL_TYPE_TO_CHANNEL[row.social_type?.toUpperCase()];
if (!channel) continue;
byChannel[channel].count = row._count._all;
total += row._count._all;
Expand Down
Loading