Commit b5757b49 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'label-event-migration-ee' into 'master'

Make sure that resource_label_event.epic_id exists

Closes #7705

See merge request gitlab-org/gitlab-ee!7460
parents 6500145d b02298ba
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20180920043317) do ActiveRecord::Schema.define(version: 20180924070647) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
......
---
title: Make sure that epic_id column exists in resource_label_events when upgrading
from CE to EE.
merge_request:
author:
type: fixed
# frozen_string_literal: true
class AddLabelEventEpicColumn < ActiveRecord::Migration
DOWNTIME = false
def up
# When moving from CE to EE, this column may already exist
return if column_exists?(:resource_label_events, :epic_id)
add_reference :resource_label_events, :epic, null: true, index: true, foreign_key: { on_delete: :cascade }
end
def down
# epic_id is deleted in db/migrate/20180726172057_create_resource_label_events.rb
end
end
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