Evolutions

play.api.db.evolutions.Evolutions$
object Evolutions

Defines Evolutions utilities functions.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Evolutions.type

Members list

Value members

Concrete methods

def applyEvolutions(database: Database, evolutionsReader: EvolutionsReader, autocommit: Boolean, schema: String, metaTable: String, substitutionsMappings: Map[String, String], substitutionsPrefix: String, substitutionsSuffix: String, substitutionsEscape: Boolean): Unit

Apply evolutions for the given database.

Apply evolutions for the given database.

Value parameters

autocommit

Whether to use autocommit or not, evolutions will be manually committed if false.

database

The database to apply the evolutions to.

evolutionsReader

The reader to read the evolutions.

metaTable

Table to keep evolutions' meta data

schema

The schema that all the play evolution tables are saved in

substitutionsEscape

Whetever escaping of variables is enabled via a preceding "!". E.g. "!$evolutions

my_variable

" ends up as "$evolutions

my_variable

" in the final sql instead of replacing it with its substitution.

substitutionsMappings

Mappings of variables (without the prefix and suffix) and their replacements.

substitutionsPrefix

Prefix of the variable to substitute, e.g. "$evolutions

".
@param substitutionsSuffix Suffix of the variable to substitute, e.g. "

".

Attributes

def cleanupEvolutions(database: Database, autocommit: Boolean, schema: String, metaTable: String, substitutionsMappings: Map[String, String], substitutionsPrefix: String, substitutionsSuffix: String, substitutionsEscape: Boolean): Unit

Cleanup evolutions for the given database.

Cleanup evolutions for the given database.

This will leave the database in the original state it was before evolutions were applied, by running the down scripts for all the evolutions that have been previously applied to the database.

Value parameters

autocommit

Whether to use autocommit or not, evolutions will be manually committed if false.

database

The database to clean the evolutions for.

metaTable

Table to keep evolutions' meta data

schema

The schema where all the play evolution tables are saved in

substitutionsEscape

Whetever escaping of variables is enabled via a preceding "!". E.g. "!$evolutions

my_variable

" ends up as "$evolutions

my_variable

" in the final sql instead of replacing it with its substitution.

substitutionsMappings

Mappings of variables (without the prefix and suffix) and their replacements.

substitutionsPrefix

Prefix of the variable to substitute, e.g. "$evolutions

".
@param substitutionsSuffix Suffix of the variable to substitute, e.g. "

".

Attributes

Compare two evolution sequences.

Compare two evolution sequences.

Value parameters

downs

the seq of downs

ups

the seq of ups

Attributes

Returns

the downs and ups to run to have the db synced to the current stage

Default evolutions directory location.

Default evolutions directory location.

Attributes

def fileName(db: String, revision: Int): String

Default evolution file location.

Default evolution file location.

Attributes

def fileName(db: String, revision: String): String
def resourceName(db: String, revision: Int): String

Default evolution resource name.

Default evolution resource name.

Attributes

def resourceName(db: String, revision: String): String

Translates evolution scripts into something human-readable.

Translates evolution scripts into something human-readable.

Value parameters

scripts

the evolution scripts

Attributes

Returns

a formatted script

def updateEvolutionScript(db: String, revision: Int, comment: String, ups: String, downs: String)(implicit environment: Environment): Unit

Updates a local (file-based) evolution script.

Updates a local (file-based) evolution script.

Attributes

def withEvolutions[T](database: Database, evolutionsReader: EvolutionsReader, autocommit: Boolean, schema: String, metaTable: String, substitutionsMappings: Map[String, String], substitutionsPrefix: String, substitutionsSuffix: String, substitutionsEscape: Boolean)(block: => T): T

Execute the following code block with the evolutions for the database, cleaning up afterwards by running the downs.

Execute the following code block with the evolutions for the database, cleaning up afterwards by running the downs.

Value parameters

autocommit

Whether to use autocommit or not, evolutions will be manually committed if false.

block

The block to execute

database

The database to execute the evolutions on

evolutionsReader

The evolutions reader to use. Defaults to reading evolutions from the evolution readers own classloader.

metaTable

Table to keep evolutions' meta data

schema

The schema where all the play evolution tables are saved in

substitutionsEscape

Whetever escaping of variables is enabled via a preceding "!". E.g. "!$evolutions

my_variable

" ends up as "$evolutions

my_variable

" in the final sql instead of replacing it with its substitution.

substitutionsMappings

Mappings of variables (without the prefix and suffix) and their replacements.

substitutionsPrefix

Prefix of the variable to substitute, e.g. "$evolutions

".
@param substitutionsSuffix Suffix of the variable to substitute, e.g. "

".

Attributes