- 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>
28 lines
1015 B
TypeScript
28 lines
1015 B
TypeScript
import { MongoMigration } from '../mongo_migrator.js'
|
|
|
|
export default class CreateDevicesCollection extends MongoMigration {
|
|
async up(): Promise<void> {
|
|
const collection = this.db.collection('devices')
|
|
|
|
await collection.createIndex(
|
|
{
|
|
'deviceId.manufacturer': 1,
|
|
'deviceId.oui': 1,
|
|
'deviceId.productClass': 1,
|
|
'deviceId.serialNumber': 1,
|
|
},
|
|
{ unique: true, name: 'idx_deviceId_compound' }
|
|
)
|
|
|
|
await collection.createIndex({ identifier: 1 }, { unique: true, name: 'idx_identifier' })
|
|
await collection.createIndex({ 'deviceId.manufacturer': 1 }, { name: 'idx_manufacturer' })
|
|
await collection.createIndex({ 'deviceId.oui': 1 }, { name: 'idx_oui' })
|
|
await collection.createIndex({ 'deviceId.productClass': 1 }, { name: 'idx_productClass' })
|
|
await collection.createIndex({ 'deviceId.serialNumber': 1 }, { name: 'idx_serialNumber' })
|
|
}
|
|
|
|
async down(): Promise<void> {
|
|
await this.db.dropCollection('devices').catch(() => {})
|
|
}
|
|
}
|