/** * Converts the given database to a Scala database * @return the database for scala API. * @deprecated As of release 2.6.0. Use {@link #asScala()} */ @Deprecated public default play.api.db.Database toScala() { return asScala(); }
/** * Apply evolutions for the given database. * * @param database The database to apply the evolutions to. * @param reader The reader to read the evolutions. * @param autocommit Whether autocommit should be used. * @param schema The schema where all the play evolution tables are saved in */ public static void applyEvolutions(Database database, play.api.db.evolutions.EvolutionsReader reader, boolean autocommit, String schema) { DatabaseEvolutions evolutions = new DatabaseEvolutions(database.asScala(), schema); evolutions.evolve(evolutions.scripts(reader), autocommit); }
/** * Cleanup evolutions for the given database. * * This will run the down scripts for all the applied evolutions. * * @param database The database to apply the evolutions to. * @param autocommit Whether autocommit should be used. * @param schema The schema where all the play evolution tables are saved in */ public static void cleanupEvolutions(Database database, boolean autocommit, String schema) { DatabaseEvolutions evolutions = new DatabaseEvolutions(database.asScala(), schema); evolutions.evolve(evolutions.resetScripts(), autocommit); }