[BUG] Objection IdColumn with type uuid
generates the ID during migration, not during insertion
#2947
Labels
uuid
generates the ID during migration, not during insertion
#2947
Describe the bug
Function
createIdColumn
in @tsed/objection generates uuid usingcrypto
, but that means every new inserted value will have the same uuid.Instead, the default value should point to some kind o uuid generation algorithm in the database, to have per-row uuid generation during insertion
To Reproduce
createColumns
Expected behavior
The uuid generation should be per row, so the default should be set eg.
uuid_v4_generate()
in postgresCode snippets
https://github.com/tsedio/tsed/blob/0e999d593dfd6340243cf43b6763e4d2b9f05fd5/packages/orm/objection/src/components/createIdColumn.ts#L19C59-L19C69
Repository URL example
https://github.com/tsedio/tsed/blob/0e999d593dfd6340243cf43b6763e4d2b9f05fd5/packages/orm/objection/src/components/createIdColumn.ts#L19C59-L19C69
OS
macOs
Node version
Node v22.12.0
Library version
v7.84.0
Additional context
No response
The text was updated successfully, but these errors were encountered: