Version: 4.3

Class: MigrationGenerator

Hierarchy

  • MigrationGenerator

Constructors

constructor

+ new MigrationGenerator(driver: AbstractSqlDriver, namingStrategy: NamingStrategy, options: MigrationsOptions): MigrationGenerator

Defined in packages/migrations/src/MigrationGenerator.ts:5

Parameters:

NameType
driverAbstractSqlDriver
namingStrategyNamingStrategy
optionsMigrationsOptions

Returns: MigrationGenerator

Properties

driver

Protected Readonly driver: AbstractSqlDriver

Defined in packages/migrations/src/MigrationGenerator.ts:7


namingStrategy

Protected Readonly namingStrategy: NamingStrategy

Defined in packages/migrations/src/MigrationGenerator.ts:8


options

Protected Readonly options: MigrationsOptions

Defined in packages/migrations/src/MigrationGenerator.ts:9

Methods

createStatement

createStatement(sql: string, padLeft: number): string

Defined in packages/migrations/src/MigrationGenerator.ts:30

Parameters:

NameType
sqlstring
padLeftnumber

Returns: string


generate

generate(diff: string[], path?: string): Promise<[string, string]>

Defined in packages/migrations/src/MigrationGenerator.ts:11

Parameters:

NameType
diffstring[]
path?string

Returns: Promise<[string, string]>


generateJSMigrationFile

generateJSMigrationFile(className: string, diff: string[]): string

Defined in packages/migrations/src/MigrationGenerator.ts:39

Parameters:

NameType
classNamestring
diffstring[]

Returns: string


generateTSMigrationFile

generateTSMigrationFile(className: string, diff: string[]): string

Defined in packages/migrations/src/MigrationGenerator.ts:53

Parameters:

NameType
classNamestring
diffstring[]

Returns: string

Last updated on by Martin Adámek