@startuml
title Before: Auth Tables Ignore Configured Schema Mapping
skinparam backgroundColor #FAFAFA
skinparam componentStyle rectangle
skinparam defaultFontName Consolas

package "Config" #E8F1FF {
  component "config.yaml\nmultitenancy.schema_mapping\n(users/sessions aliases only)" as cfg
}

package "Server Runtime" #FFF4E6 {
  component "ParsedMultiTenancyConfig\n(default_schema_mapping)" as parsed
  component "build_sqlx_adapter(search_path)" as build
  component "SqlxAdapter\n(no auth_schema field)" as adapter
}

package "SQL Execution" #FFE8E8 {
  component "Auth meta queries\nINSERT/SELECT ... FROM users" as meta
  component "Internal queries\nFROM ip_profiles / emails / admin_audit_logs" as internal
}

database "PostgreSQL" as db

cfg --> parsed : parse schema_mapping
parsed --> build : tenant runtime
build --> adapter : pool only
adapter --> meta : unqualified table names
adapter --> internal : hardcoded table names
meta --> db
internal --> db

note bottom of adapter
Schema mapping diagnostics exist,
but runtime SQL does not apply
a global auth schema target.
end note
@enduml
