sync
This commit is contained in:
parent
200aef2eb3
commit
61084e7f6f
1 changed files with 14 additions and 0 deletions
|
|
@ -13,6 +13,20 @@ export namespace JsonMigration {
|
||||||
export async function run(sqlite: Database) {
|
export async function run(sqlite: Database) {
|
||||||
const storageDir = path.join(Global.Path.data, "storage")
|
const storageDir = path.join(Global.Path.data, "storage")
|
||||||
|
|
||||||
|
if (!(await Bun.file(storageDir).exists())) {
|
||||||
|
log.info("storage directory does not exist, skipping migration")
|
||||||
|
return {
|
||||||
|
projects: 0,
|
||||||
|
sessions: 0,
|
||||||
|
messages: 0,
|
||||||
|
parts: 0,
|
||||||
|
todos: 0,
|
||||||
|
permissions: 0,
|
||||||
|
shares: 0,
|
||||||
|
errors: [] as string[],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.info("starting json to sqlite migration", { storageDir })
|
log.info("starting json to sqlite migration", { storageDir })
|
||||||
const start = performance.now()
|
const start = performance.now()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue