Closed Andreass2 closed 1 month ago
Should we set the the DateTime.NOW values in application or in the database? Theoretically there can be a timing issue if we mix the two as we will have two "sources-of-truth" for the current time. I'm guessing the difference would be in milliseconds top so problem may be insignificant.
Consistency can be good though. I think I would prefer to do it in the application (e.g, with DateTime.UtcNow) as that is where we also generate the GUID. Then the StatusChanged, Created fields etc would be non-nullable in the database.
en the StatusChanged, Created fields etc would be non-nullable in the database.
I have changed it to be required values which are now set in the application layer.
Btw, the PrimaryKey GUID's are created by EF. Can also create a issue to change that if you think it is bad practise
en the StatusChanged, Created fields etc would be non-nullable in the database.
I have changed it to be required values which are now set in the application layer.
Btw, the PrimaryKey GUID's are created by EF. Can also create a issue to change that if you think it is bad practise
I did not notice that, but we do not need to change it I think. It's okay to do it either way as long as it is consistent in the same codebase.
Description
Testdata had minvalues for datetimes
Created and StatusChanged are now required values
NB: Resets migrations. so test environment needs to delete db tables.
Related Issue(s)
Verification
Documentation