Skip to main content

QMigration

@quik/database


@quik/database / QMigration

Abstract Class: QMigration

Defined in: database/src/migrations/QMigration.ts:32

Implements​

Constructors​

Constructor​

new QMigration(): QMigration

Returns​

QMigration

Accessors​

migrationName​

Get Signature​

get migrationName(): string

Defined in: database/src/migrations/QMigration.ts:37

Gets the name of the migration class. Used for identifying migrations in logs and database records.

Returns​

string

Methods​

down()​

abstract down(schema, engine): Promise<void | SchemaBuilder>

Defined in: database/src/migrations/QMigration.ts:57

Reverts the migration to rollback changes made to the database schema.

Parameters​

schema​

SchemaBuilder

The Knex schema builder instance

engine​

MigrationConnection

The Knex connection or transaction instance

Returns​

Promise<void | SchemaBuilder>

Throws​

If the migration cannot be rolled back

Implementation of​

IQMigration.down


up()​

abstract up(schema, engine): Promise<void | SchemaBuilder>

Defined in: database/src/migrations/QMigration.ts:48

Applies the migration to update the database schema.

Parameters​

schema​

SchemaBuilder

The Knex schema builder instance

engine​

MigrationConnection

The Knex connection or transaction instance

Returns​

Promise<void | SchemaBuilder>

Throws​

If the migration cannot be applied

Implementation of​

IQMigration.up