GroupUp/db/populateDefaults.ts

49 lines
1.0 KiB
TypeScript
Raw Permalink Normal View History

// This file will populate the tables with default values
import { dbClient } from '../src/db/client.ts';
console.log('Attempting to insert default actions into command_cnt');
const actions = [
'msg-mention',
2023-04-29 21:27:15 -07:00
'cmd-audit',
'cmd-delete',
'cmd-help',
'cmd-info',
'cmd-report',
'cmd-setup',
2023-04-06 21:30:47 -07:00
'cmd-gameSel',
'cmd-join',
'cmd-leave',
'cmd-alternate',
2023-04-06 21:30:47 -07:00
'btn-gameSel',
'btn-customAct',
'btn-createEvt',
'btn-createWLEvt',
'btn-joinEvent',
'btn-joinWLEvent',
'btn-leaveEvent',
2023-04-26 23:55:03 -07:00
'btn-leaveEventViaDM',
'btn-altEvent',
'btn-joinReqApprove',
'btn-joinReqDeny',
'btn-joinReqAlt',
'btn-delEvent',
'btn-confirmDelEvent',
2023-04-25 00:21:02 -07:00
'btn-editEvent',
'btn-eeChangeAct',
'btn-eeCustomAct',
2023-04-25 00:21:02 -07:00
'btn-eeChangeTime',
'btn-eeChangeDesc',
'btn-eeMakePublic',
'btn-eeMakeWL',
2023-04-28 12:52:41 -07:00
'lfg-filled',
];
for (const action of actions) {
await dbClient.execute('INSERT INTO command_cnt(command) values(?)', [action]).catch((e) => {
console.log(`Failed to insert into database`, e);
});
}
2022-07-10 17:48:38 -07:00
console.log('Insertion done');
await dbClient.close();
2022-07-10 17:48:38 -07:00
console.log('Done!');