mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-23 17:01:35 -05:00
TemplateHistory objects need to be connected to the template's TemplateRedacted record. This requires setting up a new SQLAlchemy relationship to allow accessing redact_personalisation from TemplateHistory instances. We can avoid creating a foreign key in this case by setting up an explicit `primaryjoin` expression. Since TemplateHistory.id is created from Template.id and TemplateRedacted.template_id is already a foreign key to Template.id the foreign key should always be valid even without a DB constraint.
59 KiB
59 KiB