These changes implement the data model to support display of score-set-specific links to the UCSC Genome Browser and other sites and services.
Notes on the data model
One suggested approach was to add a table for external links with a many-to-one relationship to score sets. Each row would have a site name or link type (e.g. "UCSC Genome Browser") and a URL.
On the other hand, we could just add a column like ucsc_genome_browser_url to the score sets table.
The latter option seems too specific when we know we're likely to add more links. But I'm not sure it's worth adding table relationships for this yet, so I've opted to add a JSONB column to the score sets table. This is the intended usage of the new external_links column:
That is, it's an object whose keys identify the target site or service. The values are objects that currently only include URLs, but we can add metadata as necessary later. On the API side, the structure above is exposed and enforced by explicit Pydantic models.
Release notes
After releasing this code change, populate the new column using the attached SQL file. I've opted not to add this to the code base as a data migration, since the contents are contingent and will continue to be updated. I'm inclined to treat these links as on par with other user-contributed data.
These changes implement the data model to support display of score-set-specific links to the UCSC Genome Browser and other sites and services.
Notes on the data model
The latter option seems too specific when we know we're likely to add more links. But I'm not sure it's worth adding table relationships for this yet, so I've opted to add a JSONB column to the score sets table. This is the intended usage of the new external_links column:
That is, it's an object whose keys identify the target site or service. The values are objects that currently only include URLs, but we can add metadata as necessary later. On the API side, the structure above is exposed and enforced by explicit Pydantic models.
Release notes
After releasing this code change, populate the new column using the attached SQL file. I've opted not to add this to the code base as a data migration, since the contents are contingent and will continue to be updated. I'm inclined to treat these links as on par with other user-contributed data.