debian-mirror-gitlab/db/post_migrate/20211118130836_drop_pages_deployments_builds_fk.rb
2022-01-26 12:08:38 +05:30

23 lines
464 B
Ruby

# frozen_string_literal: true
class DropPagesDeploymentsBuildsFk < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
FK_NAME = 'fk_rails_c3a90cf29b'
def up
remove_foreign_key_if_exists(:pages_deployments, :ci_builds, name: FK_NAME)
end
def down
add_concurrent_foreign_key(
:pages_deployments,
:ci_builds,
name: FK_NAME,
column: :ci_build_id,
target_column: :id,
on_delete: :nullify
)
end
end