dbutils initial commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// Initialize MongoDB database
|
||||
|
||||
// Switch to the application database
|
||||
db = db.getSiblingDB(process.env.MONGO_INITDB_DATABASE || 'adastradb');
|
||||
|
||||
// Create a collection for data import history
|
||||
// This collection will track all data imports for audit and recovery purposes
|
||||
db.createCollection('dataImportHistory', {
|
||||
capped: false
|
||||
});
|
||||
|
||||
// Create an index on the importDate for better query performance
|
||||
db.dataImportHistory.createIndex({ importDate: -1 });
|
||||
db.dataImportHistory.createIndex({ status: 1 });
|
||||
|
||||
print(`✓ Database '${db.getName()}' initialized successfully`);
|
||||
print(`✓ Collection 'dataImportHistory' created`);
|
||||
Reference in New Issue
Block a user