db to user_id
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 40s

This commit is contained in:
2025-11-24 11:54:06 -08:00
parent 11049b3c6b
commit 1c08d2dab1
31 changed files with 868 additions and 854 deletions

View File

@@ -30,7 +30,7 @@ logger.info(` Database: ${process.env.DB_DATABASE}`);
// Query the users table to see what the server process sees on startup.
// Corrected the query to be unambiguous by specifying the table alias for each column.
// `id` and `email` come from the `users` table (u), and `role` comes from the `profiles` table (p).
getPool().query('SELECT u.id, u.email, p.role FROM public.users u JOIN public.profiles p ON u.id = p.id')
getPool().query('SELECT u.user_id, u.email, p.role FROM public.users u JOIN public.profiles p ON u.user_id = p.user_id')
.then(res => {
logger.debug('[SERVER PROCESS] Users found in DB on startup:');
console.table(res.rows);
@@ -71,7 +71,7 @@ const requestLogger = (req: Request, res: Response, next: NextFunction) => {
const user = req.user as { id?: string } | undefined;
const durationInMilliseconds = getDurationInMilliseconds(start);
const { statusCode } = res;
const userIdentifier = user?.id ? ` (User: ${user.id})` : '';
const userIdentifier = user?.user_id ? ` (User: ${user.user_id})` : '';
const logMessage = `${method} ${originalUrl} ${statusCode} ${durationInMilliseconds.toFixed(2)}ms${userIdentifier}`;