max / makenotwork
| 1 | -- Fix download_fingerprints and streaming_sessions FK constraints to cascade on user deletion. |
| 2 | -- Previously these used the default ON DELETE RESTRICT, which blocked account deletion |
| 3 | -- for any user who had downloaded or streamed content. |
| 4 | |
| 5 | download_fingerprints |
| 6 | DROP CONSTRAINT download_fingerprints_user_id_fkey, |
| 7 | ADD CONSTRAINT download_fingerprints_user_id_fkey |
| 8 | FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; |
| 9 | |
| 10 | streaming_sessions |
| 11 | DROP CONSTRAINT streaming_sessions_user_id_fkey, |
| 12 | ADD CONSTRAINT streaming_sessions_user_id_fkey |
| 13 | FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; |
| 14 |