* @inheritDoc
(path?: string, name?: string, blank = false)
| 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', |
no test coverage detected