@startuml
title Before: Self-Heal Ensures Only The Runtime Auth Schema
skinparam backgroundColor #FFFFFF
skinparam defaultFontColor #000000
skinparam ArrowColor #1F2937
skinparam componentStyle rectangle
skinparam defaultFontName Consolas

actor "Server Startup" as startup
component "ensure_auth_schema_provisioned(auth_schema)" as ensure #FFEAEA
component "CREATE SCHEMA IF NOT EXISTS\n<auth_schema>" as create_auth #FFF4E6
component "SET LOCAL search_path\nTO <auth_schema>" as set_path #EAF2FF
component "apply sql/provision.sql\n(rewritten to <auth_schema>)" as provision #EAF2FF
database "PostgreSQL" as db #FFFCEB

startup --> ensure
ensure --> create_auth
create_auth --> db
ensure --> set_path
set_path --> db
ensure --> provision
provision --> db

note right of db #FFF2F2
If auth_schema != athena,
the base athena schema might stay missing.
Then athena-qualified runtime paths cannot bootstrap correctly.
end note
@enduml
