Class

stark.migration

Migration

Related Doc: package migration

Permalink

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
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Migration()

    Permalink

Abstract Value Members

  1. abstract def down(): Unit

    Permalink

    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

    Permalink

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

Concrete 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. def addCheck(on: On, expr: String, options: CheckOption*): Unit

    Permalink

    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

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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

  10. def addTrigger(tableName: String, triggerName: String, options: TriggerOption*)(f: ⇒ String): Unit

    Permalink

    add trigger

  11. def addingForeignKeyConstraintCreatesIndex: Boolean

    Permalink

    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);

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

    Permalink

    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

  13. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. final def commentColumn(tableName: String, columnName: String, comment: String): Unit

    Permalink

    comment column

    comment column

    tableName

    table name

    columnName

    column name

    comment

    comment

  16. final def commentTable(tableName: String, comment: String): Unit

    Permalink

    comment table

    comment table

    tableName

    table name

    comment

    comment

  17. def connection: Connection

    Permalink

    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.

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

    Permalink
  19. def databaseVendor: Vendor

    Permalink

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

  20. final def dropSequence(name: String): Unit

    Permalink

    删除序列

    删除序列

    name

    序列的名称

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

    Permalink
  22. def dropTrigger(triggerName: String): Unit

    Permalink

    droper some trigger

    droper some trigger

    triggerName

    trigger name

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  25. final def execute(sql: String*): Unit

    Permalink

    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

  26. def finalize(): Unit

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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

  36. def hashCode(): Int

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

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

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

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

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

    Permalink

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

  42. def rawConnection: Connection

    Permalink

    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.

  43. def references(definition: TableColumnDefinition): References

    Permalink

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

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

    Permalink

    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

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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

  58. final def sequence(name: String): Unit

    Permalink

    创建序列

    创建序列

    name

    序列名称

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

    Permalink

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

    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.

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

    Permalink
    Definition Classes
    AnyRef
  61. def toString(): String

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

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

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

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

    Permalink

    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

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

    Permalink

    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