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

Method createInitial

packages/migrations/src/Migrator.ts:180–196  ·  view source on GitHub ↗

* @inheritDoc

(path?: string, name?: string, blank = false)

Source from the content-addressed store, hash-verified

178 * @inheritDoc
179 */
180 async createInitial(path?: string, name?: string, blank = false): Promise<MigrationResult> {
181 await this.init();
182 const schemaExists = await this.validateInitialMigration(blank);
183 const diff = await this.getSchemaDiff(blank, true);
184 const migration = await this.generator.generate(diff, path, name);
185 await this.storeCurrentSchema();
186
187 if (schemaExists && !blank) {
188 await this.storage.logMigration({ name: migration[1] });
189 }
190
191 return {
192 fileName: migration[1],
193 code: migration[0],
194 diff,
195 };
196 }
197
198 protected override async runMigrations(
199 method: 'up' | 'down',

Callers 1

createMethod · 0.95

Calls 6

initMethod · 0.95
getSchemaDiffMethod · 0.95
storeCurrentSchemaMethod · 0.95
generateMethod · 0.65
logMigrationMethod · 0.65

Tested by

no test coverage detected