Skip to content

Commit

Permalink
nicer logs
Browse files Browse the repository at this point in the history
  • Loading branch information
fuziontech committed Mar 28, 2024
1 parent ed6d9f3 commit 7ffb53e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions posthog/management/commands/test_ch_migrations_are_safe.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ def run_and_check_migration(new_migration):
old_migrations.sort()

for index, name in old_migrations:
logger.warn(f"old ClickHouse migration with index {index} and name {name} found")
logger.info(f"old ClickHouse migration with index {index} and name {name} found")

try:
should_fail = False
app, index, name = re.findall(
r"([a-z]+)\/clickhouse\/migrations\/([0-9]+)_([a-zA-Z_0-9]+)\.py", new_migration
)[0]
logger.warn(f"new ClickHouse migration for app {app} with index {index} and name {name} found")
logger.info(f"new ClickHouse migration for app {app} with index {index} and name {name} found")

matching_migration_indexes = []
for old_index, old_name in old_migrations:
Expand All @@ -52,6 +52,7 @@ def run_and_check_migration(new_migration):
logger.error("Colliding migrations are:")
for old_index, old_name in matching_migration_indexes:
logger.error(f" - {old_index}_{old_name}")
logger.error(f" - {index}_{name}")
logger.error(
"Please manually resolve this conflict and ensure all migrations are monotonically increasing"
)
Expand Down

0 comments on commit 7ffb53e

Please sign in to comment.