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

Unable to delete relation via apply-snapshot once it is already created in DB #23175

Open
itszeeshan opened this issue Aug 5, 2024 · 0 comments

Comments

@itszeeshan
Copy link

Describe the Bug

Hi,

Create a snapshot of the current data model without relationships using npx directus schema snapshot. Create a relationship between two collections. Apply the snapshot using npx directus schema apply, and you will encounter an error because the relationship already exists (Products collection: supplier is Many to One, Supplier collection: products is One to Many). But the apply schema just can't delete it.

To Reproduce

  • Create a snapshot of current data model without relationship between two collections using```npx directus schema snapshot``.
  • Create a relationship between two collections.
  • Now update this data model using npx directus schema apply with the snapshot you got from step 1. Without the relationship.
  • You'll get this error
Screenshot 2024-08-05 at 3 23 27 PM
  • The relationship between these two collections already exists. In Products Collection supplier is Many to One and in Supplier Collection products is One to Many.

Directus Version

10.13.1

Hosting Strategy

Self-Hosted (Docker Image)

Database

postgres:latest

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

No branches or pull requests

2 participants