Skip to content

Commit

Permalink
Merge pull request ubccr#1886 from eiffel777/update-log-table-fix
Browse files Browse the repository at this point in the history
Update log table sql migration query to be more efficient
  • Loading branch information
eiffel777 authored Aug 2, 2024
2 parents 3305981 + 752d667 commit 86d915c
Showing 1 changed file with 1 addition and 4 deletions.
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

0 comments on commit 86d915c

Please sign in to comment.