drawDB/src/data/db.js
2024-02-06 00:42:11 +02:00

16 lines
327 B
JavaScript

import Dexie from "dexie";
import { templateSeeds } from "./seeds";
const db = new Dexie("drawDB");
db.version(3).stores({
diagrams: "++id, lastModified",
templates: "++id, custom",
});
db.on("populate", (transaction) => {
transaction.templates.bulkAdd(templateSeeds).catch((e) => console.log(e));
});
export { db };