com.imageworks.migration

Migration

abstract class Migration extends AnyRef

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

Instance Constructors

  1. new Migration()

Abstract Value Members

  1. abstract def down(): Unit

    Concrete migration classes must define this method to back out of this migration.

    Concrete migration classes must define this method to back out of this migration. If the migration cannot be reversed, then a IrreversibleMigrationException should be thrown.

  2. abstract def up(): Unit

    Concrete migration classes must define this method to migrate the database up to a new migration.

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

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

    Definition Classes
    Any
  6. def addCheck(on: On, expr: String, options: CheckOption*): Unit

    Add a CHECK constraint on a table and one or more columns.

    Add a CHECK constraint on a table and one or more columns. The constraint name is automatically generated unless Name() is given as an option.

    on

    the table and columns to add the CHECK constraint on

    expr

    the expression to check

    options

    a possibly empty list of check options to customize the creation of the CHECK constraint

  7. final def addColumn(tableName: String, columnName: String, columnType: SqlType, options: ColumnOption*): Unit

  8. def addForeignKey(references: References, on: On, options: ForeignKeyOption*): Unit

    Add a foreign key to a table.

    Add a foreign key to a table. The name of the foreign key is automatically generated unless Name() is given as an option.

    references

    the table and column name(s) that the foreign key references

    on

    the table and column name(s) to place the foreign key on

    options

    a possibly empty list of foreign key options to customize the creation of the foreign key

  9. def addForeignKey(on: On, references: References, options: ForeignKeyOption*): Unit

    Add a foreign key to a table.

    Add a foreign key to a table. The name of the foreign key is automatically generated unless Name() is given as an option.

    on

    the table and column name(s) to place the foreign key on

    references

    the table and column name(s) that the foreign key references

    options

    a possibly empty list of foreign key options to customize the creation of the foreign key

  10. final def addIndex(tableName: String, columnName: String, options: IndexOption*): Unit

    Add an index to a table on a column.

    Add an index to a table on a column. The name of the index is automatically generated unless Name() is given as an option.

    tableName

    the table to add the index to

    columnName

    the name of the column that the index will be on

    options

    a possibly empty list of index options to customize the creation of the index

  11. final def addIndex(tableName: String, columnNames: Array[String], options: IndexOption*): Unit

    Add an index to a table on a non-empty list of column names.

    Add an index to a table on a non-empty list of column names. The name of the index is automatically generated unless Name() is given as an option.

    tableName

    the table to add the index to

    columnNames

    a list of one or more column names that the index will be on

    options

    a possibly empty list of index options to customize the creation of the index

  12. def addingForeignKeyConstraintCreatesIndex: Boolean

    This value is true if the database implicitly adds an index on the column that has a foreign key constraint added to it.

    This value is true if the database implicitly adds an index on the column that has a foreign key constraint added to it.

    The following SQL can be used to test the database. The last statement will fail with a message that there already is an index on the column.

    create table parent (pk int primary key); create table child (pk int primary key, pk_parent int not null); alter table child add constraint idx_child_pk_parent foreign key (pk_parent) references parent (pk); create index idx_child_pk_parent on child (pk_parent);

  13. final def alterColumn(tableName: String, columnName: String, columnType: SqlType, options: ColumnOption*): Unit

    Alter the definition of an existing column.

    Alter the definition of an existing column.

    NOTE: if the original column definition uses CharacterSet() then it must be used here again, unless the base SQL data type is being changed. For example, on Oracle, creating a column without CharacterSet uses VARCHAR2 while using CharacterSet(Unicode) uses NVARCHAR2, so if the original column used CharacterSet(Unicode) and #alterColumn() is not passed CharacterSet(Unicode), then the column's data type will be change from NVARCHAR2 to VARCHAR2.

    tableName

    the name of the table with the column

    columnName

    the name of the column

    columnType

    the type the column is being altered to

    options

    a possibly empty array of column options to customize the column

  14. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  15. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. def connection: Connection

    Get the connection to the database the migration can use for any custom work.

    Get the connection to the database the migration can use for any custom work. This connection logs all operations performed on it. The Migration subclass must be careful with this connection and leave it in a good state, as all of the other migration methods defined in Migration use the same connection.

  17. final def createTable(tableName: String, options: TableOption*)(body: (TableDefinition) ⇒ Unit): Unit

  18. def databaseVendor: Vendor

    The vendor of the database the migration is being run on.

  19. final def dropTable(tableName: String): Unit

  20. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  22. final def execute(sql: String): Unit

    Execute the given SQL string using the migration's connection.

    Execute the given SQL string using the migration's connection.

    sql

    the SQL to execute

  23. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  25. final def grant(tableName: String, grantee: String, privileges: GrantPrivilegeType*): Unit

    Add a grant on a table to a grantee.

    Add a grant on a table to a grantee.

    tableName

    the table name to add the grants to

    grantee

    the grantee to grant the privileges to

    privileges

    a non-empty array of privileges to grant to the grantee

  26. final def grant(tableName: String, grantee: User, privileges: GrantPrivilegeType*): Unit

    Add a grant on a table to a grantee.

    Add a grant on a table to a grantee.

    tableName

    the table name to add the grants to

    grantee

    the grantee to grant the privileges to

    privileges

    a non-empty array of privileges to grant to the grantee

  27. final def grant(tableName: String, grantees: Array[String], privileges: GrantPrivilegeType*): Unit

    Add a grant on a table to one or more grantees.

    Add a grant on a table to one or more grantees.

    tableName

    the table name to add the grants to

    grantees

    a non-empty array of grantees

    privileges

    a non-empty array of privileges to grant to the grantees

  28. final def grant(tableName: String, grantees: Array[User], privileges: GrantPrivilegeType*): Unit

    Add a grant on a table to one or more grantees.

    Add a grant on a table to one or more grantees.

    tableName

    the table name to add the grants to

    grantees

    a non-empty array of grantees

    privileges

    a non-empty array of privileges to grant to the grantees

  29. final def grantSchemaPrivilege(grantee: String, privileges: SchemaPrivilege*): Unit

    Grant one or more privileges to a schema.

    Grant one or more privileges to a schema.

    grantee

    the grantee to grant the privileges to

    privileges

    a non-empty array of privileges to grant to the grantee

  30. final def grantSchemaPrivilege(grantee: User, privileges: SchemaPrivilege*): Unit

    Grant one or more privileges to a schema.

    Grant one or more privileges to a schema.

    grantee

    the grantee to grant the privileges to

    privileges

    a non-empty array of privileges to grant to the grantee

  31. final def grantSchemaPrivilege(grantees: Array[String], privileges: SchemaPrivilege*): Unit

    Grant one or more privileges to a schema.

    Grant one or more privileges to a schema.

    grantees

    a non-empty array of grantees

    privileges

    a non-empty array of privileges to grant to the grantees

  32. final def grantSchemaPrivilege(grantees: Array[User], privileges: SchemaPrivilege*): Unit

    Grant one or more privileges to a schema.

    Grant one or more privileges to a schema.

    grantees

    a non-empty array of grantees

    privileges

    a non-empty array of privileges to grant to the grantees

  33. def hashCode(): Int

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

    Definition Classes
    Any
  35. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  38. def on(definition: TableColumnDefinition): On

    Convert a table and column name definition into a On foreign key instance.

  39. def rawConnection: Connection

    Get the raw connection to the database the migration can use for any custom work.

    Get the raw connection to the database the migration can use for any custom work. This connection is the raw connection that underlies the logging connection and does not log any operations performed on it. It should only be used when the logging connection does not provide a required feature. The Migration subclass must be careful with this connection and leave it in a good state, as all of the other migration methods defined in Migration use the same connection.

  40. def references(definition: TableColumnDefinition): References

    Convert a table and column name definition into a References foreign key instance.

  41. def removeCheck(on: On, options: Name*): Unit

    Remove a CHECK constraint on a table and one or more columns.

    Remove a CHECK constraint on a table and one or more columns. The constraint name is automatically generated unless Name() is given as an option.

    on

    the table and columns to remove the CHECK constraint from

    options

    a possibly empty list of check options to customize the removal of the CHECK constraint

  42. final def removeColumn(tableName: String, columnName: String): Unit

  43. def removeForeignKey(references: References, on: On, options: Name*): Unit

    Remove a foreign key from a table.

    Remove a foreign key from a table. The name of the foreign key is automatically generated unless Name() is given as an option.

    references

    the table and column name(s) that the foreign key references

    on

    the table and column name(s) to remove the foreign key from

    options

    a possibly empty list of foreign key options to customize the removal of the foreign key

  44. def removeForeignKey(on: On, references: References, options: Name*): Unit

    Remove a foreign key from a table.

    Remove a foreign key from a table. The name of the foreign key is automatically generated unless Name() is given as an option.

    on

    the table and column name(s) to remove the foreign key from

    references

    the table and column name(s) that the foreign key references

    options

    a possibly empty list of foreign key options to customize the removal of the foreign key

  45. final def removeIndex(tableName: String, columnName: String, options: Name*): Unit

    Remove an index on a column in a table.

    Remove an index on a column in a table. The name of the index to remove is automatically generated unless Name() is given as an option.

    tableName

    the table to remove the index from

    columnName

    the name of the column the index is on

    options

    a possibly empty list of index options to customize the removal of the index

  46. final def removeIndex(tableName: String, columnNames: Array[String], options: Name*): Unit

    Remove an index on a table that is composed of a non-empty list of column names.

    Remove an index on a table that is composed of a non-empty list of column names. The name of the index to remove is automatically generated unless Name() is given as an option.

    tableName

    the table to remove the index from

    columnNames

    a list of one or more column names that the index is on

    options

    a possibly empty list of index options to customize the removal of the index

  47. final def revoke(tableName: String, grantee: String, privileges: GrantPrivilegeType*): Unit

    Remove privileges on a table from a grantee.

    Remove privileges on a table from a grantee.

    tableName

    the table name to remove the grants from

    grantee

    the grantee to revoke privileges from

    privileges

    a non-empty array of privileges to remove from the grantee

  48. final def revoke(tableName: String, grantee: User, privileges: GrantPrivilegeType*): Unit

    Remove privileges on a table from a grantee.

    Remove privileges on a table from a grantee.

    tableName

    the table name to remove the grants from

    grantee

    the grantee to revoke privileges from

    privileges

    a non-empty array of privileges to remove from the grantee

  49. final def revoke(tableName: String, grantees: Array[String], privileges: GrantPrivilegeType*): Unit

    Remove privileges on a table from one or more grantees.

    Remove privileges on a table from one or more grantees.

    tableName

    the table name to remove the grants from

    grantees

    a non-empty array of grantees

    privileges

    a non-empty array of privileges to remove from the grantees

  50. final def revoke(tableName: String, grantees: Array[User], privileges: GrantPrivilegeType*): Unit

    Remove privileges on a table from one or more grantees.

    Remove privileges on a table from one or more grantees.

    tableName

    the table name to remove the grants from

    grantees

    a non-empty array of grantees

    privileges

    a non-empty array of privileges to remove from the grantees

  51. final def revokeSchemaPrivilege(grantee: String, privileges: SchemaPrivilege*): Unit

    Revoke one or more privileges from a schema.

    Revoke one or more privileges from a schema.

    grantee

    the grantee to revoke the privileges from

    privileges

    a non-empty array of privileges to revoke from the grantee

  52. final def revokeSchemaPrivilege(grantee: User, privileges: SchemaPrivilege*): Unit

    Revoke one or more privileges from a schema.

    Revoke one or more privileges from a schema.

    grantee

    the grantee to revoke the privileges from

    privileges

    a non-empty array of privileges to revoke from the grantee

  53. final def revokeSchemaPrivilege(grantees: Array[String], privileges: SchemaPrivilege*): Unit

    Revoke one or more privileges from a schema.

    Revoke one or more privileges from a schema.

    grantees

    a non-empty array of grantees

    privileges

    a non-empty array of privileges to revoke from the grantees

  54. final def revokeSchemaPrivilege(grantees: Array[User], privileges: SchemaPrivilege*): Unit

    Revoke one or more privileges from a schema.

    Revoke one or more privileges from a schema.

    grantees

    a non-empty array of grantees

    privileges

    a non-empty array of privileges to revoke from the grantees

  55. implicit def stringToMigrationArrowAssoc(s: String): MigrationArrowAssoc

    Override the -> implicit definition to create a MigrationArrowAssoc instead of a scala.

    Override the -> implicit definition to create a MigrationArrowAssoc instead of a scala.Predef.ArrowAssoc. See the above comment on the MigrationArrowAssoc class why this is done.

  56. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  57. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  61. final def withPreparedStatement(sql: String)(f: (PreparedStatement) ⇒ Unit): Unit

    Given a SQL string and a Function1[PreparedStatement,Unit], start a new transaction by turning off auto-commit mode on the connection then create a new prepared statement with the SQL string and pass the prepared statement to the closure argument.

    Given a SQL string and a Function1[PreparedStatement,Unit], start a new transaction by turning off auto-commit mode on the connection then create a new prepared statement with the SQL string and pass the prepared statement to the closure argument. The closure should not perform the commit as this method will commit the transaction. If the closure throws an exception then the transaction is rolled back and the exception that caused the rollback is re-thrown. Finally, the auto-commit state is reset to the value the connection had before this method was called.

    sql

    the SQL text that will be prepared

    f

    the Function1[PreparedStatement,Unit] that will be given a new prepared statement

  62. final def withResultSet[R](rs: ResultSet)(f: (ResultSet) ⇒ R): R

    Given a SQL result set and a Function1[ResultSet,R], pass the result set to the closure.

    Given a SQL result set and a Function1[ResultSet,R], pass the result set to the closure. After the closure has completed, either normally via a return or by throwing an exception, close the result set.

    rs

    the SQL result set

    f

    the Function1[ResultSet,R] that will be given the result set

    returns

    the result of f if f returns normally

Inherited from AnyRef

Inherited from Any

Ungrouped