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

Removing a field from a collection kills its relationships #9987

Closed
3 tasks done
sebescudie opened this issue Nov 22, 2021 · 1 comment
Closed
3 tasks done

Removing a field from a collection kills its relationships #9987

sebescudie opened this issue Nov 22, 2021 · 1 comment

Comments

@sebescudie
Copy link

sebescudie commented Nov 22, 2021

Preflight Checklist

Describe the Bug

If a collection has several O2M fields, adding a field to that collection and then deleting it nullifies all its relations. I would have expected the field to simply be removed without affecting the item's relations.

Been using Directus for a few days only, I might have missed something. If that's the case then I'm sorry :)

To Reproduce

  • Create two collections named parents and children
  • Give them both a name field
  • Add a children O2M field to parents
  • In the Content section, add a new item to parents and add two children to it
  • Now go back to the data model section and add an address field to the parent collection
  • Validate the changes and check your Content section : you should still see children listed under parents
  • Go back to the data model section, and delete the address field from parents
  • The Content section now shows no children in the parent item

See a repro capture here

directus_scaled.mp4

Errors Shown

Nope

What version of Directus are you using?

9.0.1

What version of Node.js are you using?

16.13.0

What database are you using?

SQLite 3.34.1

What browser are you using?

Firefox

What operating system are you using?

W10

How are you deploying Directus?

Locally

@rijkvanzanten
Copy link
Member

I believe this is the same issue I've reported on knex (the database abstraction library).. here: knex/knex#4155 with in-works PR knex/knex#4189

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants