gitlab-org--gitlab-foss/db/post_migrate/20191204114127_delete_legacy_triggers.rb

18 lines
334 B
Ruby
Raw Normal View History

# 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