MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / initialize

Function initialize

packages/core/src/utils/AbstractMigrator.ts:473–481  ·  view source on GitHub ↗
(MigrationClass: Constructor<Migration>, name: string)

Source from the content-addressed store, hash-verified

471 }
472
473 protected initialize(MigrationClass: Constructor<Migration>, name: string): RunnableMigration {
474 const instance = new MigrationClass(this.driver, this.config);
475
476 return {
477 name: this.storage.getMigrationName(name),
478 up: afterRun => this.runner.run(instance, 'up', afterRun),
479 down: afterRun => this.runner.run(instance, 'down', afterRun),
480 };
481 }
482
483 /**
484 * Checks if `src` folder exists, it so, tries to adjust the migrations and seeders paths automatically to use it.

Callers

nothing calls this directly

Calls 2

getMigrationNameMethod · 0.65
runMethod · 0.65

Tested by

no test coverage detected