Class/Object

stark.migration

Migrator

Related Docs: object Migrator | package migration

Permalink

class Migrator extends SchemaDumperSupport

This class migrates the database into the desired state.

Linear Supertypes
SchemaDumperSupport, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Migrator
  2. SchemaDumperSupport
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

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

    Permalink

    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)

    Permalink

    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)

    Permalink

    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)

    Permalink

    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)

    Permalink

Value Members

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. val COLUMN_DEF: Int

    Permalink
    Attributes
    protected
    Definition Classes
    SchemaDumperSupport
  5. val COLUMN_NAME: Int

    Permalink
    Attributes
    protected
    Definition Classes
    SchemaDumperSupport
  6. val COLUMN_SIZE: Int

    Permalink
    Attributes
    protected
    Definition Classes
    SchemaDumperSupport
  7. val DATA_TYPE: Int

    Permalink
    Attributes
    protected
    Definition Classes
    SchemaDumperSupport
  8. val DECIMAL_DIGITS: Int

    Permalink
    Attributes
    protected
    Definition Classes
    SchemaDumperSupport
  9. val INDEX_INFO_COLUMN_NAME: Int

    Permalink
    Attributes
    protected
    Definition Classes
    SchemaDumperSupport
  10. val INDEX_INFO_NAME: Int

    Permalink
    Attributes
    protected
    Definition Classes
    SchemaDumperSupport
  11. val INDEX_INFO_NON_UNIQUE: Int

    Permalink
    Attributes
    protected
    Definition Classes
    SchemaDumperSupport
  12. val INDEX_INFO_TABLE_NAME: Int

    Permalink
    Attributes
    protected
    Definition Classes
    SchemaDumperSupport
  13. val IS_NULLABLE: Int

    Permalink
    Attributes
    protected
    Definition Classes
    SchemaDumperSupport
  14. val PRIMARY_KEYS_COLUMN_NAME: Int

    Permalink
    Attributes
    protected
    Definition Classes
    SchemaDumperSupport
  15. val TYPE_NAME: Int

    Permalink
    Attributes
    protected
    Definition Classes
    SchemaDumperSupport
  16. val adapter: DatabaseAdapter

    Permalink
  17. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  18. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. def dumpDropSequence(sequence: String)(implicit sb: StringBuilder): Unit

    Permalink
    Definition Classes
    SchemaDumperSupport
  20. def dumpDropTable(table: String)(implicit sb: StringBuilder): Unit

    Permalink
    Definition Classes
    SchemaDumperSupport
  21. def dumpFooter()(implicit sb: StringBuilder): Unit

    Permalink
    Definition Classes
    SchemaDumperSupport
  22. def dumpHead()(implicit sb: StringBuilder): Unit

    Permalink
    Definition Classes
    SchemaDumperSupport
  23. def dumpMiddle()(implicit sb: StringBuilder): Unit

    Permalink
    Definition Classes
    SchemaDumperSupport
  24. def dumpSequence(sequence: String)(implicit sb: StringBuilder): Unit

    Permalink
    Definition Classes
    SchemaDumperSupport
  25. def dumpTable(table: String)(implicit sb: StringBuilder): Unit

    Permalink
    Definition Classes
    SchemaDumperSupport
  26. final def eq(arg0: AnyRef): Boolean

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

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

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

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

    Permalink

    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

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

    Permalink

    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

  32. def getTableNames: Set[String]

    Permalink

    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

  33. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  34. def intFromResultSet(resultSet: ResultSet, column: Int): Int

    Permalink
    Attributes
    protected
    Definition Classes
    SchemaDumperSupport
  35. final def isInstanceOf[T0]: Boolean

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

    Permalink

    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

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

    Permalink
    Definition Classes
    AnyRef
  38. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  39. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  40. def sequences(): Seq[String]

    Permalink
    Definition Classes
    SchemaDumperSupport
  41. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  42. def tables(): Seq[String]

    Permalink

    得到所有的表名

    得到所有的表名

    returns

    表的集合

    Definition Classes
    SchemaDumperSupport
  43. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  44. def typeFromResultSet(resultSet: ResultSet): SqlType

    Permalink
    Attributes
    protected
    Definition Classes
    SchemaDumperSupport
  45. final def wait(): Unit

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

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

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

    Permalink

    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 SchemaDumperSupport

Inherited from AnyRef

Inherited from Any

Ungrouped