From 0d8aa41352e23af4173b86becf5c1b0c4f4116e6 Mon Sep 17 00:00:00 2001 From: Felix Schizlein Date: Mon, 26 Feb 2024 11:34:38 +0100 Subject: [PATCH] Run delete_all instead of destroy_all when removing old RES7 repositories --- .../20240129140413_remove_obsolete_res7_repositories.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/db/migrate/20240129140413_remove_obsolete_res7_repositories.rb b/db/migrate/20240129140413_remove_obsolete_res7_repositories.rb index 2dc1b14c1..687c69286 100644 --- a/db/migrate/20240129140413_remove_obsolete_res7_repositories.rb +++ b/db/migrate/20240129140413_remove_obsolete_res7_repositories.rb @@ -6,9 +6,13 @@ def change # This migration removes the now obsolete repositories, since RMT does # not remove these automatically. + # NOTE: We have a check in the repository model to stop users from + # deleting SUSE repositories. This is why need to run delete + # directly rather then destroying as usual. + # Affected repositories are: # - 1963: https://updates.suse.com/repo/$RCE/RES7/src/ # - 1736: https://updates.suse.com/repo/$RCE/RES7/x86_64/ - Repository.where(scc_id: [1963, 1736]).destroy_all + Repository.where(scc_id: [1963, 1736]).delete_all end end