Commit 4f748f74 authored by Rydkin Maxim's avatar Rydkin Maxim

replace on_delete in migration with database type related expression

parent b49e7966
......@@ -24,8 +24,15 @@ class AddAutoCanceledByIdToPipeline < ActiveRecord::Migration
disable_ddl_transaction!
def up
on_delete =
if Database.mysql?
:nullify
else
'SET NULL'
end
add_column :ci_pipelines, :auto_canceled_by_id, :integer
add_concurrent_foreign_key :ci_pipelines, :ci_pipelines, column: :auto_canceled_by_id, on_delete: :nullify
add_concurrent_foreign_key :ci_pipelines, :ci_pipelines, column: :auto_canceled_by_id, on_delete: on_delete
end
def down
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment