fermitools / metacat

Metadata Catalog
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Cannot remove a parent dataset #13

Closed marcmengel closed 6 months ago

marcmengel commented 6 months ago

if you

metacat dataset create ns:fred
metacat dataset add-subset ns:fred ns:existing

you can not

metacat dataset remove ns:fred

You get a stacktrace ending in:

psycopg2.errors.ForeignKeyViolation: update or delete on table "datasets" violates foreign key constraint "datasets_parent_child_parent_namespace_parent_name_fkey" on table "datasets_parent_child"
DETAIL:  Key (namespace, name)=(ns, fred) is still referenced from table "datasets_parent_child".

So you might think then you need to remove the subset ns:existing from the ns:fred dataset first before you can remove it, but there is no call to do that -- there is no metacat dataset remove-subset...