drawDB/src/data/db.js

14 lines
318 B
JavaScript
Raw Normal View History

2023-10-26 21:34:50 +08:00
import Dexie from "dexie";
2023-12-03 05:27:25 +08:00
import { templateSeeds } from "./seeds";
2023-10-26 21:34:50 +08:00
2024-03-16 02:55:43 +08:00
export const db = new Dexie("drawDB");
2023-10-26 21:34:50 +08:00
2024-04-05 08:08:00 +08:00
db.version(5).stores({
2023-10-28 02:10:17 +08:00
diagrams: "++id, lastModified",
2023-12-19 10:36:10 +08:00
templates: "++id, custom",
2023-12-03 05:27:25 +08:00
});
db.on("populate", (transaction) => {
transaction.templates.bulkAdd(templateSeeds).catch((e) => console.log(e));
2023-10-26 21:34:50 +08:00
});