SolarArbiter / solarforecastarbiter-api

HTTP API and database schema for the Solar Forecast Arbiter
https://api.solarforecastarbiter.org
MIT License
10 stars 6 forks source link

Foreign key contraints on shared site prohibit organization deletion #144

Open lboeman opened 5 years ago

lboeman commented 5 years ago

While working on data sharing updates I discovered an issue with organization deletion Steps to reproduce:

alorenzo175 commented 4 years ago

I think I'm OK with just orphaning any forecast/obs. Any new thoughts @lboeman?

lboeman commented 4 years ago

That sounds fine to me. I think protecting against deleting an in-use site is probably worth while, either through a check at the API or just with a confirmation message on the dashboard. I think maybe assuming someone programming against the API would know to check is fine.

alorenzo175 commented 4 years ago

I guess the problem with checking if a site is in use is that the person deleting said site may not have permission to view whatever is using it. So maybe we should just make the warning message when deleting the site in the dashboard say that other forecasts/obs will be orphaned

lboeman commented 4 years ago

Ahh good point. I agree.