Skip to content

[7.x] Allow disabling Play's EvolutionsModule - #909

Merged
mkurz merged 1 commit into
playframework:7.xfrom
mkurz:ebean-without-evolutions-module-7.x
Oct 8, 2026
Merged

mkurz merged 1 commit into
playframework:7.xfrom
mkurz:ebean-without-evolutions-module-7.x

Conversation

@mkurz

@mkurz mkurz commented Oct 8, 2026

Copy link
Copy Markdown
Member

Backport of #905 to 7.x.

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.

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 1ba907c into playframework:7.x Oct 8, 2026
21 checks passed
@mkurz
mkurz deleted the ebean-without-evolutions-module-7.x 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