diff options
Diffstat (limited to 'db/migrate/20171127151038_add_events_related_columns_to_merge_request_metrics.rb')
-rw-r--r-- | db/migrate/20171127151038_add_events_related_columns_to_merge_request_metrics.rb | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/db/migrate/20171127151038_add_events_related_columns_to_merge_request_metrics.rb b/db/migrate/20171127151038_add_events_related_columns_to_merge_request_metrics.rb deleted file mode 100644 index 385de9dd73d..00000000000 --- a/db/migrate/20171127151038_add_events_related_columns_to_merge_request_metrics.rb +++ /dev/null @@ -1,37 +0,0 @@ -class AddEventsRelatedColumnsToMergeRequestMetrics < ActiveRecord::Migration[4.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - change_table :merge_request_metrics do |t| - t.references :merged_by, references: :users - t.references :latest_closed_by, references: :users - end - - add_column :merge_request_metrics, :latest_closed_at, :datetime_with_timezone - - add_concurrent_foreign_key :merge_request_metrics, :users, - column: :merged_by_id, - on_delete: :nullify - - add_concurrent_foreign_key :merge_request_metrics, :users, - column: :latest_closed_by_id, - on_delete: :nullify - end - - def down - if foreign_keys_for(:merge_request_metrics, :merged_by_id).any? - remove_foreign_key :merge_request_metrics, column: :merged_by_id - end - - if foreign_keys_for(:merge_request_metrics, :latest_closed_by_id).any? - remove_foreign_key :merge_request_metrics, column: :latest_closed_by_id - end - - remove_columns :merge_request_metrics, - :merged_by_id, :latest_closed_by_id, :latest_closed_at - end -end |