cubicweb_seda/migration/0.12.0_Any.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 07 Nov 2017 12:13:32 +0100
changeset 2870 c463fd270e81
parent 2867 fab0834688f7
child 2876 6624b3f44ace
child 2880 9ba129557eb4
permissions -rw-r--r--
[schema] Use hook instead of adding composite=True on seda_data_object_reference_id Because when this is not a simplified profile, we don't want the "auto-deletion" behaviour, ie deleting the data object when its reference is deleted. But since we still want this for simplified profiles, reimplement this behaviour using hook+op. Removing composite marker also implies to add/change some setup in various places controlled by the SEDA compound graph, which only consider composite relation. Add individual explanation as comment for posterity. At some point it would probably be desirable to allow *additional relations to follow* in the compound graph (we can only specify relations to filter out for now). Closes #17113413

rql('SET X compat_list CL + ", RNG" WHERE X compat_list CL')
commit()

rql('INSERT SEDAMimeType X: X user_cardinality "0..1", X seda_mime_type_from BDO '
    'WHERE NOT Y seda_mime_type_from BDO')

rql('INSERT SEDAFormatId X: X user_cardinality "0..1", X seda_format_id_from BDO '
    'WHERE NOT Y seda_format_id_from BDO')
commit()

sync_schema_props_perms('seda_mime_type_to')
sync_schema_props_perms('seda_format_id_to')
sync_schema_props_perms('seda_data_object_reference_id')