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