Packages

object MigrationGenerator

Module containing all logic to generate DDL files with information required to migration from one version of Schema to another

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MigrationGenerator
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. val EmptyAdded: CommentBlock
  2. val EncodingsForbiddingAlter: List[CompressionEncodingValue]

    List of column encodings that don't support length extension

    List of column encodings that don't support length extension

    See also

    https://docs.aws.amazon.com/redshift/latest/dg/r_ALTER_TABLE.html

  3. def buildAlterTableAdd(tableName: String, varcharSize: Int, pair: (SchemaPointer, Schema)): AlterTable

    Generate single ALTER TABLE statement to add a new property

    Generate single ALTER TABLE statement to add a new property

    tableName

    name of migrating table

    varcharSize

    default size for VARCHAR

    pair

    pair of property name and its Schema properties like length, maximum, etc

    returns

    DDL statement altering single column in table by adding new property

  4. def buildAlterTableMaxLength(tableName: String, varcharSize: Int, modified: Modified): Option[AlterTable]

    Generate single ALTER TABLE statement that increases the length of a varchar in-place

    Generate single ALTER TABLE statement that increases the length of a varchar in-place

    tableName

    name of migrating table

    varcharSize

    default size for VARCHAR

    modified

    field whose length gets increased

    returns

    DDL statement altering single column in table by increasing the sieadding new property

  5. def generateMigration(migration: Migration, varcharSize: Int, tableSchema: Option[String]): DdlFile

    Generate full ready to be rendered DDL file containing all migration statements and additional data like previous version of table

    Generate full ready to be rendered DDL file containing all migration statements and additional data like previous version of table

    migration

    common JSON Schema migration object with path (from-to) and diff

    varcharSize

    size VARCHARs by default

    tableSchema

    DB schema for table (atomic by default)

    returns

    DDL file containing list of statements ready to be printed

  6. def getHeader(tableName: String, oldSchemaUri: String): CommentBlock

    Generate comment block for for migration file with information about previous version of table

    Generate comment block for for migration file with information about previous version of table

    tableName

    name of migrating table

    oldSchemaUri

    Schema URI extracted from internal database store

    returns

    DDL statement with header