Skip to main content
Version: 6.3

IMigrationGenerator

Implemented by

Index

Methods

createStatement

  • createStatement(sql: string, padLeft: number): string
  • Creates single migration statement. By default adds this.addSql(sql); to the code.


    Parameters

    • sql: string
    • padLeft: number

    Returns string

generate

  • generate(diff: MigrationDiff, path?: string, name?: string): Promise<[string, string]>
  • Generates the full contents of migration file. Uses generateMigrationFile to get the file contents.


    Parameters

    Returns Promise<[string, string]>

generateMigrationFile

  • generateMigrationFile(className: string, diff: MigrationDiff): string
  • Returns the file contents of given migration.


    Parameters

    Returns string