forked from UKSOURCE/cms.hailearning.edu.vn
first commit
This commit is contained in:
32
scripts/2025_12_02_114122_asd.js
Normal file
32
scripts/2025_12_02_114122_asd.js
Normal file
@@ -0,0 +1,32 @@
|
||||
require('dotenv').config();
|
||||
const connectDB = require('../config/database');
|
||||
|
||||
/**
|
||||
* Migration: asd
|
||||
* Created: 11:41:22 2/12/2025
|
||||
*/
|
||||
async function migrate() {
|
||||
try {
|
||||
// Kết nối database
|
||||
await connectDB();
|
||||
console.log('Starting migration: asd...');
|
||||
|
||||
// TODO: Thêm code migration của bạn ở đây
|
||||
|
||||
console.log('Migration asd completed successfully!');
|
||||
|
||||
const mongoose = require('mongoose');
|
||||
await mongoose.disconnect();
|
||||
process.exit(0);
|
||||
} catch (error) {
|
||||
console.error('Migration error:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
// Chạy migration nếu được gọi trực tiếp
|
||||
if (require.main === module) {
|
||||
migrate();
|
||||
}
|
||||
|
||||
module.exports = { migrate };
|
||||
Reference in New Issue
Block a user