com.imageworks.migration

Migrator

class Migrator extends AnyRef

This class migrates the database into the desired state.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Migrator
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Migrator(jdbcDatasource: DataSource, jdbcUsername: String, jdbcPassword: String, adapter: DatabaseAdapter)

    Construct a migrator to a database with an existing DataSource but override default username and password.

    Construct a migrator to a database with an existing DataSource but override default username and password.

    jdbcDatasource

    the JDBC DataSource to connect to the database

    jdbcUsername

    the username to log into the database

    jdbcPassword

    the password associated with the database username

    adapter

    a concrete DatabaseAdapter that the migrator uses to handle database specific features

  2. new Migrator(jdbcDatasource: DataSource, adapter: DatabaseAdapter)

    Construct a migrator to a database with an existing DataSource.

    Construct a migrator to a database with an existing DataSource.

    jdbcDatasource

    the JDBC DataSource to connect to the database

    adapter

    a concrete DatabaseAdapter that the migrator uses to handle database specific features

  3. new Migrator(jdbcUrl: String, jdbcUsername: String, jdbcPassword: String, adapter: DatabaseAdapter)

    Construct a migrator to a database that needs a username and password.

    Construct a migrator to a database that needs a username and password.

    jdbcUrl

    the JDBC URL to connect to the database

    jdbcUsername

    the username to log into the database

    jdbcPassword

    the password associated with the database username

    adapter

    a concrete DatabaseAdapter that the migrator uses to handle database specific features

  4. new Migrator(jdbcUrl: String, adapter: DatabaseAdapter)

    Construct a migrator to a database that does not need a username and password.

    Construct a migrator to a database that does not need a username and password.

    jdbcUrl

    the JDBC URL to connect to the database

    adapter

    a concrete DatabaseAdapter that the migrator uses to handle database specific features

  5. new Migrator(connectionBuilder: ConnectionBuilder, adapter: DatabaseAdapter)

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  10. def getInstalledVersions: SortedSet[Long]

    Get a sorted list of all the installed migrations.

    Get a sorted list of all the installed migrations.

    returns

    a sorted set of version numbers of the installed migrations

  11. def getMigrationStatuses(packageName: String, searchSubPackages: Boolean): MigrationStatuses

    Get the status of all the installed and available migrations.

    Get the status of all the installed and available migrations. A tuple-like class is returned that contains three groups of migrations: installed migrations with an associated Migration subclass, installed migration without an associated Migration subclass and Migration subclasses that are not installed.

    packageName

    the Java package name to search for Migration subclasses

    searchSubPackages

    true if sub-packages of packageName should be searched

  12. def getTableNames: Set[String]

    Get a list of table names.

    Get a list of table names. If the database adapter was given a schema name then only the tables in that schema are returned.

    returns

    a set of table names; no modifications of the case of table names is done

  13. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  15. def migrate(operation: MigratorOperation, packageName: String, searchSubPackages: Boolean): Unit

    Migrate the database.

    Migrate the database.

    Running this method, even if no concrete Migration subclasses are found in the given package name, will result in the creation of the schema_migrations table in the database, if it does not currently exist.

    operation

    the migration operation that should be performed

    packageName

    the Java package name to search for Migration subclasses

    searchSubPackages

    true if sub-packages of packageName should be searched

  16. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  20. def toString(): String

    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. def whyNotMigrated(packageName: String, searchSubPackages: Boolean): Option[String]

    Determine if the database has all available migrations installed in it and no migrations installed that do not have a corresponding concrete Migration subclass; that is, the database must have only those migrations installed that are found by searching the package name for concrete Migration subclasses.

    Determine if the database has all available migrations installed in it and no migrations installed that do not have a corresponding concrete Migration subclass; that is, the database must have only those migrations installed that are found by searching the package name for concrete Migration subclasses.

    Running this method does not modify the database in any way. The schema migrations table is not created.

    packageName

    the Java package name to search for Migration subclasses

    searchSubPackages

    true if sub-packages of packageName should be searched

    returns

    None if all available migrations are installed and all installed migrations have a corresponding Migration subclass; Some(message) with a message suitable for logging with the not-installed migrations and the installed migrations that do not have a matching Migration subclass

Inherited from AnyRef

Inherited from Any

Ungrouped