23 lines
559 B
TypeScript
23 lines
559 B
TypeScript
import 'dotenv/config';
|
|
import db from './src/database/models/index.js';
|
|
const { AuditLog } = (db as any).default || db;
|
|
|
|
const applicationId = '6139d6f9-f3c1-4e55-903b-3516d3a08955';
|
|
|
|
async function checkAudit() {
|
|
try {
|
|
const count = await AuditLog.count({
|
|
where: { entityId: applicationId, entityType: 'application' }
|
|
});
|
|
|
|
console.log(`Application has ${count} audit logs.`);
|
|
|
|
} catch (error) {
|
|
console.error('Error checking audit:', error);
|
|
} finally {
|
|
process.exit();
|
|
}
|
|
}
|
|
|
|
checkAudit();
|