I have a project in play framework that I would like to have preloaded with some data when the application is first built (after running 'activator run').
From what I understand that used to be achieved by creating a 'initial-data.yml' file in the /conf folder and then having a Bootstrap.java file such as the following:
import play.*;
import play.jobs.*;
import play.test.*;
import models.*;
@OnApplicationStart
public class Bootstrap extends Job {
public void doJob() {
// Check if the database is empty
if(User.count() == 0) {
Fixtures.load("initial-data.yml");
}
}
}
However, that no longer works.
How do I preload data into my project in play framework 2.3.3?