Skip to content

funkrusher/play-execute-codegen-after-evolutions-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example project showing the possibility of Executing Slick-Codegen directly after the User Approved the Play-Evolutions successfully in the Webbrowser-UI of Play-Evolutions (by clicking the button "Approve Evolutions")

This can help to auto-generate models for database-changes in the local development.

--

when the app is started it works as follows:

  1. CodegenSingleton does nothing

CodegenSingleton is executed.

  • applicationEvolutions.upToDate == false
  • nothing to do...
  1. Play-Evolutions UI in Webbrowser Shows up

The Webbrowser-UI for the Play-Evolutions show up

  • The user clicks the "Apply Evolutions" button
  • After the Evolutions have been applied successfully by the Framework the App is restarted on the fly automatically.
  1. CodegenSingleton is called

CodegenSingleton is executed now again

  • applicationEvolutions.upToDate == true
  • Slick-Codegen is applied and the autogenerated models will be created in the "app/tables" folder in the project.
  • Play-Compiler will be triggered by the new/changed files in "app/tables" and will compile them on the fly automatically
  • Webbrowser is now clear/finished and app is running
  1. User is now shown errors for models/files if there are code-breaking changes by the new/changed autogenerated classes

if there have been changes in the autogenerated models the user now will see those errors and can fix his code accordingly.

  1. User changes/creates a new evolution-file in "conf/evolutions/*"

If the user changes or creates an evolution-file in "conf/evolutions/*" and calls the webbrowser (localhost:9000 for example) we will continue via chapter "2. Play-Evolutions UI in Webbrowser Shows up" again, and it will continue as before.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages