diff options
Diffstat (limited to 'db/migrate/20210322063407_add_dast_profile_id_fk_to_dast_profiles_pipelines.rb')
-rw-r--r-- | db/migrate/20210322063407_add_dast_profile_id_fk_to_dast_profiles_pipelines.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20210322063407_add_dast_profile_id_fk_to_dast_profiles_pipelines.rb b/db/migrate/20210322063407_add_dast_profile_id_fk_to_dast_profiles_pipelines.rb new file mode 100644 index 00000000000..4e9b3ddd41c --- /dev/null +++ b/db/migrate/20210322063407_add_dast_profile_id_fk_to_dast_profiles_pipelines.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddDastProfileIdFkToDastProfilesPipelines < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :dast_profiles_pipelines, :dast_profiles, column: :dast_profile_id, on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key :dast_profiles_pipelines, column: :dast_profile_id + end + end +end |