Open pavelfilippi opened 1 year ago
Weather station cannot be removed if there are data linked in weather_real_time table.
weather_real_time
1, Create weather station 2, Insert related weather data 3, Remove weather station
{ "data": null, "errors": [ { "message": "(sqlalchemy.dialects.postgresql.asyncpg.IntegrityError) <class 'asyncpg.exceptions.NotNullViolationError'>: null value in column \"station_id\" of relation \"_hyper_1_1_chunk\" violates not-null constraint\nDETAIL: Failing row contains (2022-11-24 11:01:37.123, null, 0, 0, 0, 0).\n[SQL: UPDATE weather_real_time SET station_id=%s WHERE weather_real_time.time = %s]\n[parameters: (None, datetime.datetime(2022, 11, 24, 11, 1, 37, 123000))]\n(Background on this error at: https://sqlalche.me/e/14/gkpj)", "locations": [ { "line": 2, "column": 3 } ], "path": [ "removeWeatherStation" ] } ] }
Weather station should be possible to remove and still keep weather condition data.
Partially fixed in https://github.com/pavelfilippi/weather-monitor/pull/18. Users can now remove weather station, but it cascades to related weather conditions.
Description
Weather station cannot be removed if there are data linked in
weather_real_time
table.Steps to reproduce
1, Create weather station 2, Insert related weather data 3, Remove weather station
Desired behavior
Weather station should be possible to remove and still keep weather condition data.