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(table_name: String, column_name: String, column_type: 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(table_name: String, column_name: 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.

    table_name

    the table to add the index to

    column_name

    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(table_name: String, column_names: 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.

    table_name

    the table to add the index to

    column_names

    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(table_name: String, column_name: String, column_type: 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.

    table_name

    the name of the table with the column

    column_name

    the name of the column

    column_type

    the type the column is being altered to

  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(table_name: String, options: TableOption*)(body: (TableDefinition) ⇒ Unit): Unit

  18. final def dropTable(table_name: String): Unit

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

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

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

  22. def finalize(): Unit

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

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

    Add a grant on a table to a grantee.

    Add a grant on a table to a grantee.

    table_name

    the table name to add the grantees to

    grantee

    the grantee to grant the privileges to

    privileges

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

  25. final def grant(table_name: 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.

    table_name

    the table name to add the grantees to

    grantees

    a non-empty array of grantees

    privileges

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

  26. def hashCode(): Int

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

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

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

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

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

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

  32. 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.

  33. def references(definition: TableColumnDefinition): References

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

  34. 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

  35. final def removeColumn(table_name: String, column_name: String): Unit

  36. 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

  37. 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

  38. final def removeIndex(table_name: String, column_name: 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.

    table_name

    the table to remove the index from

    column_name

    the name of the column the index is on

    options

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

  39. final def removeIndex(table_name: String, column_names: 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.

    table_name

    the table to remove the index from

    column_names

    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

  40. final def revoke(table_name: String, grantee: String, privileges: GrantPrivilegeType*): Unit

    Remove privileges on a table from one or more grantees.

    Remove privileges on a table from one or more grantees.

    table_name

    the table name to remove the grants from

    privileges

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

  41. final def revoke(table_name: 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.

    table_name

    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

  42. 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.

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

    Definition Classes
    AnyRef
  44. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  48. 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

  49. 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