import { MongoMigration } from '../mongo_migrator.js' export default class DropLegacyCollections extends MongoMigration { async up(): Promise { // Drop legacy Discovery collection await this.db.dropCollection('discovery_configs').catch(() => {}) // Drop legacy Provisioning collection await this.db.dropCollection('provisioning_configs').catch(() => {}) } async down(): Promise { // Recreate legacy collections (empty — data must be restored from migration rollback) const discoveryCollection = this.db.collection('discovery_configs') await discoveryCollection.createIndex({ identifier: 1 }, { unique: true, name: 'idx_identifier' }) const provisioningCollection = this.db.collection('provisioning_configs') await provisioningCollection.createIndex({ identifier: 1 }, { unique: true, name: 'idx_identifier' }) } }