BugFix: Update IndexDB

sortierung
Samuel Zielke 1 year ago
parent cd88d0c354
commit b63092ab11

@ -1,6 +1,6 @@
// IndexedDB Funktionen
const dbName = 'myDB';
const dbVersion = 1;
const dbVersion = 2;
let db;
@ -17,15 +17,18 @@ function initDB() {
request.onupgradeneeded = function (event) {
db = event.target.result;
const store = db.createObjectStore('hours', {
keyPath: 'id',
autoIncrement: true,
});
const settingsT = db.createObjectStore('settings', {
keyPath: 'id',
autoIncrement: true,
})
if (!db.objectStoreNames.contains('hours')) {
const store = db.createObjectStore('hours', {
keyPath: 'id',
autoIncrement: true,
});
}
if (!db.objectStoreNames.contains('settings')) {
const settingsT = db.createObjectStore('settings', {
keyPath: 'id',
autoIncrement: true,
})
}
// Spalten definieren
store.createIndex('createdate', 'createdate', { unique: false });

Loading…
Cancel
Save

Powered by TurnKey Linux.