epic-games: migrateDb: rm .runs, .claimed[] -> .[user][game_id], closes #27
If you'd like to keep the .runs data: `cp -a data/epic-games.{json, v1.json}`
Objects also have insertion order for non-number strings, so there's not need for a list:
https://stackoverflow.com/questions/5525795/does-javascript-guarantee-object-property-order
This commit is contained in:
parent
61af4e35f6
commit
ac758d39e4
2 changed files with 23 additions and 19 deletions
1
util.js
1
util.js
|
|
@ -16,6 +16,7 @@ import { Low, JSONFile } from 'lowdb';
|
|||
export const jsonDb = async file => {
|
||||
const db = new Low(new JSONFile(dataDir(file)));
|
||||
await db.read();
|
||||
db.data ||= {};
|
||||
return db;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue