From 7e50c000dc8e2979ae73daf667e076c71ec53e52 Mon Sep 17 00:00:00 2001 From: asepharyana Date: Wed, 2 Sep 2026 00:17:54 +0700 Subject: [PATCH] fix(backend): remove dead user_reputations schema (table + type aliases) Follow-up to d0453881: the pgUserReputationsTable definition and the UserReputation/UserReputationInsert type aliases were the only remaining references to the removed user reputation feature. Nothing imports them (verified via grep across src/ + tests/), so they're pure dead code that could mislead future devs into re-joining a dropped table. Railed out to close the 42P01 failure class completely. --- .../backend/src/shared/database/schema.ts | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/services/backend/src/shared/database/schema.ts b/services/backend/src/shared/database/schema.ts index 58554435..12788d15 100644 --- a/services/backend/src/shared/database/schema.ts +++ b/services/backend/src/shared/database/schema.ts @@ -337,32 +337,6 @@ export const pgUserProfilesTable = pgTable( export const userProfilesTable = pgUserProfilesTable; -/** - * User Reputations Table (PostgreSQL) - * Tracks user trust score and infractions to provide context to AI. - */ -export const pgUserReputationsTable = pgTable( - "user_reputations", - { - user_id: pgText("user_id").primaryKey(), - guild_id: pgText("guild_id").notNull(), - trust_score: pgInteger("trust_score").notNull().default(50), - clean_message_streak: pgInteger("clean_message_streak") - .notNull() - .default(0), - total_infractions: pgInteger("total_infractions").notNull().default(0), - last_infraction_at: pgBigint("last_infraction_at", { mode: "number" }), - created_at: pgBigint("created_at", { mode: "number" }).notNull(), - updated_at: pgBigint("updated_at", { mode: "number" }).notNull(), - }, - (table) => ({ - guildIdx: pgIndex("idx_user_reputations_guild_id").on(table.guild_id), - scoreIdx: pgIndex("idx_user_reputations_trust_score").on(table.trust_score), - }), -); - -export const userReputationsTable = pgUserReputationsTable; - /** * Channel Cultures Table (PostgreSQL) * Stores AI-generated summaries of channel norms and slang to inject as context. @@ -563,10 +537,6 @@ export type AIAnalysisRunInsert = typeof aiAnalysisRunsTable.$inferInsert; export type UserProfile = typeof userProfilesTable.$inferSelect; export type UserProfileInsert = typeof userProfilesTable.$inferInsert; -// User Reputations -export type UserReputation = typeof userReputationsTable.$inferSelect; -export type UserReputationInsert = typeof userReputationsTable.$inferInsert; - // Channel Cultures export type ChannelCulture = typeof channelCulturesTable.$inferSelect; export type ChannelCultureInsert = typeof channelCulturesTable.$inferInsert;