mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-05-05 16:03:29 +08:00
避免改动数据库时重置软件
This commit is contained in:
@@ -16,8 +16,18 @@ db.version(4).stores({
|
||||
channelList: '++id, name, prefer, channels, group, isActive'
|
||||
})
|
||||
|
||||
// 参考https://github.com/dfahlander/Dexie.js/releases/tag/v3.0.0-alpha.3 upgrade可以改变主键和表名了
|
||||
// https://dexie.org/docs/Version/Version.stores()
|
||||
// https://dexie.org/docs/Version/Version.upgrade()
|
||||
// https://ahuigo.github.io/b/ria/js-indexedDB#/ 比较旧,适当参考
|
||||
db.version(5).stores({
|
||||
shortcut: null
|
||||
})
|
||||
|
||||
db.version(6).stores({
|
||||
shortcut: '++id, name, key, desc'
|
||||
}).upgrade(async tx => {
|
||||
await tx.shortcut.bulkAdd(localKey)
|
||||
})
|
||||
|
||||
db.on('populate', () => {
|
||||
|
||||
Reference in New Issue
Block a user