(options: { dropMigrationsTable?: boolean } = {})
| 53 | } |
| 54 | |
| 55 | override async drop(options: { dropMigrationsTable?: boolean } = {}): Promise<void> { |
| 56 | await this.connection.ensureConnection(); |
| 57 | const existing = await this.connection.listCollections(); |
| 58 | const metadata = this.getOrderedMetadata(); |
| 59 | |
| 60 | if (options.dropMigrationsTable) { |
| 61 | metadata.push({ collection: this.config.get('migrations').tableName } as any); |
| 62 | } |
| 63 | |
| 64 | const promises = metadata |
| 65 | .filter(meta => existing.includes(meta.collection)) |
| 66 | .map(meta => this.connection.dropCollection(meta.class)); |
| 67 | |
| 68 | await Promise.all(promises); |
| 69 | } |
| 70 | |
| 71 | override async update(options: MongoCreateSchemaOptions = {}): Promise<void> { |
| 72 | await this.create(options); |
no test coverage detected