setup fixes

This commit is contained in:
mrfry 2023-03-26 20:43:40 +02:00
parent 4d3fd3a0af
commit a4b5dcff37
5 changed files with 84 additions and 102 deletions

View file

@ -4,8 +4,8 @@ const dbtools = require('../../dist/utils/dbtools.js').default // eslint-disable
const { v4: uuidv4 } = require('uuid') // eslint-disable-line
const dbStructPaths = [
{ structPath: '../modules/api/usersDBStruct.json', name: 'users.db' },
{ structPath: '../modules/api/msgsDbStruct.json', name: 'msgs.db' },
{ structPath: '../modules/api/usersDBStruct.js', name: 'users.db' },
{ structPath: '../modules/api/msgsDbStruct.js', name: 'msgs.db' },
]
dbStructPaths.forEach((data) => {
@ -14,7 +14,8 @@ dbStructPaths.forEach((data) => {
})
function createDB(path, name) {
const dbStruct = utils.ReadJSON(path)
// eslint-disable-next-line @typescript-eslint/no-var-requires
const dbStruct = require(path)
const db = dbtools.GetDB(`./${name}`)
db.pragma('synchronous = OFF')