File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1550,13 +1550,27 @@ fn run_doctor_cli(paths: &auth::CortexPaths) {
15501550 }
15511551 } ;
15521552 if schema_current {
1553- let applied = db:: applied_migration_versions ( & conn)
1554- . map ( |v| v. len ( ) )
1555- . unwrap_or ( 0 ) ;
1553+ let expected_versions: HashSet < & ' static str > = db:: migration_definitions ( )
1554+ . iter ( )
1555+ . map ( |( version, _) | * version)
1556+ . collect ( ) ;
1557+ let ( applied, marker_rows) = db:: applied_migration_versions ( & conn)
1558+ . map ( |versions| {
1559+ let schema_applied = versions
1560+ . iter ( )
1561+ . filter ( |version| expected_versions. contains ( version. as_str ( ) ) )
1562+ . count ( ) ;
1563+ let non_schema_markers = versions. len ( ) . saturating_sub ( schema_applied) ;
1564+ ( schema_applied, non_schema_markers)
1565+ } )
1566+ . unwrap_or ( ( 0 , 0 ) ) ;
15561567 println ! (
15571568 "[doctor] OK schema current: {applied}/{} migrations applied" ,
15581569 db:: migration_definitions( ) . len( )
15591570 ) ;
1571+ if marker_rows > 0 {
1572+ println ! ( "[doctor] INFO schema markers: {marker_rows} non-schema row(s) ignored" ) ;
1573+ }
15601574 } else if !pending_versions. is_empty ( ) {
15611575 println ! (
15621576 "[doctor] FAIL schema pending: {}" ,
You can’t perform that action at this time.
0 commit comments