broken_source_url_as_of is a column in the data_sources table (and represented in the /data-sources endpoints which indicates when a url was marked as broken.
This is currently manually specified, which is unnecessary, given that we can create a database trigger which automatically sets it if the url was previously marked as broken.
Requirements
Change broken_source_url_as_of to timestamp with time zone
Set up trigger logic. This trigger logic will look something like (pseudocode)
IF NEW.URL_STATUS != OLD.URL_STATUS AND NEW.URL_STATUS = 'broken':
SET BROKEN_SOURCE_AS_OF = CURRENT_TIMESTAMP
Remove broken_source_url_as_of as a key which can be included in the POST and PUT/data-sources endpoints
Tests
All existing tests should continue to pass
Docs
API documentation for /data-sourcesPOST and PUT should be modified accordingly.
Context
broken_source_url_as_of
is a column in thedata_sources
table (and represented in the/data-sources
endpoints which indicates when a url was marked as broken.This is currently manually specified, which is unnecessary, given that we can create a database trigger which automatically sets it if the url was previously marked as broken.
Requirements
broken_source_url_as_of
totimestamp with time zone
broken_source_url_as_of
as a key which can be included in thePOST
andPUT
/data-sources
endpointsTests
Docs
/data-sources
POST
andPUT
should be modified accordingly.Open questions