prisma / prisma1

💾 Database Tools incl. ORM, Migrations and Admin UI (Postgres, MySQL & MongoDB) [deprecated]
https://v1.prisma.io/docs/
Apache License 2.0
16.56k stars 867 forks source link

Cascade delete not set on one-to-many relation #5196

Closed FrederikRobijns closed 2 years ago

FrederikRobijns commented 2 years ago

Describe the bug The Foreign Key constraint is not set to cascade delete in the data base for inline relations. Even though the relation is marked with "onDelete: CASCADE"

To Reproduce Steps to reproduce the behavior:

  1. Define a data model containing a one-to-many relation between two tables
  2. Mark the relation on the parent table as cascade delete
  3. Run prisma deploy

Expected behavior The Foreign Key contraint created for the relation to be set to cascade delete.

Screenshots image

Versions (please complete the following information):

Additional context The columns on the child on which the FK is set, are also not marked as non-null, even though they are not nullable in the model.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.