You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
487 B
22 lines
487 B
import Dexie from 'dexie'
|
|
import 'dexie-export-import'
|
|
import { nanoid } from 'nanoid'
|
|
|
|
let db = new Dexie 'fuzzyhome'
|
|
|
|
db.version(1).stores({
|
|
links: "++id,name,link"
|
|
})
|
|
|
|
db.version(2).stores({
|
|
links: "++id,name,url,frequency,img"
|
|
}).upgrade! do |trans|
|
|
trans.links.toCollection!.modify! do |link|
|
|
let id = nanoid!
|
|
let name = link.name
|
|
let url = link.link
|
|
let frequency = link.frequency
|
|
let img = link.img
|
|
this.value = { id, name, url, frequency, img }
|
|
|
|
export default db
|
|
|