Skip to content

add "on_delete_hint" to the foreign keys. #137

@redmitry

Description

@redmitry

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions