in src/dma/collector/workflows/readiness_check/_postgres/main.py [0:0]
def _print_readiness_check_summary(self) -> None:
"""Print Summary of the Migration Readiness Assessment."""
db_variants: list[PostgresVariants] = [ALLOYDB, CLOUDSQL]
def table_for_target(migration_target: PostgresVariants) -> None:
results = self.local_db.execute(
"select severity, rule_code, info from readiness_check_summary where migration_target = ? ORDER BY severity, rule_code",
[migration_target],
).fetchall()
count_table = Table(
min_width=80, title=f"{migration_target} Compatibility", leading=5, title_justify="left"
)
count_table.add_column("Severity", justify="right", overflow="fold")
count_table.add_column("Rule Code", justify="left", overflow="fold")
count_table.add_column("Info", justify="left", overflow="fold")
for row in results:
count_table.add_row(
f"[bold green]{row[0]}[/]"
if row[0] == PASS
else f"[bold yellow]{row[0]}[/]"
if row[0] == WARNING
else f"[bold red]{row[0]}[/]",
f"[bold]{row[1]}[/]",
row[2],
)
self.console.print("\n")
self.console.print(count_table)
if migration_target == ALLOYDB:
self.console.print(
"Please refer to the Alloy DB documentation for more details: https://cloud.google.com/database-migration/docs/postgresql-to-alloydb/configure-source-database"
)
if migration_target == CLOUDSQL:
self.console.print(
"Please refer to the CloudSQL documentation for more details: https://cloud.google.com/database-migration/docs/postgres/configure-source-database",
markup=True,
)
for v in db_variants:
table_for_target(v)