refactor[db]: store time as unix ms

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2025-10-03 21:23:51 +00:00
parent 1d8a117b93
commit 0e686a1f85
11 changed files with 132 additions and 15 deletions

View File

@@ -144,7 +144,7 @@ export async function create(
)
}
const now = new Date().toISOString()
const now = Date.now()
return await ctx.db.insert("directories", {
name,
parentId,
@@ -216,7 +216,7 @@ export async function move(
ignoredHandles.add(handle)
} else {
promises.push(
ctx.db.patch(handle.id, { parentId: targetDirectory.id }),
ctx.db.patch(handle.id, { parentId: targetDirectory.id, updatedAt: Date.now() }),
)
}
}
@@ -239,7 +239,7 @@ export async function moveToTrashRecursive(
ctx: AuthenticatedMutationCtx,
handle: DirectoryHandle,
): Promise<void> {
const now = new Date().toISOString()
const now = Date.now()
const filesToDelete: Id<"files">[] = []
const directoriesToDelete: Id<"directories">[] = []