diff options
Diffstat (limited to 'db/post_migrate/20211201101541_drop_clusters_applications_runners_ci_runners_fk.rb')
-rw-r--r-- | db/post_migrate/20211201101541_drop_clusters_applications_runners_ci_runners_fk.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/db/post_migrate/20211201101541_drop_clusters_applications_runners_ci_runners_fk.rb b/db/post_migrate/20211201101541_drop_clusters_applications_runners_ci_runners_fk.rb new file mode 100644 index 00000000000..9a02f64e350 --- /dev/null +++ b/db/post_migrate/20211201101541_drop_clusters_applications_runners_ci_runners_fk.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class DropClustersApplicationsRunnersCiRunnersFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:clusters_applications_runners, :ci_runners, name: 'fk_02de2ded36') + end + end + + def down + add_concurrent_foreign_key(:clusters_applications_runners, :ci_runners, name: 'fk_02de2ded36', column: :runner_id, target_column: :id, on_delete: 'set null') + end +end |