Commit 5f410001 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'add-existence-checks-in-backported-migrations-ce' into 'master'

Make the time estimate migrations reversible

See merge request !8749
parents 94cc7cfa 929c20c2
......@@ -3,7 +3,7 @@ class AddEstimateToIssuablesCe < ActiveRecord::Migration
DOWNTIME = false
def change
def up
unless column_exists?(:issues, :time_estimate)
add_column :issues, :time_estimate, :integer
end
......@@ -12,4 +12,14 @@ class AddEstimateToIssuablesCe < ActiveRecord::Migration
add_column :merge_requests, :time_estimate, :integer
end
end
def down
if column_exists?(:issues, :time_estimate)
remove_column :issues, :time_estimate
end
if column_exists?(:merge_requests, :time_estimate)
remove_column :merge_requests, :time_estimate
end
end
end
......@@ -3,7 +3,7 @@ class CreateTimelogsCe < ActiveRecord::Migration
DOWNTIME = false
def change
def up
unless table_exists?(:timelogs)
create_table :timelogs do |t|
t.integer :time_spent, null: false
......@@ -17,4 +17,8 @@ class CreateTimelogsCe < ActiveRecord::Migration
add_index :timelogs, :user_id
end
end
def down
drop_table :timelogs if table_exists?(:timelogs)
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