Skip to main content
Version: Next

abstractMigrationGenerator

Hierarchy

Implements

Index

Constructors

constructor

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: { down: string[]; up: string[] }, path?: string, name?: string): Promise<[string, string]>
  • Generates the full contents of migration file. Uses generateMigrationFile to get the file contents.


    Parameters

    • diff: { down: string[]; up: string[] }
      • down: string[]
      • up: string[]
    • optionalpath: string
    • optionalname: string

    Returns Promise<[string, string]>

abstractgenerateMigrationFile

  • generateMigrationFile(className: string, diff: { down: string[]; up: string[] }): string
  • Returns the file contents of given migration.


    Parameters

    • className: string
    • diff: { down: string[]; up: string[] }
      • down: string[]
      • up: string[]

    Returns string