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