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

Track foreign key ON DELETE setting in the internal schema representation #311

Merged
merged 3 commits into from
Mar 7, 2024

Conversation

andrew-farries
Copy link
Collaborator

Add the ON DELETE setting of a foreign key to the information stored about the key in the internal schema representation.

The schema representation for a foreign key now looks like:

{
  "some_table": {
    ...
    "foreignKeys": {
      "fk_users_id": {
        "name": "fk_users_id",
        "columns": [
          "user_id"
        ],
        "onDelete": "NO ACTION",
        "referencedTable": "users",
        "referencedColumns": [
          "id"
        ]
      }
    }
  }
}

Fixes #309

Ensure that the default for an FK is `NO ACTION` if no `ON DELETE` is
specified.
Ensure that the schema representation is correct for this kind of key.
@andrew-farries andrew-farries merged commit c88c060 into main Mar 7, 2024
42 checks passed
@andrew-farries andrew-farries deleted the update-fk-state-schema-query branch March 7, 2024 08:59
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

Successfully merging this pull request may close these issues.

Track foreign key ON DELETE setting in the internal schema representation
2 participants