Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update log table sql migration query to be more efficient #1886

Merged
merged 2 commits into from
Aug 2, 2024
Merged
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
5 changes: 1 addition & 4 deletions configuration/etl/etl_sql.d/migration/cleanup_log_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ UPDATE mod_logger.log_table as lt JOIN (SELECT
FROM mod_logger.log_table as l2
WHERE
l2.ident IN ('rest.logger.db', 'controller.log')
AND l2.priority = 6) AS data JOIN moddb.SessionManager sm ON sm.session_token = data.token JOIN moddb.Users u ON u.id = sm.user_id
AND l2.priority = 6) AS data on data.id = lt.id JOIN moddb.SessionManager sm ON sm.session_token = data.token JOIN moddb.Users u ON u.id = sm.user_id
SET lt.message = JSON_REPLACE(lt.message, '$.data.username', u.username)
WHERE
lt.ident IN ('rest.logger.db', 'controller.log')
AND lt.priority = 6;
//
/* backfill for removing the extra escaping for the other ident types */
UPDATE mod_logger.log_table lt
Expand Down