diff options
Diffstat (limited to 'db/post_migrate/20230412203234_remove_clusters_applications_jupyter_oauth_fk.rb')
-rw-r--r-- | db/post_migrate/20230412203234_remove_clusters_applications_jupyter_oauth_fk.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/db/post_migrate/20230412203234_remove_clusters_applications_jupyter_oauth_fk.rb b/db/post_migrate/20230412203234_remove_clusters_applications_jupyter_oauth_fk.rb new file mode 100644 index 00000000000..63474ebec36 --- /dev/null +++ b/db/post_migrate/20230412203234_remove_clusters_applications_jupyter_oauth_fk.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveClustersApplicationsJupyterOauthFk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:clusters_applications_jupyter, column: :oauth_application_id) + end + end + + def down + add_concurrent_foreign_key :clusters_applications_jupyter, :oauth_applications, + column: :oauth_application_id, on_delete: :nullify, name: 'fk_rails_331f0aff78' + end +end |