I have some table where each entry can have different time validity. entry looks like this: (Id, ValidFrom, ValidTo). There can be more such entries with the same Id but with a different validity. (Validity should not overlap). I need to do insert/delete/update operations at current time or any future time point.
All this could be handled in business logic of the application, but I would like to refer to this table from other tables using foreign key.
I found out that Temporal Tables could be the way, but there is a small problem. The SysStartTime and SysEndTime columns are determined automatically by the time of INSERT/UPDATE and cannot be set when inserting/updating.
Is there a way how to store a validity information for each entry in database table while allowing foreign key constrains? Is that demand even reasonable?