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

Deleting garden doesn't delete associated sensors #6

Open
tzou2024 opened this issue Oct 28, 2022 · 2 comments
Open

Deleting garden doesn't delete associated sensors #6

tzou2024 opened this issue Oct 28, 2022 · 2 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@tzou2024
Copy link
Collaborator

As part of the delete route for a garden, go back in and delete every sensor that has that deleted id in it's garden_id field.

@tzou2024
Copy link
Collaborator Author

This will probably be helpful:

https://motor.readthedocs.io/en/stable/api-asyncio/cursors.html

@tzou2024 tzou2024 added bug Something isn't working good first issue Good for newcomers labels Oct 28, 2022
@jonaskaz
Copy link
Contributor

We might actually never want to delete a garden or sensors. If we have sensor readings and we delete the sensor/garden that it references, the reading becomes meaningless (the reading will have an id that points nowhere). This could cause some of our future queries to fail unexpectedly if we are trying to link a reading back to a garden for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants