mirror of
https://github.com/Burn-E99/GroupUp.git
synced 2026-01-06 11:27:54 -05:00
Add DB audit command
This commit is contained in:
@ -93,5 +93,20 @@ await dbClient.execute(`
|
||||
`);
|
||||
console.log('Table created');
|
||||
|
||||
// Database sizes view
|
||||
console.log('Attempting to create view db_size');
|
||||
await dbClient.execute(`
|
||||
CREATE VIEW db_size AS
|
||||
SELECT
|
||||
table_name AS "table",
|
||||
ROUND(((data_length + index_length) / 1024 / 1024), 3) AS "size",
|
||||
table_rows AS "rows"
|
||||
FROM information_schema.TABLES
|
||||
WHERE
|
||||
table_schema = "${config.db.name}"
|
||||
AND table_name <> "db_size";
|
||||
`);
|
||||
console.log('View Created');
|
||||
|
||||
await dbClient.close();
|
||||
console.log('Done!');
|
||||
|
||||
@ -4,6 +4,7 @@ import { dbClient } from '../src/db.ts';
|
||||
console.log('Attempting to insert default actions into command_cnt');
|
||||
const actions = [
|
||||
'msg-mention',
|
||||
'cmd-audit',
|
||||
'cmd-delete',
|
||||
'cmd-help',
|
||||
'cmd-info',
|
||||
|
||||
Reference in New Issue
Block a user