Skip to content

Allow disabling Play's EvolutionsModule - #905

Merged
mkurz merged 1 commit into
playframework:mainfrom
mkurz:ebean-without-evolutions-module
Oct 8, 2026
Merged

mkurz merged 1 commit into
playframework:mainfrom
mkurz:ebean-without-evolutions-module

Conversation

@mkurz

@mkurz mkurz commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Play Ebean failed to start with Play's evolutions module disabled, e.g. via:

play.modules.disabled += "play.api.db.evolutions.EvolutionsModule"
No implementation for EvolutionsConfig was bound

That's because EbeanDynamicEvolutions required an injected EvolutionsConfig, which only that module binds. (play.evolutions.enabled = false worked, as it keeps the module.)

Now EbeanDynamicEvolutions looks up the EvolutionsConfig from the injector only when generating the evolution scripts, which only happens with the evolutions module enabled. A custom EvolutionsConfig binding still gets respected. The existing public constructor taking an EvolutionsConfig, used e.g. with compile-time DI via EBeanComponents, is kept; the new @Inject constructor takes Play's Injector instead.

Testing

  • New EbeanWithoutEvolutionsModuleTest, which fails without this change with the error above.
  • The existing evolution script generation tests pass, which now look up the EvolutionsConfig through the injector. MiMa passes.

Backports: #907 (8.x), #909 (7.x)

EbeanDynamicEvolutions required an EvolutionsConfig to be injected,
which only Play's EvolutionsModule binds. So with that module disabled,
e.g. via play.modules.disabled += "play.api.db.evolutions.EvolutionsModule",
the application failed to start with "No implementation for
EvolutionsConfig was bound".

Now it looks up the EvolutionsConfig only when generating the evolution
scripts, which only happens with the EvolutionsModule enabled, and
respects any custom binding. The existing public constructor taking an
EvolutionsConfig, used e.g. with compile-time DI, is kept.
@mergify

mergify Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@mkurz
mkurz merged commit 298e2d6 into playframework:main Oct 8, 2026
80 checks passed
@mkurz
mkurz deleted the ebean-without-evolutions-module branch October 8, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant