Skip to main content
Version: 4.4

Class: Migration#

migrations.Migration

Hierarchy#

  • Migration

Constructors#

constructor#

+ new Migration(driver: AbstractSqlDriver<AbstractSqlConnection>, config: Configuration<IDatabaseDriver<Connection>>): Migration

Parameters:#

NameType
driverAbstractSqlDriver<AbstractSqlConnection>
configConfiguration<IDatabaseDriver<Connection>>

Returns: Migration

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

Properties#

config#

Protected Readonly config: Configuration<IDatabaseDriver<Connection>>


ctx#

Protected Optional ctx: undefined | Transaction<any, any>

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


driver#

Protected Readonly driver: AbstractSqlDriver<AbstractSqlConnection>


queries#

Private Readonly queries: Query[]

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

Methods#

addSql#

addSql(sql: Query): void

Parameters:#

NameType
sqlQuery

Returns: void

Defined in: packages/migrations/src/Migration.ts:24


down#

down(): Promise<void>

Returns: Promise<void>

Defined in: packages/migrations/src/Migration.ts:16


execute#

execute(sql: Query): Promise<EntityData<AnyEntity<any>>[]>

Parameters:#

NameType
sqlQuery

Returns: Promise<EntityData<AnyEntity<any>>[]>

Defined in: packages/migrations/src/Migration.ts:37


getKnex#

getKnex(): Knex<any, unknown[]>

Returns: Knex<any, unknown[]>

Defined in: packages/migrations/src/Migration.ts:41


getQueries#

getQueries(): Query[]

Returns: Query[]

Defined in: packages/migrations/src/Migration.ts:45


isTransactional#

isTransactional(): boolean

Returns: boolean

Defined in: packages/migrations/src/Migration.ts:20


reset#

reset(): void

Returns: void

Defined in: packages/migrations/src/Migration.ts:28


setTransactionContext#

setTransactionContext(ctx: any): void

Parameters:#

NameType
ctxany

Returns: void

Defined in: packages/migrations/src/Migration.ts:33


up#

Abstractup(): Promise<void>

Returns: Promise<void>

Defined in: packages/migrations/src/Migration.ts:14

Last updated on by renovate[bot]