public class Evolutions extends Object
Constructor and Description |
---|
Evolutions() |
Modifier and Type | Method and Description |
---|---|
static void |
applyEvolutions(Database database)
Apply evolutions for the given database.
|
static void |
applyEvolutions(Database database,
play.api.db.evolutions.EvolutionsReader reader)
Apply evolutions for the given database.
|
static void |
applyEvolutions(Database database,
play.api.db.evolutions.EvolutionsReader reader,
boolean autocommit)
Apply evolutions for the given database.
|
static void |
applyEvolutions(Database database,
play.api.db.evolutions.EvolutionsReader reader,
boolean autocommit,
String schema)
Apply evolutions for the given database.
|
static void |
applyEvolutions(Database database,
play.api.db.evolutions.EvolutionsReader reader,
String schema)
Apply evolutions for the given database.
|
static void |
applyEvolutions(Database database,
String schema)
Apply evolutions for the given database.
|
static void |
cleanupEvolutions(Database database)
Cleanup evolutions for the given database.
|
static void |
cleanupEvolutions(Database database,
boolean autocommit)
Cleanup evolutions for the given database.
|
static void |
cleanupEvolutions(Database database,
boolean autocommit,
String schema)
Cleanup evolutions for the given database.
|
static void |
cleanupEvolutions(Database database,
String schema)
Cleanup evolutions for the given database.
|
static play.api.db.evolutions.EvolutionsReader |
forDefault(Evolution... evolutions)
Create an evolutions reader for the default database from a list of evolutions.
|
static play.api.db.evolutions.EvolutionsReader |
fromClassLoader()
Create an evolutions reader that reads evolution files from this class's own classloader.
|
static play.api.db.evolutions.EvolutionsReader |
fromClassLoader(ClassLoader classLoader)
Create an evolutions reader that reads evolution files from a classloader.
|
static play.api.db.evolutions.EvolutionsReader |
fromClassLoader(ClassLoader classLoader,
String prefix)
Create an evolutions reader that reads evolution files from a classloader.
|
static play.api.db.evolutions.EvolutionsReader |
fromMap(Map<String,List<Evolution>> evolutions)
Create an evolutions reader based on a simple map of database names to evolutions.
|
public static play.api.db.evolutions.EvolutionsReader fromClassLoader()
Only useful in simple classloading environments, such as when the classloader structure is flat.
public static play.api.db.evolutions.EvolutionsReader fromClassLoader(ClassLoader classLoader)
classLoader
- The classloader to read from.public static play.api.db.evolutions.EvolutionsReader fromClassLoader(ClassLoader classLoader, String prefix)
classLoader
- The classloader to read from.prefix
- A prefix that gets added to the resource file names, for example, this could be
used to namespace evolutions in different environments to work with different databases.public static play.api.db.evolutions.EvolutionsReader fromMap(Map<String,List<Evolution>> evolutions)
evolutions
- The map of database names to evolutions.public static play.api.db.evolutions.EvolutionsReader forDefault(Evolution... evolutions)
evolutions
- The list of evolutions.public static void applyEvolutions(Database database, play.api.db.evolutions.EvolutionsReader reader, boolean autocommit, String schema)
database
- The database to apply the evolutions to.reader
- The reader to read the evolutions.autocommit
- Whether autocommit should be used.schema
- The schema where all the play evolution tables are saved inpublic static void applyEvolutions(Database database, play.api.db.evolutions.EvolutionsReader reader, String schema)
database
- The database to apply the evolutions to.reader
- The reader to read the evolutions.schema
- The schema where all the play evolution tables are saved inpublic static void applyEvolutions(Database database, play.api.db.evolutions.EvolutionsReader reader, boolean autocommit)
database
- The database to apply the evolutions to.reader
- The reader to read the evolutions.autocommit
- Whether autocommit should be used.public static void applyEvolutions(Database database, play.api.db.evolutions.EvolutionsReader reader)
database
- The database to apply the evolutions to.reader
- The reader to read the evolutions.public static void applyEvolutions(Database database, String schema)
database
- The database to apply the evolutions to.schema
- The schema where all the play evolution tables are saved inpublic static void applyEvolutions(Database database)
database
- The database to apply the evolutions to.public static void cleanupEvolutions(Database database, boolean autocommit, String schema)
This will run the down scripts for all the applied evolutions.
database
- The database to apply the evolutions to.autocommit
- Whether autocommit should be used.schema
- The schema where all the play evolution tables are saved inpublic static void cleanupEvolutions(Database database, boolean autocommit)
This will run the down scripts for all the applied evolutions.
database
- The database to apply the evolutions to.autocommit
- Whether autocommit should be used.public static void cleanupEvolutions(Database database, String schema)
This will run the down scripts for all the applied evolutions.
database
- The database to apply the evolutions to.schema
- The schema where all the play evolution tables are saved inpublic static void cleanupEvolutions(Database database)
This will run the down scripts for all the applied evolutions.
database
- The database to apply the evolutions to.