inab / benchmarking-data-model

OpenEBench Benchmarking Data Model repository
Creative Commons Attribution Share Alike 4.0 International
2 stars 7 forks source link

add "on_delete_hint" to the foreign keys. #137

Open redmitry opened 2 years ago

redmitry commented 2 years ago

For removing referenced objects it would be nice to define the action for the dependent objects (like in SQL)

"on_delete_hint": ["RESTRICT", "CASCADE", "DELETE"].

"foreign_keys": [
    {
        "schema_id": "Reference",
    "members": [ "." ],
        "on_delete_hint":  {
            "type": "string",
            "enum": ["RESTRICT", "CASCADE", "DELETE"],
            "default": "RESTRICT"
        }
   }
]

Where RESTRICS - forbid referred object removal, CASCADE - remove referral object and DELETE set the FK (string) null.

jmfernandez commented 2 years ago

In order to fulfill this issue it is needed first to properly document the syntax at https://github.com/inab/python-extended-json-schema-validator , and later implement it at that repo and https://gitlab.bsc.es/inb/elixir/json-schema-validator implementations.

So, I'm opening the corresponding issues.

jmfernandez commented 1 year ago

Now, we have to revise the whole schema in order to introduce these hints