Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add "on_delete_hint" to the foreign keys. #137

Open
redmitry opened this issue Jul 8, 2022 · 2 comments
Open

add "on_delete_hint" to the foreign keys. #137

redmitry opened this issue Jul 8, 2022 · 2 comments
Milestone

Comments

@redmitry
Copy link
Contributor

redmitry commented Jul 8, 2022

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
Copy link
Member

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants