The same run can be added to a dataset more than once, causing dataset queries and analyses to include duplicate samples.
The datasets_runs table has a nonunique index on (dataset_id, run_id), and dataset::add always inserts a new row. Repeating an ID in one command or running the command again creates duplicate membership rows.
The schema should enforce uniqueness for (dataset_id, run_id). Adding an existing membership should either be idempotent or return a clear conflict error. Tests should cover duplicate IDs in one request and repeated additions across requests.
The same run can be added to a dataset more than once, causing dataset queries and analyses to include duplicate samples.
The
datasets_runstable has a nonunique index on(dataset_id, run_id), anddataset::addalways inserts a new row. Repeating an ID in one command or running the command again creates duplicate membership rows.The schema should enforce uniqueness for
(dataset_id, run_id). Adding an existing membership should either be idempotent or return a clear conflict error. Tests should cover duplicate IDs in one request and repeated additions across requests.