Files
adam-acs/database/mongo_migrations/002_create_commands_collection.ts
T
Kevin L'HereecandCopilot d1c65dbf1e chore: initial commit — AdonisJS v7 TR-069 ACS
- 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>
2026-05-29 16:46:37 +02:00

21 lines
574 B
TypeScript

import { MongoMigration } from '../mongo_migrator.js'
export default class CreateCommandsCollection extends MongoMigration {
async up(): Promise<void> {
const collection = this.db.collection('commands')
await collection.createIndex(
{ deviceIdentifier: 1 },
{ background: true, name: 'idx_deviceIdentifier' }
)
await collection.createIndex(
{ status: 1, priority: -1 },
{ background: true, name: 'idx_status_priority' }
)
}
async down(): Promise<void> {
await this.db.dropCollection('commands').catch(() => {})
}
}