HackspaceJena / calcifer

An event management tool
MIT License
6 stars 4 forks source link

fixed deleting recurring appointments being broken #68

Open ikselven opened 6 years ago

ikselven commented 6 years ago

Fix for #65

Changed action for ON DELETE part of foreign key between relations repeated_events and repeated_events_log_entries to CASCADE, as this is probably what you want your DBMS to do when deleting recurring appointments.

The change introduced with this PR only applies when the Calcifer database is newly generated. To fix the problem for an already deployed database, use the following SQL statement and replace with the actual name of the problematic foreign key.

ALTER TABLE repeating_events_log_entries
    DROP CONSTRAINT <fk_name>,
    ADD CONSTRAINT <fk_name>
        FOREIGN KEY (repeating_events_id) REFERENCES repeating_events(id) ON DELETE CASCADE;
enko commented 6 years ago

@ikselven it would be great if you could add a migrations file for recreating the foreign key:

https://github.com/HackspaceJena/calcifer/tree/master/app/DoctrineMigrations