Add comments to provide context on this change

This commit is contained in:
carlosmonastyrski
2025-05-07 08:43:56 -03:00
parent c6e56f0380
commit f0c52cc8da
2 changed files with 2 additions and 0 deletions

View File

@@ -85,6 +85,7 @@ export const secretFolderVersionDALFactory = (db: TDbClient) => {
.join(TableName.Project, `${TableName.Project}.id`, `${TableName.Environment}.projectId`)
.join("folder_cte", "folder_cte.id", `${TableName.SecretFolderVersion}.id`)
.whereRaw(`folder_cte.row_num > ${TableName.Project}."pitVersionLimit"`)
// Projects with version >= 3 will require to have all folder versions for PIT
.andWhere(`${TableName.Project}.version`, "<", 3)
.delete();
} catch (error) {

View File

@@ -162,6 +162,7 @@ export const secretVersionV2BridgeDALFactory = (db: TDbClient) => {
.join(TableName.Project, `${TableName.Project}.id`, `${TableName.Environment}.projectId`)
.join("version_cte", "version_cte.id", `${TableName.SecretVersionV2}.id`)
.whereRaw(`version_cte.row_num > ${TableName.Project}."pitVersionLimit"`)
// Projects with version >= 3 will require to have all secret versions for PIT
.andWhere(`${TableName.Project}.version`, "<", 3)
.delete();
} catch (error) {