# 벤더 설정 — 사건을 기록한 javadoc /** * The vendor's migration location, as a default rather than as an override. * *

This unconditionally called {@code locations(...)}, which replaces whatever Spring bound * from {@code spring.flyway.locations}. An operator could therefore set {@code * SPRING_FLYWAY_LOCATIONS} to add the capability streams, watch Flyway report a successful * migration, and get only the vendor stream — the property was read, bound, and then discarded by * a customizer that runs after it. The {@code local-notification-ingest} lane set seven locations * and applied one. * *

It is the same shape as {@code application-local.yml}'s literal pins, which outranked every * environment a caller supplied, and the same fix: contribute the value when nobody has chosen * one, and stay out of the way when somebody has. A deployment that names its own locations is * responsible for including this one, which is exactly the responsibility it took by naming them. * * @param environment the resolved environment, consulted for an operator-supplied value * @return the customizer */ # 벤더 설정 — 지금 구현 @Bean public static FlywayConfigurationCustomizer postgreSqlFlywayLocationCustomizer( org.springframework.core.env.Environment environment) { return configuration -> { String chosen = environment.getProperty("spring.flyway.locations", "").trim(); if (chosen.isEmpty()) { configuration.locations("classpath:db/migration/postgresql"); } }; } # 같은 빈 이름을 쓰는 sample 쪽 — 아직 무조건 호출 * {@code static @Bean} (called without instantiating the owning class, so no * {@code @PersistenceContext} injection during Flyway init). Sets both migration locations: * production {@code db/migration/postgresql} + sample {@code db/sample-migration}. {@code * locations(...)} replaces rather than appends, so this — not {@code spring.flyway.locations} in * application.yml — is the effective source of truth. See README. */ @Bean public static FlywayConfigurationCustomizer postgreSqlFlywayLocationCustomizer() { return configuration -> configuration.locations( "classpath:db/migration/postgresql", "classpath:db/sample-migration"); } # H2 쪽은 커스터마이저를 아예 두지 않는다 21: *

No Flyway location customizer, deliberately. The PostgreSQL vendor points Flyway at