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-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',
|
|
|
|
'btn-gameSel',
|
|
|
|
'btn-customAct',
|
|
|
|
'btn-createEvt',
|
|
|
|
'btn-createWLEvt',
|
2023-04-06 22:45:33 -07:00
|
|
|
'btn-joinEvent',
|
|
|
|
'btn-joinWLEvent',
|
|
|
|
'btn-leaveEvent',
|
|
|
|
'btn-altEvent',
|
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!');
|