I am preparing a database migration crate. Its purpose will be to migrate a legacy database structure to a next-gen database structure, which represents (changed) domain models for a smart home network controller.
This conversion will be lossy at some places, since some old fields will not be available (since no longer needed) in the new models and some data in the new models will need to assume defaults, since no original data is available in the old models.
My question to you is, shall I use the From / TryFrom traits for this potentially lossy conversion, or would you rather recommend using custom traits / methods / functions for this?

1 post - 1 participant

Read full topic