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

ON_UPDATE constraint not added when new relation is created from schema #21189

Closed
u12206050 opened this issue Jan 25, 2024 · 2 comments · Fixed by #21190
Closed

ON_UPDATE constraint not added when new relation is created from schema #21189

u12206050 opened this issue Jan 25, 2024 · 2 comments · Fixed by #21190
Assignees
Labels

Comments

@u12206050
Copy link
Contributor

Describe the Bug

When importing a schema generated from another environment the on_update isn't added to the database.

After digging through the Directus code I found out why and am attaching a PR to this issue

To Reproduce

Create a relationship with on_update set to CASCADE, then export the schema and import on another db.

When you export schema from the new db, you will notice the on_update being NO ACTION
Screenshot 2024-01-25 at 09 51 50

Directus Version

10.8.3

Hosting Strategy

Self-Hosted (Docker Image)

@paescuj
Copy link
Member

paescuj commented Jan 25, 2024

@rijkvanzanten Does anything speak against passing through the ON UPDATE trigger? Was it simply omitted because it's not relevant in Directus itself (yet, see for example #16472)? Or could it actively lead to conflicts? 🤔

@rijkvanzanten
Copy link
Member

I think that's an oversight. I would expect that information to be in here, as the Directus GUI allows you to modify it

@u12206050 u12206050 changed the title ON_UPDATE constraint not added wehn new relation is created from schema ON_UPDATE constraint not added when new relation is created from schema Feb 3, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants