import { MongoMigration } from '../mongo_migrator.js' export default class CreateCommandsCollection extends MongoMigration { async up(): Promise { 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 { await this.db.dropCollection('commands').catch(() => {}) } }