- Docker infrastructure (Dockerfile, docker-compose.yml, genieacs-sim) - AdonisJS v7 app with Inertia.js + Vue 3 - MongoDB integration - CWMP/TR-069 state machine engine - Configuration engine with compliance tracking - Branding: ADAM ACS (favicon, navbar, locales) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
21 lines
876 B
TypeScript
21 lines
876 B
TypeScript
import { MongoMigration } from '../mongo_migrator.js'
|
|
|
|
export default class DropLegacyCollections extends MongoMigration {
|
|
async up(): Promise<void> {
|
|
// 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<void> {
|
|
// 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' })
|
|
}
|
|
}
|