Skip to content

[8.x] Write the generated evolution script to absolute evolution paths, and explain projects without Play's layout - #932

Merged
mkurz merged 2 commits into
playframework:8.xfrom
mkurz:evolutions-absolute-path-8.x
Oct 13, 2026
Merged

mkurz merged 2 commits into
playframework:8.xfrom
mkurz:evolutions-absolute-path-8.x

Conversation

@mkurz

@mkurz mkurz commented Oct 13, 2026

Copy link
Copy Markdown
Member

mkurz added 2 commits October 13, 2026 12:26
With an absolute `play.evolutions[.db.<name>].path`, Play's evolutions read the scripts from that path as it is, but Play Ebean resolved it relative to the application's root folder, like any other path. So it wrote the script to e.g. `<root>/opt/migrations/default/1.sql` instead of `/opt/migrations/default/1.sql`, where Play didn't find it, and it didn't see a hand-written script there.

Play Ebean now resolves the path like Play's evolutions do. The new test checks for each kind of path that Play applies the generated script, and that a hand-written script in an absolute folder stays untouched.
…ay's layout

Play Ebean follows the location of the evolution scripts that Play's evolutions use. In a project that disables Play's layout, Play still looks for the scripts in `conf` first, but doesn't package that folder, so the generated script is missing in production, and it takes precedence over the user's script in `src/main/resources` in dev and test mode. The docs show how to generate the script into the resources instead, or to turn off generating it.
@mergify

mergify Bot commented Oct 13, 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 2130438 into playframework:8.x Oct 13, 2026
21 checks passed
@mkurz
mkurz deleted the evolutions-absolute-path-8.x branch October 13, 2026 11:20
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