debian-mirror-gitlab/db/post_migrate/20191204114127_delete_legacy_triggers.rb
2020-03-09 13:42:32 +05:30

17 lines
334 B
Ruby

# frozen_string_literal: true
class DeleteLegacyTriggers < ActiveRecord::Migration[5.2]
DOWNTIME = false
def up
execute <<~SQL
DELETE FROM ci_triggers WHERE owner_id IS NULL
SQL
change_column_null :ci_triggers, :owner_id, false
end
def down
change_column_null :ci_triggers, :owner_id, true
end
end