From 822a36306ce6cc0e04c449fe607b88f9323ca176 Mon Sep 17 00:00:00 2001 From: Swagnik Dutta Date: Tue, 17 Feb 2026 21:59:47 +0530 Subject: [PATCH] fix: fixes last modified timestamp bug in ddctl --- src/infra/database/models/files.model.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/infra/database/models/files.model.ts b/src/infra/database/models/files.model.ts index ace222a..ff25bb4 100644 --- a/src/infra/database/models/files.model.ts +++ b/src/infra/database/models/files.model.ts @@ -147,10 +147,11 @@ export class FilesModel { commentKey: string; }): Promise { const _id = uuidv7(); + const now = new Date().toISOString(); const sql = ` INSERT INTO ${this.TABLE} - (_id, title, content, ddocId, portalAddress, linkKey, linkKeyNonce, derivedKey, secretKey, commentKey) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + (_id, title, content, ddocId, portalAddress, linkKey, linkKeyNonce, derivedKey, secretKey, commentKey, createdAt, updatedAt) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) `; await QueryBuilder.execute(sql, [ @@ -164,6 +165,8 @@ export class FilesModel { input.derivedKey, input.secretKey, input.commentKey, + now, + now, ]); // NOTE: default values while file creation: localVersion = 1, onchainVersion = 0, syncStatus = 'pending'