Add data attribution column to annotation projects
aaronxsu opened this issue · comments
Aaron Su commented
To support data attribution per annotation project, this issue is to build the backend support of it. Please refer to this issue to see more context about it.
- The
data_attributions
field is going to onannotation_projects
table - Default is an empty jsonb array
'{}'::jsonb
:- Why jsonb array? Because there could be more than one layer per project (default and overlays), and each will have a display name and an optional hyperlink for the display name
- Why default to empty jsonb array? An empty jsonb array is better than an
Option[T]
in this case
- This field should look like below:
select '[{"name":"asdf", "link":"https://path/to/thing"}, {"name":"asdf2", "link":"https://path/to/thing2"}]'::json;
json
------------------------------------------------------------------------------------------------
[{"name":"asdf", "link":"https://path/to/thing"}, {"name":"asdf2", "link":"https://path/to/thing2"}]
(1 row)
- Each element should be decoded to something like the following:
case class DataAttribution(
name: String,
link: Option[URI]
)
- Update annotation project CRUD endpoints to handle this new field properly