Skip to content
Snippets Groups Projects
Commit 13e9d221 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Include deletion of referencing rows in messaging.forecast_notification_log...

Include deletion of referencing rows in messaging.forecast_notification_log before deleting forecast_configuration
parent 1dc13447
No related branches found
No related tags found
No related merge requests found
......@@ -675,6 +675,10 @@ public class ForecastBean {
q = em.createNativeQuery("DELETE FROM public.forecast_summary WHERE forecast_configuration_id=:forecastConfigurationId");
q.setParameter("forecastConfigurationId", forecastConfiguration.getForecastConfigurationId());
q.executeUpdate();
// Entries in ForecastNotificationLog referencing the ForecastConfiguration must also be deleted
q = em.createNativeQuery("DELETE FROM messaging.forecast_notification_log WHERE forecast_configuration_id=:forecastConfigurationId");
q.setParameter("forecastConfigurationId", forecastConfiguration.getForecastConfigurationId());
q.executeUpdate();
em.remove(forecastConfiguration);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment