2018-03-17 18:26:18 +05:30
|
|
|
# rubocop:disable Migration/RemoveColumn
|
|
|
|
# rubocop:disable Migration/UpdateLargeTable
|
2019-01-03 12:48:30 +05:30
|
|
|
class RevertAddNotifiedOfOwnActivityToUsers < ActiveRecord::Migration
|
2017-08-17 22:00:37 +05:30
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
def up
|
|
|
|
if our_column_exists?
|
|
|
|
remove_column :users, :notified_of_own_activity
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
unless our_column_exists?
|
|
|
|
add_column_with_default :users, :notified_of_own_activity, :boolean, default: false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def our_column_exists?
|
|
|
|
column_exists?(:users, :notified_of_own_activity)
|
|
|
|
end
|
|
|
|
end
|