Skip to content

Commit

Permalink
fix(migration): Do not emit log output for checker_id normalisation
Browse files Browse the repository at this point in the history
In case a new product is added to an empty server, what happens in the
background is a full "migration" from the "empty" state to the newest
schema, which results in the log output that is removed by this patch on
the standard output of the server.

These lines are not directly needed, but there is no good reason to hide
them behind an `if len(...):` check either. In case actual rows are
migrated (which never happens when a new product is added to the
server), the appropriate output showing the row count of the `UPDATE`
statement will be printed to the output normally.
  • Loading branch information
whisperity committed Mar 25, 2024
1 parent 3cfb1c2 commit 386f9ae
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ def normalise_report_analyzer_and_checker_names():
# These values are normalised such that in the following, when the
# foreign key-based look-up is added to the schema, their new
# 'checker_id' will all point to the single "UNKNOWN/NOT FOUND" case.
LOG.info("Normalising unknowns in 'reports'.'analyzer_name' and "
"'reports'.'checker_id'...")

analyzer_name_affected = conn.execute(f"""
UPDATE reports
SET analyzer_name = '{UnknownChecker[0]}'
Expand Down Expand Up @@ -93,8 +90,6 @@ def normalise_report_analyzer_and_checker_names():
conn.execute("COMMIT;")
conn.execute("START TRANSACTION;")

LOG.info("Done normalising 'reports'.")

def create_new_tables():
op.create_table(
"checkers",
Expand Down

0 comments on commit 386f9ae

Please sign in to comment.