миграция
This commit is contained in:
@@ -86,8 +86,16 @@ async function migrateMessages() {
|
||||
console.log('[Migration] Disconnected from MongoDB');
|
||||
} catch (err) {
|
||||
console.error('[Migration] ❌ Error:', err.message);
|
||||
process.exit(1);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
migrateMessages();
|
||||
module.exports = { migrateMessages };
|
||||
|
||||
// Run directly if called as script
|
||||
if (require.main === module) {
|
||||
migrateMessages().catch(err => {
|
||||
console.error('Migration failed:', err);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user