feat(core): Add createdAt and updatedAt to data store user tables (no-changelog) (#18723)

This commit is contained in:
Daria
2025-08-25 16:23:34 +03:00
committed by GitHub
parent 67352ce2f8
commit 3c8f40007e
4 changed files with 409 additions and 155 deletions

View File

@@ -193,7 +193,13 @@ export function extractInsertedIds(raw: unknown, dbType: DataSourceOptions['type
}
export function normalizeRows(rows: DataStoreRows, columns: DataStoreColumn[]) {
const typeMap = new Map(columns.map((col) => [col.name, col.type]));
// we need to normalize system dates as well
const systemColumns = [
{ name: 'createdAt', type: 'date' },
{ name: 'updatedAt', type: 'date' },
];
const typeMap = new Map([...columns, ...systemColumns].map((col) => [col.name, col.type]));
return rows.map((row) => {
const normalized = { ...row };
for (const [key, value] of Object.entries(row)) {