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:
- CodegenSingleton does nothing
CodegenSingleton is executed.
- applicationEvolutions.upToDate == false
- nothing to do...
- 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.
- 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
- 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.
- 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.